|
@@ -34,7 +34,7 @@
|
|
|
<el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
|
|
|
<el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]" :disabled="item.disabled?true:false || goodsDisable" size="small" type="date" placeholder="请选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
|
|
|
<selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" :configuration="configuration"/>
|
|
|
- <el-select v-else-if="item.prop === 'storageId'" style="width: 100%" :disabled="item.disabled?true:false || goodsDisable" v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
|
|
|
+ <el-select v-else-if="item.prop === 'storageId'" style="width: 100%" :disabled="item.disabled?true:false || goodsDisable" @change="warehouseChange" v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
|
|
|
<el-option v-for="(item,index) in storageIdDic" :key="index" :label="item.cname" :value="item.id"></el-option>
|
|
|
</el-select>
|
|
|
<el-input type="textarea" v-else-if="(item.prop === 'deliveryRemarks')" :disabled="item.disabled?true:false || goodsDisable" v-model="form[item.prop]" size="small" autocomplete="off" placeholder="请输入"></el-input>
|
|
@@ -81,7 +81,7 @@
|
|
|
>
|
|
|
<el-option
|
|
|
style="width:90%"
|
|
|
- @change="sumOrderNo()"
|
|
|
+ @change="sumOrderNo(row)"
|
|
|
v-for="(item,index) in contractDic"
|
|
|
:key="index"
|
|
|
:label="item.orderNo"
|
|
@@ -96,7 +96,7 @@
|
|
|
v-if="row.$cellEdit"
|
|
|
v-model="row.priceCategoryNames"
|
|
|
size="small"
|
|
|
- placeholder="请点击右侧按钮选择"
|
|
|
+ placeholder=" "
|
|
|
:disabled="true"
|
|
|
style="width: 63%"
|
|
|
></el-input>
|
|
@@ -110,7 +110,8 @@
|
|
|
placeholder="请输入"
|
|
|
size="small"
|
|
|
oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d\d\d\d\d).*$/, "$1.$2")'
|
|
|
- @input="totalChange(row.invoiceWeight)"
|
|
|
+ @input="invoiceWeightChange(row)"
|
|
|
+ @change="totalChange(row.invoiceWeight)"
|
|
|
></el-input>
|
|
|
<span v-else>{{ row.invoiceWeight }}</span>
|
|
|
</template>
|
|
@@ -121,7 +122,7 @@
|
|
|
placeholder="请输入"
|
|
|
size="small"
|
|
|
oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d\d\d\d\d).*$/, "$1.$2")'
|
|
|
- @input="totalChange(row.billWeight)"
|
|
|
+ @change="totalChange(row.billWeight)"
|
|
|
></el-input>
|
|
|
<span v-else>{{ row.billWeight }}</span>
|
|
|
</template>
|
|
@@ -137,7 +138,6 @@
|
|
|
<span v-else>{{ row.price }}</span>
|
|
|
</template>
|
|
|
<template slot="actualQuantity" slot-scope="{ row }">
|
|
|
- <span v-if="row.$cellEdit" class="required_fields">*</span>
|
|
|
<el-input
|
|
|
v-if="row.$cellEdit"
|
|
|
v-model="row.actualQuantity"
|
|
@@ -145,7 +145,6 @@
|
|
|
placeholder="请输入"
|
|
|
size="small"
|
|
|
oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
- @input="quantityChange(row)"
|
|
|
></el-input>
|
|
|
<span v-else>{{ row.actualQuantity }}</span>
|
|
|
</template>
|
|
@@ -266,6 +265,7 @@ import { contrastObj,contrastList } from "@/util/contrastData";
|
|
|
import {getStorage} from "@/api/importTrade/receipt"
|
|
|
import { getOrgOrderNo } from "@/api/importTrade/salesContract"
|
|
|
import marketDetail from "@/components/procurement/market";
|
|
|
+import {selectGoodsNum} from "@/api/basicData/inventoryAccount"
|
|
|
import _ from "lodash";
|
|
|
|
|
|
export default {
|
|
@@ -358,9 +358,9 @@ export default {
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
- }, {
|
|
|
- label: '发票重量',
|
|
|
- prop: 'invoiceWeight',
|
|
|
+ }, {
|
|
|
+ label: '码单重量',
|
|
|
+ prop: 'billWeight',
|
|
|
disabled: true,
|
|
|
rules: [
|
|
|
{
|
|
@@ -369,9 +369,9 @@ export default {
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
- },{
|
|
|
- label: '码单重量',
|
|
|
- prop: 'billWeight',
|
|
|
+ }, {
|
|
|
+ label: '发票重量',
|
|
|
+ prop: 'invoiceWeight',
|
|
|
disabled: true,
|
|
|
rules: [
|
|
|
{
|
|
@@ -480,11 +480,20 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ //选择仓库 带出库存
|
|
|
+ warehouseChange(){
|
|
|
+ this.contactsData.forEach(item =>{
|
|
|
+ this.selectInventory(item);
|
|
|
+ })
|
|
|
+ },
|
|
|
//合同号合计
|
|
|
- sumOrderNo(){
|
|
|
+ sumOrderNo(row){
|
|
|
//拿到所有明细合同号 去重加逗号放到主表合同号
|
|
|
const contractNumberList = this.contactsData.map(item =>{item.contractNumber})
|
|
|
this.$set(this.form,'orderNo', Array.from(new Set(contractNumberList)).join(","))
|
|
|
+ if(row){
|
|
|
+ this.selectInventory(row)
|
|
|
+ }
|
|
|
},
|
|
|
//码单合计
|
|
|
totalChange(){
|
|
@@ -514,6 +523,21 @@ export default {
|
|
|
}).catch(()=>{
|
|
|
row.contractNumber = ''
|
|
|
})
|
|
|
+ this.selectInventory(row)
|
|
|
+ },
|
|
|
+ //查询库存
|
|
|
+ selectInventory(row){
|
|
|
+ if(row.billNo && row.contractNumber && row.priceCategory && this.form.storageId){
|
|
|
+ const params = {
|
|
|
+ billNo:row.billNo,
|
|
|
+ contractNumber:row.contractNumber,
|
|
|
+ priceCategory:row.priceCategory,
|
|
|
+ storageId:this.form.storageId,
|
|
|
+ }
|
|
|
+ selectGoodsNum(params).then(res =>{
|
|
|
+ this.$set(this.contactsData[row.$index],"kuCun",res.data.data)
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
//单价
|
|
|
priceChange(row) {
|
|
@@ -521,16 +545,16 @@ export default {
|
|
|
row.price = "";
|
|
|
row.contractAmount = 0
|
|
|
} else {
|
|
|
- row.contractAmount = _.multiply(row.actualQuantity, row.price).toFixed(2);
|
|
|
+ row.contractAmount = _.multiply(row.invoiceWeight, row.price).toFixed(2);
|
|
|
}
|
|
|
},
|
|
|
//件数
|
|
|
- quantityChange(row) {
|
|
|
- if (!row.actualQuantity) {
|
|
|
- row.actualQuantity = "";
|
|
|
+ invoiceWeightChange(row) {
|
|
|
+ if (!row.invoiceWeight) {
|
|
|
+ row.invoiceWeight = "";
|
|
|
row.contractAmount = 0
|
|
|
} else {
|
|
|
- row.contractAmount = _.multiply(row.actualQuantity, row.price).toFixed(2);
|
|
|
+ row.contractAmount = _.multiply(row.invoiceWeight, row.price).toFixed(2);
|
|
|
}
|
|
|
},
|
|
|
//导入销售明细
|
|
@@ -539,10 +563,12 @@ export default {
|
|
|
item.contractNumber = item.orgOrderNo;
|
|
|
item.contractAmount = item.amount;
|
|
|
item.actualQuantity = item.orderQuantity;
|
|
|
+ this.selectInventory(item);
|
|
|
delete item.id
|
|
|
this.$refs.crudContact.rowCellAdd(item);
|
|
|
})
|
|
|
- this.sumOrderNo();
|
|
|
+ this.totalChange(); //计算码单 发票
|
|
|
+ this.sumOrderNo(); //合并合同号
|
|
|
this.marketDialog = false;
|
|
|
},
|
|
|
//选择货物品种
|
|
@@ -555,6 +581,7 @@ export default {
|
|
|
if(this.tableData){
|
|
|
this.contactsData[this.selectKind].priceCategory = this.tableData[0].id;
|
|
|
this.$set(this.contactsData[this.selectKind],'priceCategoryNames',this.tableData[0].cname)
|
|
|
+ this.selectInventory(this.contactsData[this.selectKind]);
|
|
|
this.dialogVisible = !this.dialogVisible
|
|
|
this.selectKind = -1
|
|
|
}
|
|
@@ -568,7 +595,7 @@ export default {
|
|
|
},
|
|
|
//点击行可编辑
|
|
|
handleRowClick(row, event, column) {
|
|
|
- console.log(row.$index)
|
|
|
+
|
|
|
},
|
|
|
//商品编辑
|
|
|
rowCell(row, index) {
|
|
@@ -828,7 +855,7 @@ export default {
|
|
|
if (inSave) {
|
|
|
this.$message.success("保存成功");
|
|
|
//关闭窗口
|
|
|
- this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
+ this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
|
|
|
}
|
|
|
},
|
|
|
},
|