|
|
@@ -21,7 +21,7 @@
|
|
|
<span>{{ row.quantity }}{{ row.measuringUnit }}</span>
|
|
|
</template>
|
|
|
|
|
|
- <template v-slot:receiveQuantity="{ row }">
|
|
|
+ <!-- <template v-slot:receiveQuantity="{ row }">
|
|
|
<el-input
|
|
|
placeholder=""
|
|
|
v-model="row.receiveQuantity"
|
|
|
@@ -29,6 +29,11 @@
|
|
|
>
|
|
|
<template slot="append">{{ row.measuringUnit }}</template>
|
|
|
</el-input>
|
|
|
+ </template> -->
|
|
|
+ <template v-slot:receiveQuantity="{ row }">
|
|
|
+ <el-input placeholder="" v-model="row.receiveQuantity" disabled>
|
|
|
+ <template slot="append">{{ row.measuringUnit }}</template>
|
|
|
+ </el-input>
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:weight="{ row }">
|
|
|
@@ -52,6 +57,7 @@
|
|
|
v-if="rejectDialogVisible"
|
|
|
title="请输入驳回原因"
|
|
|
width="30vw"
|
|
|
+ append-to-body
|
|
|
:close-on-click-modal="false"
|
|
|
:before-close="
|
|
|
() => {
|
|
|
@@ -84,7 +90,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { pleaseEntrustGoodsDetail } from '@/api/entrust';
|
|
|
- import { confirmReceipt, receiveGoos } from '@/api/beEntrusted';
|
|
|
+ import { confirmReceipt, rejectGoods } from '@/api/beEntrusted';
|
|
|
import { typeName } from '@/views/produce/components/common.js';
|
|
|
export default {
|
|
|
data() {
|
|
|
@@ -105,7 +111,8 @@
|
|
|
reason: [
|
|
|
{ required: true, message: '请输入驳回原因', trigger: 'blur' }
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ itemData: {}
|
|
|
};
|
|
|
},
|
|
|
|
|
|
@@ -150,14 +157,14 @@
|
|
|
showOverflowTooltip: true
|
|
|
},
|
|
|
|
|
|
- {
|
|
|
- prop: 'quantity',
|
|
|
- slot: 'quantity',
|
|
|
- label: '数量',
|
|
|
- align: 'center',
|
|
|
- minWidth: 110,
|
|
|
- showOverflowTooltip: true
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // prop: 'quantity',
|
|
|
+ // slot: 'quantity',
|
|
|
+ // label: '数量',
|
|
|
+ // align: 'center',
|
|
|
+ // minWidth: 110,
|
|
|
+ // showOverflowTooltip: true
|
|
|
+ // },
|
|
|
|
|
|
{
|
|
|
prop: 'receiveQuantity',
|
|
|
@@ -227,6 +234,7 @@
|
|
|
open(item, type) {
|
|
|
this.visible = true;
|
|
|
this.id = item.id;
|
|
|
+ this.itemData = item;
|
|
|
this.type = type;
|
|
|
this.title = this.type != 'send' ? '收货单' : '发货单';
|
|
|
this.getDetail(item.id);
|
|
|
@@ -249,34 +257,146 @@
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ // save() {
|
|
|
+ // if (this.selection.length == 0) {
|
|
|
+ // return this.$message.warning('请先选择一条收货数据!');
|
|
|
+ // }
|
|
|
+
|
|
|
+ // const selectionIds = new Set(this.selection.map((it) => it.id));
|
|
|
+
|
|
|
+ // for (let item of this.goodsList) {
|
|
|
+ // if (!selectionIds.has(item.id)) {
|
|
|
+ // item.receiveQuantity = 0;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // if (
|
|
|
+ // Number(this.itemData.sendOutQuantity) <
|
|
|
+ // Number(this.itemData.formingNum)
|
|
|
+ // ) {
|
|
|
+ // this.$confirm('收货数量小于请托数量是否继续收货?', '提示', {
|
|
|
+ // type: 'warning'
|
|
|
+ // })
|
|
|
+ // .then(() => {
|
|
|
+ // this.loading = this.$loading({
|
|
|
+ // lock: true,
|
|
|
+ // text: '加载中',
|
|
|
+ // background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ // });
|
|
|
+ // confirmReceipt(this.goodsList)
|
|
|
+ // .then((res) => {
|
|
|
+ // this.loading.close();
|
|
|
+ // this.$message.success('收货成功');
|
|
|
+ // this.$emit('done');
|
|
|
+ // this.visible = false;
|
|
|
+ // })
|
|
|
+ // .catch(() => {
|
|
|
+ // this.loading.close();
|
|
|
+ // });
|
|
|
+ // })
|
|
|
+ // .catch(() => {});
|
|
|
+ // } else if (
|
|
|
+ // Number(this.itemData.sendOutQuantity) ==
|
|
|
+ // Number(this.itemData.formingNum)
|
|
|
+ // ) {
|
|
|
+ // this.loading = this.$loading({
|
|
|
+ // lock: true,
|
|
|
+ // text: '加载中',
|
|
|
+ // background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ // });
|
|
|
+ // confirmReceipt(this.goodsList)
|
|
|
+ // .then((res) => {
|
|
|
+ // this.loading.close();
|
|
|
+ // this.$message.success('收货成功');
|
|
|
+ // this.$emit('done');
|
|
|
+ // this.visible = false;
|
|
|
+ // })
|
|
|
+ // .catch(() => {
|
|
|
+ // this.loading.close();
|
|
|
+ // });
|
|
|
+ // } else if (
|
|
|
+ // Number(this.itemData.sendOutQuantity) >
|
|
|
+ // Number(this.itemData.formingNum)
|
|
|
+ // ) {
|
|
|
+ // this.$confirm('收货数量大于请托数量是否继续收货?', '提示', {
|
|
|
+ // type: 'warning'
|
|
|
+ // })
|
|
|
+ // .then(() => {
|
|
|
+ // this.loading = this.$loading({
|
|
|
+ // lock: true,
|
|
|
+ // text: '加载中',
|
|
|
+ // background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ // });
|
|
|
+ // confirmReceipt(this.goodsList)
|
|
|
+ // .then((res) => {
|
|
|
+ // this.loading.close();
|
|
|
+ // this.$message.success('收货成功');
|
|
|
+ // this.$emit('done');
|
|
|
+ // this.visible = false;
|
|
|
+ // })
|
|
|
+ // .catch(() => {
|
|
|
+ // this.loading.close();
|
|
|
+ // });
|
|
|
+ // })
|
|
|
+ // .catch(() => {});
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+
|
|
|
save() {
|
|
|
- if (this.selection.length == 0) {
|
|
|
+ if (this.selection.length === 0) {
|
|
|
return this.$message.warning('请先选择一条收货数据!');
|
|
|
}
|
|
|
|
|
|
const selectionIds = new Set(this.selection.map((it) => it.id));
|
|
|
-
|
|
|
- for (let item of this.goodsList) {
|
|
|
+ this.goodsList.forEach((item) => {
|
|
|
if (!selectionIds.has(item.id)) {
|
|
|
item.receiveQuantity = 0;
|
|
|
}
|
|
|
+ });
|
|
|
+
|
|
|
+ const totalNum = this.selection.reduce(
|
|
|
+ (total, pro) => total + Number(pro.receiveQuantity || 0),
|
|
|
+ 0
|
|
|
+ );
|
|
|
+
|
|
|
+ const formingNum = Number(this.itemData.sendOutQuantity);
|
|
|
+
|
|
|
+ let confirmMessage = '';
|
|
|
+
|
|
|
+ console.log(totalNum, formingNum, '8888');
|
|
|
+
|
|
|
+ if (totalNum < formingNum) {
|
|
|
+ confirmMessage = '收货数量小于请托数量,是否继续收货?';
|
|
|
+ } else if (totalNum > formingNum) {
|
|
|
+ confirmMessage = '收货数量大于请托数量,是否继续收货?';
|
|
|
}
|
|
|
|
|
|
- this.loading = this.$loading({
|
|
|
- lock: true,
|
|
|
- text: '加载中',
|
|
|
- background: 'rgba(0, 0, 0, 0.7)'
|
|
|
- });
|
|
|
- confirmReceipt(this.goodsList)
|
|
|
- .then((res) => {
|
|
|
- this.loading.close();
|
|
|
- this.$message.success('收货成功');
|
|
|
- this.$emit('done');
|
|
|
- this.visible = false;
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.loading.close();
|
|
|
+ const doConfirmReceipt = () => {
|
|
|
+ this.loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
});
|
|
|
+
|
|
|
+ confirmReceipt(this.goodsList)
|
|
|
+ .then(() => {
|
|
|
+ this.loading.close();
|
|
|
+ this.$message.success('收货成功');
|
|
|
+ this.$emit('done');
|
|
|
+ this.visible = false;
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.loading.close();
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ if (confirmMessage) {
|
|
|
+ this.$confirm(confirmMessage, '提示', { type: 'warning' })
|
|
|
+ .then(() => doConfirmReceipt())
|
|
|
+ .catch(() => {});
|
|
|
+ } else {
|
|
|
+ doConfirmReceipt();
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
cancel() {
|
|
|
@@ -296,7 +416,9 @@
|
|
|
return it.id;
|
|
|
});
|
|
|
|
|
|
- receiveGoos({
|
|
|
+ console.log('7777');
|
|
|
+
|
|
|
+ rejectGoods({
|
|
|
ids,
|
|
|
applyId: this.id,
|
|
|
beReason: this.rejectForm.reason
|
|
|
@@ -306,15 +428,6 @@
|
|
|
this.visible = false;
|
|
|
this.$emit('done');
|
|
|
});
|
|
|
- // rejectEntrust({
|
|
|
- // id: this.id,
|
|
|
- // reason: this.rejectForm.reason
|
|
|
- // }).then(() => {
|
|
|
- // this.$message.success('驳回成功');
|
|
|
- // this.rejectDialogVisible = false;
|
|
|
- // this.visible = false;
|
|
|
- // this.$emit('done');
|
|
|
- // });
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
});
|