|
@@ -98,37 +98,6 @@
|
|
|
></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"
|
|
@@ -1169,6 +1138,7 @@ export default {
|
|
|
//商品新增触发
|
|
|
commoditySelection() {
|
|
|
this.dialogVisible = !this.dialogVisible
|
|
|
+ this.tableData = []
|
|
|
this.commodityData = false
|
|
|
},
|
|
|
//政策价格导入
|
|
@@ -1249,9 +1219,12 @@ export default {
|
|
|
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
|
|
|
- this.contactsData[this.choiceIndexT].price = 0
|
|
|
- this.contactsData[this.choiceIndexT].amount = 0
|
|
|
+ selectGoodsNum({
|
|
|
+ goodsId: this.tableData[0].id,
|
|
|
+ typeno: this.tableData[0].specs
|
|
|
+ }).then(res => {
|
|
|
+ this.contactsData[this.choiceIndexT].storageQuantity = res.data.data
|
|
|
+ })
|
|
|
}
|
|
|
this.dialogVisible = !this.dialogVisible
|
|
|
this.commodityData = false
|
|
@@ -1291,32 +1264,31 @@ export default {
|
|
|
// this.contactsData = this.contactsData.concat(this.tableData)
|
|
|
if (this.tableData.length > 0) {
|
|
|
for (let item in this.tableData) {
|
|
|
- let data = {
|
|
|
+ // this.$set(this.tableData[item], 'storageQuantity', 0)
|
|
|
+ selectGoodsNum({
|
|
|
goodsId: this.tableData[item].id,
|
|
|
typeno: this.tableData[item].specs
|
|
|
- }
|
|
|
- selectGoodsNum(data).then(res => {
|
|
|
- console.log(res.data)
|
|
|
+ }).then(res => {
|
|
|
+ console.log(this.tableData)
|
|
|
+ this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
|
|
|
+ this.tableData[item].storageQuantity = res.data.data
|
|
|
+ delete this.tableData[item].goodsTypeName
|
|
|
+ this.tableData[item].itemId = this.tableData[item].id
|
|
|
+ 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.tableData[item].price = 0
|
|
|
+ this.tableData[item].amount = 0
|
|
|
+ this.tableData[item].sort = this.maxGoodsNum + 1
|
|
|
+ this.maxGoodsNum++
|
|
|
+ delete this.tableData[item].id
|
|
|
+ this.$refs.crudContact.rowCellAdd(this.tableData[item]);
|
|
|
+ this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
|
|
|
})
|
|
|
- this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
|
|
|
- delete this.tableData[item].goodsTypeName
|
|
|
- this.tableData[item].itemId = this.tableData[item].id
|
|
|
- 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
|
|
|
- this.maxGoodsNum++
|
|
|
- delete this.tableData[item].id
|
|
|
- this.$refs.crudContact.rowCellAdd(this.tableData[item]);
|
|
|
- this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
|
|
|
}
|
|
|
+ this.dialogVisible = false
|
|
|
}
|
|
|
- this.tableData = []
|
|
|
- this.dialogVisible = false
|
|
|
},
|
|
|
closeGoods() {
|
|
|
this.treeDataGoods = [];
|
|
@@ -1399,17 +1371,21 @@ export default {
|
|
|
importPolicy() {
|
|
|
let list = this.policyData.concat(this.policyDataTwo)
|
|
|
for (let item in list) {
|
|
|
- console.log(list[item])
|
|
|
+ selectGoodsNum({
|
|
|
+ goodsId: list[item].id,
|
|
|
+ typeno: list[item].specs
|
|
|
+ }).then(res => {
|
|
|
+ this.$set(list[item], 'storageQuantity', res.data.data)
|
|
|
+ })
|
|
|
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], 'priceCategory', list[item].productCategory)
|
|
|
this.$set(list[item], 'priceType', this.policyForm.cname)
|
|
|
this.$set(list[item], 'cname', list[item].productCategory)
|
|
|
this.$set(list[item], 'sort', this.maxGoodsNum + 1)
|