|
@@ -78,7 +78,8 @@
|
|
|
<el-input
|
|
|
v-if="row.$cellEdit"
|
|
|
v-model="row.orderQuantity"
|
|
|
- oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")' size="small"
|
|
|
+ oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
|
|
|
+ size="small"
|
|
|
@input="quantityChange(row)"
|
|
|
></el-input>
|
|
|
<span v-else>{{ row.orderQuantity }}</span>
|
|
@@ -88,10 +89,42 @@
|
|
|
v-if="row.$cellEdit"
|
|
|
v-model="row.price"
|
|
|
size="small"
|
|
|
- oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")' @input="priceChange(row)"
|
|
|
+ oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
|
|
|
+ @input="priceChange(row)"
|
|
|
></el-input>
|
|
|
<span v-else>{{ row.price }}</span>
|
|
|
</template>
|
|
|
+ <template slot="storageQuantity" slot-scope="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.storageQuantity"
|
|
|
+ size="small"
|
|
|
+ oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
|
|
|
+ ></el-input>
|
|
|
+ <span v-else>{{ row.storageQuantity }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="actualQuantity" slot-scope="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.actualQuantity"
|
|
|
+ size="small"
|
|
|
+ oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
|
|
|
+ ></el-input>
|
|
|
+ <span v-else>{{ row.actualQuantity }}</span>
|
|
|
+ </template>
|
|
|
+<!-- <template slot="specificationAndModel" slot-scope="{ row }">-->
|
|
|
+<!-- <el-select-->
|
|
|
+<!-- v-if="row.$cellEdit && row.typeData.length > 0"-->
|
|
|
+<!-- v-model="row.specificationAndModel"-->
|
|
|
+<!-- size="small"-->
|
|
|
+<!-- ></el-select>-->
|
|
|
+<!-- <el-input-->
|
|
|
+<!-- v-else-if="row.$cellEdit && row.typeData.length == 0"-->
|
|
|
+<!-- v-model="row.specificationAndModel"-->
|
|
|
+<!-- size="small"-->
|
|
|
+<!-- ></el-input>-->
|
|
|
+<!-- <span v-else>{{ row.specificationAndModel }}</span>-->
|
|
|
+<!-- </template>-->
|
|
|
<template slot-scope="{row,index}" slot="menu">
|
|
|
<el-button
|
|
|
type="text"
|
|
@@ -451,8 +484,10 @@ import {
|
|
|
corpsitem,
|
|
|
getList,
|
|
|
detailList,
|
|
|
- generateShipment
|
|
|
+ generateShipment,
|
|
|
+
|
|
|
} from "@/api/basicData/configuration"
|
|
|
+import {selectGoodsNum} from "@/api/basicData/inventoryAccount"
|
|
|
import customerContact from "./configuration/customerContact.json"
|
|
|
import advantageProject from "./configuration/advantageProject.json"
|
|
|
import bankOfDeposit from "./configuration/bankOfDeposit.json"
|
|
@@ -488,6 +523,7 @@ export default {
|
|
|
dicData: []
|
|
|
},
|
|
|
data: [],
|
|
|
+ policyForm: {},
|
|
|
dataPolicy: [],
|
|
|
contactsDataBuyFree: [],
|
|
|
loadingCost: false,
|
|
@@ -999,6 +1035,12 @@ export default {
|
|
|
this.statusOption = res.data.data
|
|
|
})
|
|
|
this.$set(this.form, 'orderStatus', '录入')
|
|
|
+ // this.optionPolicy.selectable = function(row, index) {
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
+ // this.customerBuyFree.selectable = function(row, index) {
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
if (this.detailData.id) {
|
|
|
// let id = this.$route.query.id.replace(/\"/g, "")
|
|
|
this.queryData(this.detailData.id)
|
|
@@ -1099,7 +1141,11 @@ export default {
|
|
|
},
|
|
|
//商品编辑
|
|
|
rowCell(row, index) {
|
|
|
- console.log(row)
|
|
|
+ if (row.$cellEdit) {
|
|
|
+ if (Number(row.orderQuantity) < Number(row.actualQuantity)) {
|
|
|
+ return this.$message.error('订货数量不能小于发货数量')
|
|
|
+ }
|
|
|
+ }
|
|
|
this.$refs.crudContact.rowCell(row, index)
|
|
|
},
|
|
|
//费用编辑
|
|
@@ -1192,7 +1238,7 @@ export default {
|
|
|
this.contactsData[this.choiceIndexT].cname = this.tableData[0].cname
|
|
|
this.contactsData[this.choiceIndexT].code = this.tableData[0].code
|
|
|
this.contactsData[this.choiceIndexT].typeno = this.tableData[0].typeno
|
|
|
- this.contactsData[this.choiceIndexT].specificationAndModel = this.tableData[0].specificationAndModel
|
|
|
+ this.contactsData[this.choiceIndexT].specificationAndModel = this.tableData[0].specs
|
|
|
this.contactsData[this.choiceIndexT].itemId = this.tableData[0].id
|
|
|
this.contactsData[this.choiceIndexT].priceCategory = this.tableData[0].goodsTypeName
|
|
|
this.contactsData[this.choiceIndexT].orderQuantity = 0
|
|
@@ -1235,12 +1281,21 @@ export default {
|
|
|
// this.contactsData = this.contactsData.concat(this.tableData)
|
|
|
if (this.tableData.length > 0) {
|
|
|
for (let item in this.tableData) {
|
|
|
- console.log(this.tableData[item])
|
|
|
+ let data = {
|
|
|
+ goodsId: this.tableData[item].id,
|
|
|
+ typeno: this.tableData[item].specs
|
|
|
+ }
|
|
|
+ selectGoodsNum(data).then(res => {
|
|
|
+ console.log(res.data)
|
|
|
+ })
|
|
|
this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
|
|
|
delete this.tableData[item].goodsTypeName
|
|
|
this.tableData[item].itemId = this.tableData[item].id
|
|
|
- // this.tableData[item].orderQuantity = 0
|
|
|
+ this.$set(this.tableData[item], 'specificationAndModel', this.tableData[item].specs)
|
|
|
+ this.$set(this.tableData[item], 'priceType', '一般')
|
|
|
this.$set(this.tableData[item], 'orderQuantity', 0)
|
|
|
+ this.$set(this.tableData[item], 'actualQuantity', 0)
|
|
|
+ this.$set(this.tableData[item], 'storageQuantity', 0)
|
|
|
this.tableData[item].price = 0
|
|
|
this.tableData[item].amount = 0
|
|
|
this.tableData[item].sort = this.maxGoodsNum + 1
|
|
@@ -1264,7 +1319,10 @@ export default {
|
|
|
closePolicy() {
|
|
|
this.treePolicyId = '';
|
|
|
this.dataPolicy = [];
|
|
|
+ this.policyForm = {};
|
|
|
this.contactsDataBuyFree = [];
|
|
|
+ this.policyData = []
|
|
|
+ this.policyDataTwo = []
|
|
|
},
|
|
|
//选中触发
|
|
|
selectionChange(list) {
|
|
@@ -1304,17 +1362,48 @@ export default {
|
|
|
},
|
|
|
//销售政策特价促销选中触发
|
|
|
selectionChangePolicy(list) {
|
|
|
- this.policyData = list
|
|
|
+ console.log(list)
|
|
|
+ this.policyData = this.policyData.concat(list)
|
|
|
+ // this.policyData.forEach(item => {
|
|
|
+ // this.$set(item, 'price', item.specialOffer)
|
|
|
+ // })
|
|
|
+ if (this.policyData.length > 0) {
|
|
|
+ this.customerBuyFree.selection = false
|
|
|
+ } else {
|
|
|
+ this.customerBuyFree.selection = true
|
|
|
+ }
|
|
|
},
|
|
|
//销售政策买赠促销选中触发
|
|
|
selectionChangePolicyTwo(list) {
|
|
|
- this.policyDataTwo = list
|
|
|
+ this.policyDataTwo = this.policyDataTwo.concat(list)
|
|
|
+ // this.policyDataTwo.forEach(item => {
|
|
|
+ // this.$set(item, 'price', item.salesPrice)
|
|
|
+ // })
|
|
|
+ if (this.policyDataTwo.length > 0) {
|
|
|
+ this.optionPolicy.selection = false
|
|
|
+ } else {
|
|
|
+ this.optionPolicy.selection = true
|
|
|
+ }
|
|
|
},
|
|
|
//导入商品政策
|
|
|
importPolicy() {
|
|
|
let list = this.policyData.concat(this.policyDataTwo)
|
|
|
for (let item in list) {
|
|
|
console.log(list[item])
|
|
|
+ if (this.policyData.length > 0) {
|
|
|
+ this.$set(list[item], 'price', list[item].specialOffer)
|
|
|
+ } else {
|
|
|
+ this.$set(list[item], 'price', list[item].salesPrice)
|
|
|
+ }
|
|
|
+ this.$set(list[item], 'actualQuantity', 0)
|
|
|
+ this.$set(list[item], 'storageQuantity', 0)
|
|
|
+ this.$set(list[item], 'orderQuantity', 0)
|
|
|
+ this.$set(list[item], 'amount', 0)
|
|
|
+ this.$set(list[item], 'priceCategory', this.policyForm.cname)
|
|
|
+ this.$set(list[item], 'priceType', this.policyForm.cname)
|
|
|
+ this.$set(list[item], 'cname', list[item].productCategory)
|
|
|
+ this.$set(list[item], 'sort', this.maxGoodsNum + 1)
|
|
|
+ this.maxGoodsNum++
|
|
|
this.$refs.crudContact.rowCellAdd(list[item]);
|
|
|
this.$refs.crudContact.rowCell(list[item], this.contactsData.length - 1)
|
|
|
}
|
|
@@ -1374,6 +1463,7 @@ export default {
|
|
|
policyOnLoad(params = {}) {
|
|
|
// this.policyLoading = true;
|
|
|
detailList(this.treePolicyId).then(res => {
|
|
|
+ this.policyForm = res.data.data
|
|
|
//特价促销
|
|
|
this.dataPolicy = res.data.data.specialItemList
|
|
|
//买赠促销
|
|
@@ -1480,6 +1570,11 @@ export default {
|
|
|
console.log(this.form)
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
+ for (let item in this.contactsData) {
|
|
|
+ if (Number(this.contactsData[item].orderQuantity) < Number(this.contactsData[item].actualQuantity)) {
|
|
|
+ return this.$message.error('商品信息第'+ (parseInt(item) + 1) + '行订货数量不能小于发货数量')
|
|
|
+ }
|
|
|
+ }
|
|
|
//商品信息
|
|
|
this.form.orderItemsList = this.contactsData
|
|
|
this.form.orderFeesList = this.advantageProjectData
|