更换正式环境,测试修改

This commit is contained in:
GaoHao
2025-03-25 21:49:33 +08:00
parent f01bc839f7
commit 7fe5d028e4
71 changed files with 930 additions and 2016 deletions

View File

@@ -20,112 +20,96 @@
<view> 预警值 </view>
<view> <input type="number" placeholder="请输入预警值" v-model="datas.form.conWarning" name="" id=""> </view>
</view>
<view style="justify-content: space-between;">
<view v-if="!datas.form.id" style="justify-content: space-between;">
<view> 耗材类型 </view>
<view style="width: 54%;" @tap="datas.showStatus = !datas.showStatus">
{{datas.typelist[datas.nowStatusIndex]}}
<view style="width: 54%;" @tap="datas.show = !datas.show">
{{datas.consGroupName||'请选择耗材类型'}}
</view>
<uni-icons type="bottom" size="16"></uni-icons>
</view>
</view>
</view>
<view :style="{height:datas.showStatus?statusHeight:0}" class="tranistion status overflow-hide">
<view @tap="changeNowStatusIndex(index)" class="u-flex u-p-l-30 lh30 u-p-r-30 u-row-between"
v-for="(item,index) in datas.typelist" :key="index">
<view :class="{'color-main':datas.nowStatusIndex===index}">{{item}}</view>
<uni-icons v-if="datas.nowStatusIndex===index" type="checkmarkempty" :color="color.ColorMain"></uni-icons>
</view>
<view :style="{height: '14px'}"></view>
</view>
<view class="bottombutton">
<up-button type="primary" style="background-color: #318AFE;color: #fff;" @tap="sumbit" :plain="true"
text="保存"></up-button>
</view>
<up-picker :show="datas.show" :columns="datas.typeList" keyName="name" @cancel="datas.show=false" @confirm="confirmConsGroup" ></up-picker>
<!-- 消息提示 -->
<up-toast ref="uToastRef"></up-toast>
</template>
<script setup>
import {
reactive,
computed,
onMounted,
getCurrentInstance
} from 'vue';
import {
tbConsTypeList,
tbConsInfoAddlist
} from '@/http/yskApi/requestAll.js';
import color from '@/commons/color.js';
import go from '@/commons/utils/go.js';
import { getConsGrpupList,addCons } from '@/http/api/cons.js';
import { reactive } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { getConsGrpupList, addCons, editCons } from '@/http/api/cons.js';
let datas = reactive({
show: false,
form: {
conWarning: 999
conUnit: '',
conName: '',
price: '',
conWarning: 999,
consGroupId: null,
},
showStatus: false,
list: [],
typelist: [],
nowStatusIndex: 0
consGroupName: '',
typeList: [],
})
onMounted(() => {
gettbConsTypeList()
onLoad((options) => {
if( options && options.item ) {
let obj = JSON.parse(options.item)
datas.form = obj
} else {
gettbConsTypeList()
}
uni.setNavigationBarTitle({
title: !datas.form.id ? '添加耗材' : '编辑耗材'
})
})
/**
* 获取耗材类别
*/
let gettbConsTypeList = () => {
datas.typelist = []
getConsGrpupList({
page: 0,
page: 1,
size: 30,
shopId: uni.getStorageSync("shopId"),
}).then(res => {
datas.list = res
res.forEach(ele => {
datas.typelist.push(ele.name)
})
datas.typeList = [res]
})
}
const refs = getCurrentInstance()
let sumbit = () => {
function confirmConsGroup(e){
datas.show = false
datas.form.consGroupId = e.value[0].id
datas.consGroupName = e.value[0].name
}
let sumbit = async () => {
let conUnitdata = datas.form.conUnit.replace(/(^\s*)|(\s*$)/g, "")
if (!conUnitdata) {
refs.ctx.$refs.uToastRef.show({
type: 'default',
message: "单位不能为空"
})
uni.$utils.showToast('单位不能为空')
return
}
if (!datas.form.price) {
refs.ctx.$refs.uToastRef.show({
type: 'default',
message: "价格不能为空"
})
uni.$utils.showToast('价格不能为空')
return
}
console.log(datas.list, 'tiaoshi1')
console.log(datas.list[datas.nowStatusIndex], 'tiaoshi1')
addCons({
...datas.form,
shopId: uni.getStorageSync("shopId"),
consGroupId: datas.list[datas.nowStatusIndex].id
}).then(res => {
// go.to('PAGES_SALES_CONSUMABLES')
go.back()
})
if (!datas.form.consGroupId) {
uni.$utils.showToast('耗材类型不能为空')
return
}
if ( !datas.form.id) {
await addCons({...datas.form})
} else {
await editCons({...datas.form})
}
uni.navigateBack()
}
const statusHeight = computed(() => {
return 30 * datas.typelist.length + 14 + 'px'
})
function changeNowStatusIndex(i) {
datas.nowStatusIndex = i
datas.showStatus = false
}
</script>
<style>
page {

View File

@@ -1,7 +1,7 @@
<template>
<view>
<view class="addType">
<view v-for="item in datas.list">
<view v-for="(item,index) in datas.list" :key="index">
<view class="">
{{item.name}}<up-icon color="#64A7FE" name="edit-pen" @tap="showoneEvent(item)"></up-icon>
</view>

View File

@@ -2,44 +2,24 @@
<view class="warehouseEntry">
<view>
<view>
<view>
<text style="color: red;">*</text> 供应商
</view>
<view>
<input type="text" placeholder="请输入供应商名称" v-model="datas.form.name" name="" id="">
</view>
<view><text style="color: red;">*</text>供应商</view>
<view><input type="text" placeholder="请输入供应商名称" v-model="datas.form.name" name="" id=""></view>
</view>
<view>
<view>
<text style="color: red;">*</text> 联系电话
</view>
<view>
<input type="text" placeholder="请输入联系电话" v-model="datas.form.telephone" name="" id="">
</view>
<view><text style="color: red;">*</text>联系电话</view>
<view><input type="text" placeholder="请输入联系电话" v-model="datas.form.telephone" name="" id=""></view>
</view>
<view>
<view>
<text style="color: red;">*</text> 地址
</view>
<view>
<input type="text" placeholder="请输入地址" v-model="datas.form.address" name="" id="">
</view>
<view><text style="color: red;">*</text>地址</view>
<view><input type="text" placeholder="请输入地址" v-model="datas.form.address" name="" id=""></view>
</view>
<view>
<view>
<text style="color: red;">*</text> 排序
</view>
<view>
<input type="number" placeholder="请输入排序" @change="datas.form.sort=$utils.isNumber(datas.form.sort)" v-model="datas.form.sort" name="" id="">
</view>
<view><text style="color: red;">*</text>排序</view>
<view><input type="number" placeholder="请输入排序" @change="datas.form.sort=$utils.isNumber(datas.form.sort)" v-model="datas.form.sort" name="" id=""></view>
</view>
<view>
<view>
备注
</view>
<view>
<input type="text" placeholder="请输入备注" v-model="datas.form.remark" name="" id="">
</view>
<view>备注</view>
<view><input type="text" placeholder="请输入备注" v-model="datas.form.remark" name="" id=""></view>
</view>
</view>
</view>

View File

@@ -27,7 +27,7 @@
<view class="reportDamage_cell">
<view class="cell_lable">报损图片</view>
<view class="cell_value file">
<view class="file_img" v-for="(item,index) in vdata.imgUrlList">
<view class="file_img" v-for="(item,index) in vdata.imgUrlList" :key="index">
<up-image class="file_img_item" :show-loading="true" :src="item"></up-image>
<view class="del" @tap="del(index)">
<up-icon name="trash" color="#fff" size="25" @tap="plus"></up-icon>

View File

@@ -1,122 +0,0 @@
<template>
<view class="topTitle">
耗材信息
</view>
<view class="addConsumables">
<view>
<view>
<view> 单位 </view>
<view> <input type="text" placeholder="请输入单位" v-model="datas.form.conUnit" name="" id=""> </view>
</view>
<view>
<view> 耗材名称 </view>
<view> <input type="text" placeholder="请输入耗材名称" v-model="datas.form.conName" name="" id=""> </view>
</view>
<view>
<view> 耗材价格 </view>
<view> <input class="uni-input" placeholder="请输入耗材价格" type="number" v-model="datas.form.price"> </view>
</view>
<view>
<view> 预警值 </view>
<view> <input type="number" placeholder="请输入预警值" v-model="datas.form.conWarning" name="" id=""> </view>
</view>
</view>
</view>
<view class="bottombutton">
<up-button type="primary" style="background-color: #318AFE;color: #fff;" @tap="sumbit" :plain="true"
text="保存"></up-button>
</view>
</template>
<script setup>
import { reactive, computed, onMounted } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { editCons } from '@/http/api/cons.js';
import color from '@/commons/color.js';
import go from '@/commons/utils/go.js';
let datas = reactive({
form: {
conWarning: 999
},
})
onLoad((options) => {
let obj = JSON.parse(options.item)
datas.form = obj
})
let sumbit = () => {
editCons(datas.form).then(res => {
go.back()
})
}
</script>
<style>
page {
background-color: #f9f9f9;
}
</style>
<style scoped lang="less">
.topTitle {
font-weight: 400;
font-size: 32rpx;
color: #333333;
margin: 32rpx 28rpx;
}
.addConsumables {
width: 694rpx;
height: 540rpx;
background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx;
margin: 32rpx;
padding: 1rpx 24rpx;
box-sizing: border-box;
>view {
>view {
width: 646rpx;
height: 84rpx;
background: #fcfcfc;
border: 2rpx solid #F9F9F9;
margin-top: 32rpx;
.df;
>view:first-child {
width: 190rpx;
height: 84rpx;
line-height: 84rpx;
// text-align: left;
padding-left: 24rpx;
background: #F9F9F9;
border-radius: 8rpx 0rpx 0rpx 8rpx;
border: 2rpx solid #F9F9F9;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 32rpx;
color: #333333;
}
}
}
}
.bottombutton {
margin-top: 84rpx;
padding: 0 24rpx;
>button {
width: 530rpx;
height: 80rpx;
border-radius: 56rpx 56rpx 56rpx 56rpx;
}
}
.df() {
display: flex;
align-items: center;
}
</style>

View File

@@ -1,27 +1,18 @@
<template>
<view class="ConsumablesTop">
<view @tap="showStatus = !showStatus" style="display: flex;align-items: center;">
{{datas.title}}<up-icon name="arrow-down" size="12"></up-icon>
<view @tap="pageData.show = !pageData.show" style="display: flex;align-items: center;">
{{pageData.title}}<up-icon name="arrow-down" size="12"></up-icon>
</view>
<view>
<input v-model="datas.conName" @input="inputEvent" type="text" placeholder="请输入耗材名称" />
<input v-model="pageData.query.conName" @input="inputEvent" type="text" placeholder="请输入耗材名称" />
</view>
<view @tap="toUrl('PAGES_ADD_TYPE') ">
新增类别
</view>
</view>
<view :style="{height:showStatus?statusHeight:0}" class="tranistion status overflow-hide">
<view @tap="changeNowStatusIndex(index)" class="u-flex u-p-l-30 lh30 u-p-r-30 u-row-between"
v-for="(item,index) in datas.typeLists" :key="index">
<view :class="{'color-main':nowStatusIndex===index}">{{item}}</view>
<uni-icons v-if="nowStatusIndex===index" type="checkmarkempty" :color="color.ColorMain"></uni-icons>
</view>
<view :style="{height: '14px'}"></view>
</view>
<view class="ConsumablesConent" v-if="datas.list.length">
<view v-for="(item,index) in datas.list" :key="index">
<view class="ConsumablesConent" v-if="pageData.list.length">
<view v-for="(item,index) in pageData.list" :key="index">
<view> {{item.conName}}
<view> {{item.consGroupName}} </view>
</view>
@@ -59,7 +50,6 @@
<view @tap="toUrl('PAGES_ADD_CONSUMABLES')"> 新增耗材 </view>
<view @tap="toUrl('PAGES_SUPPLIER')"> 供应商管理 </view>
</view>
<my-action-sheet @itemClick="sheetClick" ref="refMoreSheet" :list="actionSheet.list"></my-action-sheet>
<my-reportDamage ref="reportDamage" title="耗材报损" :item="report.data" @affirm="affirm"></my-reportDamage>
<up-popup :show="show" :round="18" mode="center" >
@@ -74,69 +64,69 @@
</view>
</view>
</up-popup>
<up-action-sheet :round="10" @select="actionSelect" @close="actions.show = false" cancelText="取消" :actions="actions.list"
:show="actions.show"></up-action-sheet>
<up-picker :show="pageData.show" :columns="pageData.typeList" keyName="name" @cancel="pageData.show=false" @confirm="confirmConsGroup" ></up-picker>
</template>
<script setup>
import { onShow } from '@dcloudio/uni-app'
import { onShow, onLoad } from '@dcloudio/uni-app'
import { ref, reactive, computed } from 'vue';
import myActionSheet from './components/my-action-sheet';
import myReportDamage from './components/my-reportDamage';
import color from '@/commons/color.js';
import go from '@/commons/utils/go.js';
import { hasPermission } from '@/commons/utils/hasPermission.js';
import { getConsPage,getConsGrpupList } from '@/http/api/cons.js';
let reportDamage = ref(null)
let refMoreSheet = ref(null)
let show = ref(false)
let showData = ref()
const report = reactive({
data: {
// thumbnail: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240918/a17a62b7b55a4b65a2a2542050672b34.png',
name: "美式咖啡",
// title: "商品报损",
unit: "杯",
},
})
let datas = reactive({
let pageData = reactive({
show: false,
query: {
conName: '',
consGroupId: '',
size: 100,
page: 1
},
list: [],
conName: "",
showtwo: false,
status: '0',
// 类型列表
typeList: [],
// 类型列表渲染数组
typeLists: ['全部'],
title: '耗材类型'
})
const statusHeight = computed(() => {
return 30 * datas.typeLists.length + 14 + 'px'
/**
* 更多操作列表
*/
const actions = reactive({
list: [
{ name: '报损', color: 'red', fontSize: '16' },
{ name: '编辑', color: '#333', fontSize: '16' },
{ name: '清点', color: '#333', fontSize: '16' },
{ name: '入库', color: '#333', fontSize: '16' },
{ name: '出库', color: '#333', fontSize: '16' },
],
data: null,
show: false,
})
const actionSheet = reactive({
list: ['报损', '编辑', '清点', '入库', '出库', ],
activeId: null,
active: ""
})
let showStatus = ref(false)
let nowStatusIndex = ref(0)
onShow(() => {
getList()
// 获取分类列表
gettbConsTypeList()
})
/**
* 获取耗材列表
*/
async function getList(d = "") {
getConsPage({
conName: datas.conName,
conTypeId: d,
size: 100,
page: 1
}).then(res => {
datas.list = res.records
async function getList() {
getConsPage(pageData.query).then(res => {
pageData.list = res.records
})
}
@@ -144,27 +134,19 @@
* 获取耗材类别
*/
let gettbConsTypeList = () => {
datas.typeLists = ['全部']
getConsGrpupList({
page: 1,
size: 30,
}).then(res => {
datas.typeList = res
res.forEach(ele => {
datas.typeLists.push(ele.name)
})
pageData.typeList = [[{name:'全部',id:''},...res]]
})
}
function changeNowStatusIndex(i) {
nowStatusIndex.value = i
showStatus.value = false
if (i == 0) {
datas.title = '全部'
getList()
} else {
datas.title = datas.typeList[i - 1].conTypeName
getList(datas.typeList[i - 1].id)
}
function confirmConsGroup(e){
pageData.show = false
pageData.query.consGroupId = e.value[0].id
pageData.title = e.value[0].name
getList()
}
/**
@@ -181,62 +163,58 @@
}
let toggle = (d) => {
refMoreSheet.value.open()
actionSheet.active = d
actionSheet.activeId = d.id
// refMoreSheet.value.open()
actions.show = true;
actions.actions = d
report.data.consId = d.id
}
let sheetClick = (index) => {
if (index == 0) {
let actionSelect = ( e ) => {
if ( e.name == '报损' ) {
// 权限
hasPermission('允许提交报损').then(ele => {
if (ele) {
//打开报损弹窗
reportDamage.value.open(actionSheet.activeId);
report.data.name = actionSheet.active.conName
report.data.unit = actionSheet.active.conUnit
reportDamage.value.open(actions.actions.id);
report.data.name = actions.actions.conName
report.data.unit = actions.actions.conUnit
}
})
} else if (index == 1) {
toUrl('PAGES_EDIT_CONSUMABLES', {
item: JSON.stringify(actionSheet.active)
} else if ( e.name == '编辑' ) {
toUrl('PAGES_ADD_CONSUMABLES', {
item: JSON.stringify(actions.actions)
})
} else if (index == 2) {
} else if ( e.name == '清点' ) {
hasPermission('允许耗材盘点').then(ele => {
if (ele) {
toUrl('PAGES_SALES_INVENTORYCHECK', {
item: JSON.stringify(actionSheet.active)
item: JSON.stringify(actions.actions)
})
}
})
} else if (index == 3) {
} else if ( e.name == '入库' ) {
hasPermission('允许耗材入库').then(ele => {
if (ele) {
toUrl('PAGES_SALES_WAREHOUSEENTRY', {
consId: actionSheet.activeId,
item: JSON.stringify(actionSheet.active)
consId: actions.actions.id,
item: JSON.stringify(actions.actions)
})
}
})
} else if (index == 4) {
} else if ( e.name == '出库' ) {
hasPermission('允许耗材出库').then(ele => {
if (ele) {
toUrl('PAGES_SALES_OUTBOUND', {
consId: actionSheet.activeId,
item: JSON.stringify(actionSheet.active)
consId: actions.actions.id,
item: JSON.stringify(actions.actions)
})
}
})
}
}
// async function viewpermission(d) {
// let res = await hasPermission(d)
// return res
// }
function inputEvent(d) {
datas.conName = d.detail.value.replace(/\s*/g, "");
pageData.query.conName = d.detail.value.replace(/\s*/g, "");
getList()
}

View File

@@ -28,7 +28,7 @@
</view>
<view>
<view> <text style="color: red;">*</text>单价 </view>
<view> <input type="number" placeholder="请输入单价(元)" v-model="datas.form.bodyList.purchasePrice" @change="datas.form.bodyList.purchasePrice = $utils.isPrice(datas.form.bodyList.purchasePrice)" name="" id=""> </view>
<view> <input type="number" placeholder="请输入单价(元)" v-model="datas.form.bodyList.purchasePrice" @change="datas.form.bodyList.purchasePrice = $utils.isMoney(datas.form.bodyList.purchasePrice)" name="" id=""> </view>
</view>
<view style="justify-content: space-between;">
<view> 单位 </view>
@@ -97,6 +97,8 @@
// 单位列表
datas.unitList = [ datas.form.conUnit,datas.form.conUnitTwo]
datas.form.bodyList.unit=datas.form.defaultUnit
datas.form.bodyList.conName = datas.form.conName
datas.form.bodyList.unitName = datas.form.unitName
})
onShow(() => {
getList()

View File

@@ -26,7 +26,7 @@
</view>
<view>
<view> <text style="color: red;">*</text>单价 </view>
<view> <input type="number" placeholder="请输入单价(元)" v-model="datas.form.bodyList.purchasePrice" @change="datas.form.bodyList.purchasePrice = $utils.isPrice(datas.form.bodyList.purchasePrice)" name="" id=""> </view>
<view> <input type="number" placeholder="请输入单价(元)" v-model="datas.form.bodyList.purchasePrice" @change="datas.form.bodyList.purchasePrice = $utils.isMoney(datas.form.bodyList.purchasePrice)" name="" id=""> </view>
</view>
<view style="justify-content: space-between;">
<view> 单位 </view>
@@ -99,6 +99,8 @@
// 单位列表
datas.unitList = [ datas.form.conUnit, datas.form.conUnitTwo]
datas.form.bodyList.unit = datas.form.defaultUnit
datas.form.bodyList.conName = datas.form.conName
datas.form.bodyList.unitName = datas.form.unitName
})
onShow(() => {
getList()
@@ -161,13 +163,7 @@
})
return
}
if (!datas.list[nowStatusIndex.value]) {
refs.ctx.$refs.uToastRef.show({
type: 'default',
message: "供应商不能为空",
})
return
}
datas.form.bodyList.conId = datas.item.id
datas.form.bodyList = [datas.form.bodyList]
datas.form.inOutDate = dayjs(datas.form.inOutDate).format('YYYY-MM-DD')