|
|
@@ -68,7 +68,52 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
+ <!-- 发货总重 -->
|
|
|
+ <template v-slot:sendTotalWeight="scope">
|
|
|
+ <el-form-item
|
|
|
+ style="margin-bottom: 20px"
|
|
|
+ :prop="'datasource.' + scope.$index + '.sendTotalWeight'"
|
|
|
+ :rules="[
|
|
|
+ { required: entrustedCode&&pricingWay==2, message: '请输入数字', trigger: 'blur' }
|
|
|
+ ]"
|
|
|
+ >
|
|
|
+ <el-input v-model="scope.row.sendTotalWeight" @blur="changeSendTotalWeight(scope.$index)"
|
|
|
+ :disabled="!entrustedCode"
|
|
|
+ style="width: 60%; margin-right: 10px">
|
|
|
+
|
|
|
+ </el-input>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ v-if="entrustedCode"
|
|
|
+ @click.native="(e)=>handleOutBound(e,scope.row,scope.$index)"
|
|
|
+ >选择
|
|
|
+ </el-button
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ <!-- 收货总重 -->
|
|
|
+ <template v-slot:receiveTotalWeight="scope">
|
|
|
+ <el-form-item
|
|
|
+ style="margin-bottom: 20px"
|
|
|
+ :prop="'datasource.' + scope.$index + '.receiveTotalWeight'"
|
|
|
+ :rules="[
|
|
|
+ { required: entrustedCode&&pricingWay==2, message: '请输入数字', trigger: 'blur' }
|
|
|
+ ]"
|
|
|
+ >
|
|
|
+ <el-input v-model="scope.row.receiveTotalWeight" @blur="changeReceiveTotalWeight(scope.$index)"
|
|
|
+ style="width: 60%; margin-right: 10px">
|
|
|
|
|
|
+ </el-input>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ @click.native="(e)=>handleInnerBound(e,scope.row,scope.$index)"
|
|
|
+ >选择
|
|
|
+ </el-button
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
<template v-slot:totalCount="scope">
|
|
|
<el-form-item
|
|
|
style="margin-bottom: 20px"
|
|
|
@@ -108,23 +153,36 @@
|
|
|
type="send"
|
|
|
@changeParent="changeParent"
|
|
|
></product-list>
|
|
|
+ <!--出库详情-->
|
|
|
+ <outbound-details-dialog v-if="outboundDetailsDialogFlag" ref="outboundDetailsDialogRef"
|
|
|
+ :outboundDetailsDialogFlag.sync="outboundDetailsDialogFlag"
|
|
|
+ @saveDate="saveDate"></outbound-details-dialog>
|
|
|
+ <!--入库详情-->
|
|
|
+ <innertboundDetailsDialog v-if="innerboundDetailsDialogFlag" ref="innerboundDetailsDialogRef"
|
|
|
+ :innerboundDetailsDialogFlag.sync="innerboundDetailsDialogFlag"
|
|
|
+ @saveDate="saveInnerDate"></innertboundDetailsDialog>
|
|
|
</el-form>
|
|
|
</template>
|
|
|
<script>
|
|
|
- import { numberReg } from 'ele-admin';
|
|
|
- import dictMixins from '@/mixins/dictMixins';
|
|
|
- import productList from '@/views/bpm/handleTask/components/saleOrder/invoice/product-list.vue';
|
|
|
+import {numberReg} from 'ele-admin';
|
|
|
+import dictMixins from '@/mixins/dictMixins';
|
|
|
+import productList from '@/views/bpm/handleTask/components/saleOrder/invoice/product-list.vue';
|
|
|
+import innertboundDetailsDialog
|
|
|
+ from "@/views/bpm/handleTask/components/purchaseOrder/returnGoods/innerboundDetailsDialog.vue";
|
|
|
+import OutboundDetailsDialog from "@/views/bpm/handleTask/components/purchaseOrder/invoice/outboundDetailsDialog.vue";
|
|
|
|
|
|
- import { getWarehouseOutStock } from '@/api/bpm/components/saleManage/saleorder';
|
|
|
- export default {
|
|
|
+export default {
|
|
|
mixins: [dictMixins],
|
|
|
props: {
|
|
|
sendId: String,
|
|
|
+ pricingWay: [Number, String],
|
|
|
+ entrustedCode: [Number, String],
|
|
|
type: {
|
|
|
default: ''
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
+ OutboundDetailsDialog, innertboundDetailsDialog,
|
|
|
productList
|
|
|
},
|
|
|
data() {
|
|
|
@@ -141,6 +199,8 @@
|
|
|
payAmount: '',
|
|
|
discountTotalPrice: 0.0,
|
|
|
allPrice: 0.0,
|
|
|
+ outboundDetailsDialogFlag: false,
|
|
|
+ innerboundDetailsDialogFlag: false,
|
|
|
numberReg,
|
|
|
defaultForm,
|
|
|
form: {
|
|
|
@@ -192,6 +252,12 @@
|
|
|
label: '规格',
|
|
|
slot: 'specification'
|
|
|
},
|
|
|
+ {
|
|
|
+ width: 200,
|
|
|
+ prop: 'customerMark',
|
|
|
+ label: '客户代号',
|
|
|
+ slot: 'customerMark'
|
|
|
+ },
|
|
|
{
|
|
|
width: 200,
|
|
|
prop: 'warehouseName',
|
|
|
@@ -204,13 +270,6 @@
|
|
|
// label: '库存',
|
|
|
// slot: 'warehouseNum'
|
|
|
// },
|
|
|
- {
|
|
|
- width: 120,
|
|
|
- prop: 'sendTotalCount',
|
|
|
- label: '发货数量',
|
|
|
- slot: 'sendTotalCount'
|
|
|
- },
|
|
|
-
|
|
|
{
|
|
|
width: 120,
|
|
|
prop: 'totalCount',
|
|
|
@@ -218,12 +277,49 @@
|
|
|
slot: 'totalCount',
|
|
|
headerSlot: 'headerTotalCount'
|
|
|
},
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'sendTotalCount',
|
|
|
+ label: '发货数量',
|
|
|
+ slot: 'sendTotalCount'
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
{
|
|
|
width: 80,
|
|
|
prop: 'measuringUnit',
|
|
|
label: '计量单位',
|
|
|
slot: 'measuringUnit'
|
|
|
},
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'singleWeight',
|
|
|
+ label: '单重',
|
|
|
+ slot: 'singleWeight',
|
|
|
+ align: "center"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 200,
|
|
|
+ prop: 'receiveTotalWeight',
|
|
|
+ label: '收货总重',
|
|
|
+ slot: 'receiveTotalWeight',
|
|
|
+ align: "center",
|
|
|
+ headerSlot: 'headerSendTotalWeight'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 200,
|
|
|
+ prop: 'sendTotalWeight',
|
|
|
+ label: '发货总重',
|
|
|
+ slot: 'sendTotalWeight',
|
|
|
+ align: "center"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 100,
|
|
|
+ prop: 'increaseTotalWeight',
|
|
|
+ label: '增重重量',
|
|
|
+ slot: 'increaseTotalWeight',
|
|
|
+ align: "center"
|
|
|
+ },
|
|
|
{
|
|
|
width: 160,
|
|
|
prop: 'singlePrice',
|
|
|
@@ -306,40 +402,141 @@
|
|
|
resizable: false,
|
|
|
slot: 'action',
|
|
|
fixed: 'right',
|
|
|
- showOverflowTooltip: true
|
|
|
+ showOverflowTooltip: true,
|
|
|
+
|
|
|
}
|
|
|
]
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
totalAmount() {
|
|
|
- let allcountAmount = this.$store.state.returnGoods.allcountAmount;
|
|
|
- return allcountAmount;
|
|
|
+ return this.$store.state.returnGoods.allcountAmount;
|
|
|
}
|
|
|
},
|
|
|
watch:{
|
|
|
payAmount(n){
|
|
|
- console.log('1111111111')
|
|
|
this.$emit('payAmountChange',n)
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- //修改数量更新合计
|
|
|
+ //修改数量更新合计/总重
|
|
|
changeNum(val, index) {
|
|
|
- this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
- 'totalPrice',
|
|
|
- (Number(this.form.datasource[index].singlePrice) * val).toFixed(2)
|
|
|
- );
|
|
|
- this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
- 'discountTotalPrice',
|
|
|
- (Number(this.form.datasource[index].discountSinglePrice) * val).toFixed(2)
|
|
|
- );
|
|
|
+ this.curIndex = index
|
|
|
+ if (this.pricingWay == 2) {
|
|
|
+ if (val != this.form.datasource[index].sendTotalCount) {
|
|
|
+ this.$set(this.form.datasource[index], 'receiveTotalWeight', '')
|
|
|
+ this.$set(this.form.datasource[index], 'sendTotalWeight', '')
|
|
|
+ this.$set(this.form.datasource[index], 'increaseTotalWeight', '')
|
|
|
+ this.getWeightPrice()
|
|
|
+ } else {
|
|
|
+ let find = this.oldSendTotalWeightList.find(key => key.productCode == this.form.datasource[index].productCode) || {}
|
|
|
+ this.$set(this.form.datasource[index], 'receiveTotalWeight', find.oldSendTotalWeight)
|
|
|
+ this.$set(this.form.datasource[index], 'sendTotalWeight', find.oldReceiveTotalWeight)
|
|
|
+ this.setIcreaseTotalWeight()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (val != this.form.datasource[index].sendTotalCount) {
|
|
|
+ this.$set(this.form.datasource[index], 'receiveTotalWeight', '')
|
|
|
+ this.$set(this.form.datasource[index], 'sendTotalWeight', '')
|
|
|
+ this.$set(this.form.datasource[index], 'increaseTotalWeight', '')
|
|
|
+ } else {
|
|
|
+ let find = this.oldSendTotalWeightList.find(key => key.productCode == this.form.datasource[index].productCode) || {}
|
|
|
+ this.$set(this.form.datasource[index], 'receiveTotalWeight', find.oldSendTotalWeight)
|
|
|
+ this.$set(this.form.datasource[index], 'sendTotalWeight', find.oldReceiveTotalWeight)
|
|
|
+ this.setIcreaseTotalWeight()
|
|
|
+ }
|
|
|
|
|
|
- this.$store.commit('returnGoods/setIsDefaultPayableAmount', false);
|
|
|
+ this.$set(this.form.datasource[index], 'totalPrice', (Number(this.form.datasource[index].singlePrice) * val).toFixed(2));
|
|
|
+ this.$set(this.form.datasource[index], 'discountTotalPrice', (Number(this.form.datasource[index].discountSinglePrice) * val).toFixed(2));
|
|
|
+
|
|
|
+ this.$store.commit('returnGoods/setIsDefaultPayableAmount', false);
|
|
|
+ this.gettotalAmount();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getWeightPrice() {
|
|
|
+ let increaseTotalWeight = this.form.datasource[this.curIndex].increaseTotalWeight
|
|
|
+ let singlePrice = this.form.datasource[this.curIndex].singlePrice
|
|
|
+ let discountSinglePrice = this.form.datasource[this.curIndex].discountSinglePrice
|
|
|
+ this.$set(this.form.datasource[this.curIndex], 'totalPrice', (Number(increaseTotalWeight) * Number(singlePrice)).toFixed(2));
|
|
|
+ this.$set(this.form.datasource[this.curIndex], 'discountTotalPrice', (Number(discountSinglePrice) * Number(increaseTotalWeight)).toFixed(2));
|
|
|
this.gettotalAmount();
|
|
|
},
|
|
|
+
|
|
|
+ //出库单详情
|
|
|
+ handleOutBound(e, rows, index) {
|
|
|
+ this.curIndex = index
|
|
|
+ this.outboundDetailsDialogFlag = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let row = {
|
|
|
+ sendNo: this.entrustedCode,
|
|
|
+ productCode: rows.productCode
|
|
|
+ }
|
|
|
+ this.$refs.outboundDetailsDialogRef.init(row)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //选择退货信息回调
|
|
|
+ saveDate(data = []) {
|
|
|
+ let totalWeight = data.reduce((num, row) => {
|
|
|
+ num += Number(row.weight)
|
|
|
+ return num
|
|
|
+ }, 0)
|
|
|
+ this.$set(this.form.datasource[this.curIndex], 'receiveTotalWeight', totalWeight);
|
|
|
+ this.setIcreaseTotalWeight()
|
|
|
+ },
|
|
|
+
|
|
|
+ //入库单详情
|
|
|
+ handleInnerBound(e, rows, index) {
|
|
|
+ this.curIndex = index
|
|
|
+ this.innerboundDetailsDialogFlag = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let row = {
|
|
|
+ sendNo: this.entrustedCode,
|
|
|
+ productCode: rows.productCode
|
|
|
+ }
|
|
|
+ this.$refs.innerboundDetailsDialogRef.init(row)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //选择入库单信息
|
|
|
+ saveInnerDate(data = []) {
|
|
|
+ let totalWeight = data.reduce((num, row) => {
|
|
|
+ num += Number(row.weight)
|
|
|
+ return num
|
|
|
+ }, 0)
|
|
|
+ this.$set(this.form.datasource[this.curIndex], 'sendTotalWeight', totalWeight);
|
|
|
+ this.setIcreaseTotalWeight()
|
|
|
+ },
|
|
|
+ //修改发货总重
|
|
|
+ changeSendTotalWeight(index) {
|
|
|
+ this.curIndex = index
|
|
|
+ this.setIcreaseTotalWeight()
|
|
|
+ },
|
|
|
+ //修改收货总重
|
|
|
+ changeReceiveTotalWeight(index) {
|
|
|
+ this.curIndex = index
|
|
|
+ this.setIcreaseTotalWeight()
|
|
|
+ },
|
|
|
+ //设置增重总重
|
|
|
+ setIcreaseTotalWeight() {
|
|
|
+ let sendTotalWeight = Number(this.form.datasource[this.curIndex].sendTotalWeight)
|
|
|
+ let receiveTotalWeight = Number(this.form.datasource[this.curIndex].receiveTotalWeight)
|
|
|
+ if (this.entrustedCode) {
|
|
|
+ if (this.pricingWay == 2) {
|
|
|
+ if (isNaN(receiveTotalWeight) || isNaN(sendTotalWeight)) {
|
|
|
+ return this.$set(this.form.datasource[this.curIndex], 'increaseTotalWeight', '');
|
|
|
+ } else {
|
|
|
+ this.$set(this.form.datasource[this.curIndex], 'increaseTotalWeight', (sendTotalWeight - receiveTotalWeight).toFixed(2));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$set(this.form.datasource[this.curIndex], 'increaseTotalWeight', (sendTotalWeight - receiveTotalWeight).toFixed(2));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$set(this.form.datasource[this.curIndex], 'increaseTotalWeight', sendTotalWeight);
|
|
|
+ }
|
|
|
+ if (this.pricingWay == 2) {
|
|
|
+ this.getWeightPrice()
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
//获取订单总金额
|
|
|
gettotalAmount() {
|
|
|
let productData = this.form.datasource;
|
|
|
@@ -425,7 +622,13 @@
|
|
|
v.sendTotalCount = v.sendTotalCount || v.totalCount;
|
|
|
v.sendProductId = v.sendProductId || v.id;
|
|
|
});
|
|
|
-
|
|
|
+ this.oldSendTotalWeightList = data.map(item => {
|
|
|
+ return {
|
|
|
+ productCode: item.productCode,
|
|
|
+ oldSendTotalWeight: item.sendTotalWeight,
|
|
|
+ oldReceiveTotalWeight: item.receiveTotalWeight
|
|
|
+ }
|
|
|
+ })
|
|
|
this.form.datasource = data;
|
|
|
// this.form.datasource.forEach(async (v, index) => {
|
|
|
// // if (v.warehouseId) {
|