|
|
@@ -10,23 +10,14 @@
|
|
|
<u-input v-model="formData.name" placeholder="请输入" type="text" />
|
|
|
</u-form-item>
|
|
|
<u-form-item label="报损报溢部门" class="required-form" prop="bizScene" borderBottom>
|
|
|
- <u-input v-model="formData.reportDeptName" disableColor="#ffffff" placeholder="请选择" disabled type="select" />
|
|
|
+ <u-input v-model="formData.executeGroupName" disableColor="#ffffff" @click.native="$refs.treePicker._show()" placeholder="请选择" type="select" />
|
|
|
</u-form-item>
|
|
|
<u-form-item label="报损报溢人" class="required-form" prop="reportName" borderBottom>
|
|
|
- <u-input :value="formData.reportName" disableColor="#ffffff" placeholder="请选择" disabled type="select" />
|
|
|
- </u-form-item>
|
|
|
- <u-form-item label="审核人部门" prop="verifyDeptName" borderBottom>
|
|
|
- <u-input :value="formData.verifyDeptName" disableColor="#ffffff" placeholder="请选择" disabled type="select" @click.native="$refs.treePicker._show()" />
|
|
|
- <u-icon slot="right" name="arrow-right"></u-icon>
|
|
|
- </u-form-item>
|
|
|
- <u-form-item label="审核人" prop="auditId" borderBottom>
|
|
|
- <picker @change="e => handlePicker(e, userList, 'auditId', 'auditName')" :value="pickerIndex" :range="userList" range-key="name">
|
|
|
- <u-input :value="formData.auditName" disableColor="#ffffff" placeholder="请选择" disabled type="select" />
|
|
|
- </picker>
|
|
|
- <u-icon slot="right" name="arrow-right"></u-icon>
|
|
|
+ <!-- <u-input :value="formData.reportName" disableColor="#ffffff" placeholder="请选择" disabled type="select" /> -->
|
|
|
+ <view class="select_user"><uni-data-select v-model="formData.executorId" @change="userChange" :localdata="userList" :clear="false"></uni-data-select></view>
|
|
|
</u-form-item>
|
|
|
<u-form-item label="备注" prop="remark" borderBottom>
|
|
|
- <u-textarea confirmType="done" :maxlength="-1" height="80" v-model="formData.remark" placeholder="请输入"></u-textarea>
|
|
|
+ <u-input v-model="formData.remark" placeholder="请输入" type="text" />
|
|
|
</u-form-item>
|
|
|
</u-form>
|
|
|
|
|
|
@@ -36,39 +27,46 @@
|
|
|
</template>
|
|
|
<view class="order-box">盘点工单{{ formData.workOrderCode }}</view>
|
|
|
<view v-for="(item, index) in formData.list" :key="index" class="list-card">
|
|
|
- <view class="status" :style="{ color: _getStatus(item.status).color }">
|
|
|
- <text>{{ _getStatus(item.status).name }}</text>
|
|
|
- <text>数量:{{ [1, 2].includes(item.status) ? '-1' : `+${item.checkNum || 0}` }}</text>
|
|
|
+ <view class="status" :style="{ color: colorInfo[item.status] }">
|
|
|
+ <text>{{ statusInfo[item.status] }}</text>
|
|
|
+ <text>数量:{{ item[countInfo[item.status]] }}</text>
|
|
|
</view>
|
|
|
<view class="row first">
|
|
|
<view class="col" style="width: 100%">
|
|
|
- <text class="main">{{ item.name }}</text>
|
|
|
- {{ item.code }}
|
|
|
+ <text class="main">{{ item.categoryName }}</text>
|
|
|
+ {{ item.categoryCode }}
|
|
|
+ </view>
|
|
|
+ <view class="col" style="width: 100%">
|
|
|
+ <text class="main">包装编码:</text>
|
|
|
+ {{ item.packageNo }}
|
|
|
</view>
|
|
|
<view class="col" style="width: 100%">
|
|
|
- <text class="main">货位:</text>
|
|
|
- {{ item.warehouseName }}-{{ item.reservoirName }}-{{ item.goodsShelfName }}-{{ item.goodsAllocationName }}
|
|
|
+ <text class="main">仓库:</text>
|
|
|
+ {{ item.info.warehouseName }}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="row">
|
|
|
<view class="col">
|
|
|
- <text class="label">批次号:</text>
|
|
|
- {{ item.batchNo }}
|
|
|
+ <text class="label">包装数量:</text>
|
|
|
+ {{ item.info.packingCountBase }}
|
|
|
+ </view>
|
|
|
+ <view class="col">
|
|
|
+ <text class="label">包装单位:</text>
|
|
|
+ {{ item.info.packingUnit }}
|
|
|
</view>
|
|
|
<view class="col">
|
|
|
- <text class="label">类型:</text>
|
|
|
- {{ getDictValue('物品类型', item.productType) }}
|
|
|
+ <text class="label">重量:</text>
|
|
|
+ {{ item.info.weight }}
|
|
|
</view>
|
|
|
- <view class="col" v-for="(itm, index) in tableHeader" :key="index">
|
|
|
- <text class="label">{{ itm.label }}:</text>
|
|
|
- {{ item[itm.prop] }}
|
|
|
+ <view class="col">
|
|
|
+ <text class="label">重量单位:</text>
|
|
|
+ {{ item.info.weightUnit }}
|
|
|
</view>
|
|
|
- <view class="col" v-if="!item.isUnpack">
|
|
|
- <text class="label">最小单元:</text>
|
|
|
- {{ item.unit }}/{{ item.minPackUnit }}
|
|
|
+ <view class="col">
|
|
|
+ <text class="label">批次号:</text>
|
|
|
+ {{ item.batchNo }}
|
|
|
</view>
|
|
|
</view>
|
|
|
- <uni-icons type="trash" size="30" class="del" @click="delRow(index)"></uni-icons>
|
|
|
</view>
|
|
|
</uni-section>
|
|
|
|
|
|
@@ -76,13 +74,13 @@
|
|
|
<u-button type="success" @click="handleSubmit">提交</u-button>
|
|
|
</view>
|
|
|
|
|
|
- <ba-tree-picker ref="treePicker" :multiple="false" @select-change="deptConfirm" key="dept" title="选择部门" :localdata="deptList" valueKey="code" textKey="name" childrenKey="children" />
|
|
|
+ <ba-tree-picker ref="treePicker" :multiple="false" @select-change="deptConfirm" title="选择部门" :localdata="listData" valueKey="id" textKey="name" childrenKey="children" />
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { post, postJ, get, getJ } from '@/utils/api.js'
|
|
|
- import { getDict, wh_equStatus, getDictName, warehousingType } from '../enum.js'
|
|
|
+ import { getCode, saveReportsList } from '@/api/warehouseManagement'
|
|
|
+ import { listOrganizations, getUserPage } from '@/api/myTicket/index.js'
|
|
|
import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
|
|
|
import { getRuleNo } from '@/utils/utils.js'
|
|
|
// import dictMxins from '@/mixins/dictMixins'
|
|
|
@@ -91,17 +89,50 @@
|
|
|
// mixins: [dictMxins],
|
|
|
data() {
|
|
|
return {
|
|
|
- warehousingType,
|
|
|
- getDictName,
|
|
|
+ userList: [],
|
|
|
+ listData: [],
|
|
|
+ statusInfo: {
|
|
|
+ 2: '盘盈',
|
|
|
+ 3: '丢失',
|
|
|
+ 4: '破损'
|
|
|
+ },
|
|
|
+ countInfo: {
|
|
|
+ 2: 'surplusQuantity',
|
|
|
+ 3: 'loseQuantity',
|
|
|
+ 4: 'wornQuantity'
|
|
|
+ },
|
|
|
+ colorInfo: {
|
|
|
+ 2: 'red',
|
|
|
+ 3: 'green',
|
|
|
+ 4: 'black'
|
|
|
+ },
|
|
|
+ statusOption: [
|
|
|
+ {
|
|
|
+ label: '盘盈',
|
|
|
+ value: '2',
|
|
|
+ numKey: 'surplusQuantity'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '丢失',
|
|
|
+ value: '3',
|
|
|
+ numKey: 'loseQuantity'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '破损',
|
|
|
+ value: '4',
|
|
|
+ numKey: 'wornQuantity'
|
|
|
+ }
|
|
|
+ ],
|
|
|
pickerIndex: 0,
|
|
|
deptList: [],
|
|
|
userList: [],
|
|
|
formData: {
|
|
|
- code: getRuleNo('BS'),
|
|
|
- auditId: '',
|
|
|
- auditName: '',
|
|
|
- verifyDeptCode: '',
|
|
|
- verifyDeptName: '',
|
|
|
+ code: '',
|
|
|
+ name: '',
|
|
|
+ executeGroupName: '',
|
|
|
+ executeGroupId: '',
|
|
|
+ executorName: '',
|
|
|
+ executorId: '',
|
|
|
workOrderCode: '',
|
|
|
list: []
|
|
|
},
|
|
|
@@ -117,162 +148,62 @@
|
|
|
}
|
|
|
},
|
|
|
onLoad({ id }) {
|
|
|
- this.requestDict('物品类型')
|
|
|
+ // this.requestDict('物品类型')
|
|
|
if (id) {
|
|
|
this.getDetail(id)
|
|
|
} else {
|
|
|
const userInfo = uni.getStorageSync('userInfo')
|
|
|
-
|
|
|
- this.formData.reportName = userInfo.name
|
|
|
- this.formData.reportId = userInfo.id
|
|
|
- this.formData.reportDeptName = userInfo.dept.name
|
|
|
- this.formData.reportDeptId = userInfo.dept.code
|
|
|
+ console.log(userInfo)
|
|
|
}
|
|
|
-
|
|
|
this.getDept()
|
|
|
+ this.getOrderCode()
|
|
|
uni.$off('getWorkorder')
|
|
|
uni.$on('getWorkorder', data => {
|
|
|
+ console.log(data)
|
|
|
if (data?.id) {
|
|
|
- this.formData.workOrderCode = data.workOrderCode
|
|
|
- this.isMaterial = data.assetDict?.code === 3
|
|
|
- this._getAbnormaldetailList(data.id)
|
|
|
+ this.formData.workOrderCode = data.code
|
|
|
+ this.formData.list = data.planDetailVOList
|
|
|
+ this.formData.tableList = [data]
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- computed: {
|
|
|
- tableHeader() {
|
|
|
- if (this.formData.list?.length) {
|
|
|
- return this.getTableHeader(this.formData.list[0].assetTypeDict)
|
|
|
- }
|
|
|
- return []
|
|
|
- }
|
|
|
- },
|
|
|
methods: {
|
|
|
- getTableHeader(selectEquiType) {
|
|
|
- switch (+selectEquiType) {
|
|
|
- case 3:
|
|
|
- return [{ label: '牌号', prop: 'assetBrand' }]
|
|
|
- case 8:
|
|
|
- return [
|
|
|
- { label: '型号', prop: 'assetSku' },
|
|
|
- { label: '规格', prop: 'specification' }
|
|
|
- ]
|
|
|
- case 4:
|
|
|
- return [
|
|
|
- { label: '牌号', prop: 'assetBrand' },
|
|
|
- { label: '型号', prop: 'assetSku' }
|
|
|
- ]
|
|
|
- case 5: //'周转车'
|
|
|
- return [
|
|
|
- { label: '规格', prop: 'specification' },
|
|
|
- {
|
|
|
- label: '材质',
|
|
|
- prop: 'texture',
|
|
|
- formatter(row) {
|
|
|
- if (!row?.extendField) return ''
|
|
|
- const extendField = JSON.parse(row.extendField)
|
|
|
- return extendField.texture
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '长宽高',
|
|
|
- prop: '',
|
|
|
- formatter(row) {
|
|
|
- if (!row?.extendField) return ''
|
|
|
- const extendField = JSON.parse(row.extendField)
|
|
|
- return `${extendField.length || '-'}*${extendField.width || '-'}*${extendField.high || '-'}`
|
|
|
- }
|
|
|
- }
|
|
|
- ]
|
|
|
- case 2: //'舟皿'
|
|
|
- return [
|
|
|
- { label: '规格', prop: 'specification' },
|
|
|
- { label: '型号', prop: 'assetSku' },
|
|
|
- {
|
|
|
- label: '长宽高',
|
|
|
- prop: '',
|
|
|
- formatter(row) {
|
|
|
- if (!row?.extendField) return ''
|
|
|
- const extendField = JSON.parse(row.extendField)
|
|
|
- return `${extendField.length || '-'}*${extendField.width || '-'}*${extendField.high || '-'}`
|
|
|
- }
|
|
|
- }
|
|
|
- ]
|
|
|
- case 1: //'设备'
|
|
|
- return [
|
|
|
- { label: '型号', prop: 'assetSku' },
|
|
|
- { label: '规格', prop: 'specification' }
|
|
|
- ]
|
|
|
- case 6: //'模具'
|
|
|
- return [
|
|
|
- { label: '牌号', prop: 'assetBrand' },
|
|
|
- { label: '型号', prop: 'assetSku' },
|
|
|
- {
|
|
|
- label: '收缩系数',
|
|
|
- prop: '',
|
|
|
- formatter(row) {
|
|
|
- if (!row?.extendField) return ''
|
|
|
- const extendField = JSON.parse(row.extendField)
|
|
|
- return extendField.shrinkageCoefficient
|
|
|
- }
|
|
|
- }
|
|
|
- ]
|
|
|
- case 7: //'备品备件'
|
|
|
- return [
|
|
|
- { label: '规格', prop: 'specification' },
|
|
|
- { label: '型号', prop: 'assetSku' }
|
|
|
- ]
|
|
|
- }
|
|
|
-
|
|
|
- return []
|
|
|
+ userChange(value) {
|
|
|
+ this.formData.executorId = value
|
|
|
+ this.formData.executorName = this.userList.find(item => item.value == value).text
|
|
|
+ },
|
|
|
+ async getOrderCode() {
|
|
|
+ const code = await getCode('plan_profit_loss')
|
|
|
+ this.formData.code = code
|
|
|
},
|
|
|
- _getStatus: getDict(wh_equStatus),
|
|
|
workorderSelect() {
|
|
|
uni.navigateTo({
|
|
|
url: '/pages/warehouse/reportLoss/workorderSelected'
|
|
|
})
|
|
|
},
|
|
|
- async getDetail(id) {
|
|
|
- // const res = await get(this.apiUrl + `/breakag/info/${id}`);
|
|
|
- // if (res?.success) {
|
|
|
- // this.formData = res.data;
|
|
|
- // }
|
|
|
- },
|
|
|
- // 工单详情
|
|
|
- async _getAbnormaldetailList(workOrderId) {
|
|
|
- // const res = await postJ(
|
|
|
- // this.apiUrl +
|
|
|
- // `/repertoryCheck/getAbnormaldetailList?workOrderId=${workOrderId}`
|
|
|
- // );
|
|
|
- // if (res?.success) {
|
|
|
- // this.formData.list = (res.data || []).map((itm) => {
|
|
|
- // delete itm.id;
|
|
|
- // if ([1, 2].includes(itm.equStatus)) {
|
|
|
- // itm.checkNum = 1;
|
|
|
- // }
|
|
|
- // return {
|
|
|
- // ...itm,
|
|
|
- // amount: itm.checkNum,
|
|
|
- // model: itm.assetSku,
|
|
|
- // name: itm.assetName,
|
|
|
- // productType: itm.assetTypeDict,
|
|
|
- // code: itm.assetCode,
|
|
|
- // batch: itm.batchNo,
|
|
|
- // num: itm.bucketNum,
|
|
|
- // bizTypeId: itm.bizTypeId,
|
|
|
- // bizTypeName: itm.bizTypeName,
|
|
|
- // status: itm.equStatus,
|
|
|
- // unitPrice: itm.univalence,
|
|
|
- // minimumUnit: itm.minPackUnit,
|
|
|
- // };
|
|
|
- // });
|
|
|
- // }
|
|
|
- },
|
|
|
- delRow(index) {
|
|
|
- this.formData.list.splice(index, 1)
|
|
|
- },
|
|
|
+ async getDetail(id) {},
|
|
|
async handleSubmit() {
|
|
|
- // this.$refs.formRef.validate().then(async () => {
|
|
|
+ if (!this.formData.name) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请输入名称!',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.formData.executeGroupId) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请选择部门!',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.formData.executorId) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请选择人员!',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
if (!this.formData.list?.length) {
|
|
|
uni.showToast({
|
|
|
title: '请选择工单!',
|
|
|
@@ -280,61 +211,59 @@
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- // const res = await postJ(this.apiUrl + `/breakag/save`, this.formData);
|
|
|
- // if (res?.success) {
|
|
|
- // uni.showToast({
|
|
|
- // title: "提交成功!",
|
|
|
- // icon: "success",
|
|
|
- // });
|
|
|
-
|
|
|
- // uni.navigateBack({
|
|
|
- // delta: 1,
|
|
|
- // });
|
|
|
- // }
|
|
|
- // })
|
|
|
- },
|
|
|
- // 抬头下拉信息保存
|
|
|
- handlePicker(e, list, idKey, nameKey) {
|
|
|
- if (idKey) {
|
|
|
- this.formData[idKey] = list[e.detail.value].id
|
|
|
- }
|
|
|
- if (nameKey) {
|
|
|
- this.formData[nameKey] = list[e.detail.value].name
|
|
|
+ let params = {
|
|
|
+ ...this.formData,
|
|
|
+ info: this.formData.tableList,
|
|
|
+ status: 1
|
|
|
}
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ })
|
|
|
+ saveReportsList(params)
|
|
|
+ .then(() => {
|
|
|
+ uni.hideLoading()
|
|
|
+ uni.showToast({
|
|
|
+ title: '提交成功!',
|
|
|
+ icon: 'success'
|
|
|
+ })
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/warehouse/reportLoss/index`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ uni.hideLoading()
|
|
|
+ })
|
|
|
},
|
|
|
// 部门确认
|
|
|
deptConfirm(data, name) {
|
|
|
- this.formData.verifyDeptCode = data[0]
|
|
|
- this.formData.verifyDeptName = name
|
|
|
- this.formData.auditId = ''
|
|
|
- this.formData.auditName = ''
|
|
|
-
|
|
|
+ this.formData.executeGroupId = data[0]
|
|
|
+ this.formData.executeGroupName = name
|
|
|
+ this.formData.executorId = ''
|
|
|
+ this.formData.executorName = ''
|
|
|
this.getUser(data[0])
|
|
|
},
|
|
|
// 获取部门
|
|
|
getDept() {
|
|
|
- // get(this.apiUrl + '/main/org/dept/effectiveTree').then(res => {
|
|
|
- // if (res?.success) {
|
|
|
- // this.deptList = res.data
|
|
|
- // }
|
|
|
- // })
|
|
|
+ listOrganizations(1).then(data => {
|
|
|
+ this.listData = data
|
|
|
+ })
|
|
|
},
|
|
|
-
|
|
|
// 获取人员
|
|
|
getUser(deptCode) {
|
|
|
- // post(this.apiUrl + "/main/user/list", {
|
|
|
- // deptCode,
|
|
|
- // page: 1,
|
|
|
- // size: 9999,
|
|
|
- // }).then((res) => {
|
|
|
- // if (res?.success) {
|
|
|
- // this.userList = res.data.items.map((item) => {
|
|
|
- // item.name = item.trueName;
|
|
|
- // item.id = item.userId;
|
|
|
- // return item;
|
|
|
- // });
|
|
|
- // }
|
|
|
- // });
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ })
|
|
|
+ getUserPage({ pageNum: 1, size: -1, groupId: deptCode })
|
|
|
+ .then(data => {
|
|
|
+ this.userList = data.list.map(item => {
|
|
|
+ item.text = item.name
|
|
|
+ item.value = item.id
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ uni.hideLoading()
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -349,8 +278,24 @@
|
|
|
}
|
|
|
|
|
|
.mainBox {
|
|
|
+ /deep/.baseForm {
|
|
|
+ .u-form-item__body {
|
|
|
+ padding: 0rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
padding-bottom: 90rpx;
|
|
|
-
|
|
|
+ /deep/.required-form .u-form-item__body__left__content__label::before {
|
|
|
+ content: '*';
|
|
|
+ color: red;
|
|
|
+ }
|
|
|
+ .select_user {
|
|
|
+ width: 100%;
|
|
|
+ padding: 12rpx 20rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ /deep/ .uni-select {
|
|
|
+ height: 48rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
.order-box {
|
|
|
color: #7f7f7f;
|
|
|
background-color: rgba(215, 215, 215, 0.729411764705882);
|
|
|
@@ -362,7 +307,7 @@
|
|
|
}
|
|
|
|
|
|
.list-card {
|
|
|
- border-bottom: 6rpx solid #f2f2f2;
|
|
|
+ border-bottom: 20rpx solid #f2f2f2;
|
|
|
position: relative;
|
|
|
.status {
|
|
|
padding: 6rpx 20rpx;
|