|
@@ -86,11 +86,11 @@
|
|
|
<avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts"
|
|
|
:data="form.orderItemsList" :key="key" @row-save="rowSave" @row-update="rowUpdate"
|
|
|
@row-close="rowClose" :before-close="beforeClose" @selection-change="selectionContacts"
|
|
|
- @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)"
|
|
|
- @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)">
|
|
|
+ @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.6)"
|
|
|
+ @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.6)">
|
|
|
<template slot-scope="{scope,row}" slot="menuLeft">
|
|
|
<el-button type="primary" icon="el-icon-plus" size="small" :disabled="isAddBtn"
|
|
|
- @click="rowAdd(row,1)">添加商品</el-button>
|
|
|
+ @click="rowAdd(row, 1)">添加商品</el-button>
|
|
|
<el-button type="success" size="small" :disabled="isAddBtn" icon="el-icon-bottom"
|
|
|
@click="excelDialogfun('名称')">按名称导入
|
|
|
</el-button>
|
|
@@ -108,16 +108,29 @@
|
|
|
:disabled="selectionMultilist.length != 1">查看库存</el-button>
|
|
|
</el-popover>
|
|
|
<el-button type="primary" icon="el-icon-plus" size="small" :disabled="isAddBtn"
|
|
|
- @click="rowAdd(row,2)">无库存商品</el-button>
|
|
|
- <el-button type="primary" plain size="small">同步库存</el-button>
|
|
|
+ @click="rowAdd(row, 2)">无库存商品</el-button>
|
|
|
+ <el-popover width="600" trigger="click">
|
|
|
+ <avue-crud :data="inventoryData2" :option="inventoryOption2">
|
|
|
+ <template slot-scope="{row}" slot="menu">
|
|
|
+ <el-button type="text" icon="el-icon-refresh" size="small"
|
|
|
+ :disabled="row.storageId != form.storageId"
|
|
|
+ @click.stop="synchronous(row)">更新库存
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ <el-button type="primary" plain size="small" slot="reference"
|
|
|
+ @click="viewInventory2"
|
|
|
+ :disabled="selectionMultilist.length != 1 || isAddBtn">同步库存</el-button>
|
|
|
+ </el-popover>
|
|
|
</template>
|
|
|
<template slot="goodsId" slot-scope="{ row }">
|
|
|
{{ row.goodsName }}
|
|
|
</template>
|
|
|
|
|
|
<template slot="goodsNum" slot-scope="{ row }">
|
|
|
- <el-input v-if="!mingxibaocun && form.businessSource != '外部销售'" size="small"
|
|
|
- v-model="row.goodsNum" style="width: 100%" @blur="goodsNumblurfun(row)"></el-input>
|
|
|
+ <el-input-number v-if="!mingxibaocun && form.businessSource != '外部销售'" size="small"
|
|
|
+ v-model="row.goodsNum" :precision="numberDecimal" :controls="false"
|
|
|
+ @blur="goodsNumblurfun(row)" style="width: 100%"></el-input-number>
|
|
|
<span v-else>{{ row.goodsNum }}</span>
|
|
|
</template>
|
|
|
<template slot="price" slot-scope="{ row }">
|
|
@@ -264,8 +277,8 @@
|
|
|
</el-tabs>
|
|
|
</template>
|
|
|
<template slot="goodsNum" slot-scope="{row}">
|
|
|
- <el-input-number v-model="row.goodsNum" size="small" :controls="false" :precision="0"
|
|
|
- @input="amountChange($event, row)" style="width: 100%" />
|
|
|
+ <el-input-number v-model="row.goodsNum" size="small" :controls="false"
|
|
|
+ :precision="numberDecimal" @input="amountChange($event, row)" style="width: 100%" />
|
|
|
</template>
|
|
|
<template slot="dot" slot-scope="{row}">
|
|
|
<!--使用allow-create属性即可通过在输入框中输入文字来创建新的条目。注意此时filterable必须为真。-->
|
|
@@ -295,7 +308,7 @@
|
|
|
</template>
|
|
|
<template slot="inventory" slot-scope="scope">
|
|
|
<span style="color: #489fef">
|
|
|
- {{ Number(scope.row.inventory)}}
|
|
|
+ {{ Number(scope.row.inventory) }}
|
|
|
</span>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
@@ -327,7 +340,7 @@ import {
|
|
|
confirmRefund,
|
|
|
revokeCheckOrder,
|
|
|
goodsListXs,
|
|
|
- revokeGenerateShipTask,
|
|
|
+ revokeGenerateShipTask,
|
|
|
goodsPageXs,
|
|
|
getGoodAllList,
|
|
|
generateReturns,
|
|
@@ -362,7 +375,9 @@ export default {
|
|
|
|
|
|
data() {
|
|
|
return {
|
|
|
- goodsType:1,
|
|
|
+ inventoryData2: [],
|
|
|
+ numberDecimal: 0,
|
|
|
+ goodsType: 1,
|
|
|
inventoryOption: {
|
|
|
header: false,
|
|
|
menu: false,
|
|
@@ -386,6 +401,32 @@ export default {
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
+ inventoryOption2: {
|
|
|
+ header: false,
|
|
|
+ menu: true,
|
|
|
+ menuWidth: 90,
|
|
|
+ editBtn: false,
|
|
|
+ delBtn: false,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: '商品名称',
|
|
|
+ prop: 'cname',
|
|
|
+ overHidden: true,
|
|
|
+ }, {
|
|
|
+ label: '仓库',
|
|
|
+ prop: 'storageName',
|
|
|
+ overHidden: true,
|
|
|
+ }, {
|
|
|
+ label: '库存数量',
|
|
|
+ prop: 'balanceQuantity',
|
|
|
+ overHidden: true,
|
|
|
+ }, {
|
|
|
+ label: '批次号',
|
|
|
+ prop: 'dot',
|
|
|
+ overHidden: true,
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
inventoryData: [],
|
|
|
excelBox: false,
|
|
|
reportName: '', // 打印传的名字
|
|
@@ -540,7 +581,7 @@ export default {
|
|
|
// if (!this.onLoad.id) {
|
|
|
// // this.$set(this.optionContactsBack, "addBtn", true)
|
|
|
// // this['optionContacts'] = this['optionContactsBack'];
|
|
|
- // // this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
|
|
|
+ // // this.delColumnData(this.getColumnName('269.6'), this['optionContactsBack']);
|
|
|
// }
|
|
|
// if (this.$refs.form.DIC.customerId || !this.onLoad.id) {
|
|
|
// getCustom({ id: data.value }).then(res => {
|
|
@@ -1213,7 +1254,7 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
- this.optionContacts = await this.getColumnData(this.getColumnName(269.1), this.optionContactsBack);
|
|
|
+ this.optionContacts = await this.getColumnData(this.getColumnName(269.6), this.optionContactsBack);
|
|
|
isProcurement({ "param": "whether.model" }).then(res => {
|
|
|
if (res.data.data == 1) {
|
|
|
this.findObject(this.optionContacts.column, "pattern").label = '规格型号1'
|
|
@@ -1298,7 +1339,7 @@ export default {
|
|
|
this.viewDisabled = true;
|
|
|
// this.$set(this.optionContactsBack, "addBtn", false)
|
|
|
// this['optionContacts'] = this['optionContactsBack'];
|
|
|
- // this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
|
|
|
+ // this.delColumnData(this.getColumnName('269.6'), this['optionContactsBack']);
|
|
|
}
|
|
|
if (!this.detailData.id) {
|
|
|
this.editButton = false
|
|
@@ -1345,7 +1386,9 @@ export default {
|
|
|
if (this.detailData.id) {
|
|
|
this.getDetailsfun()
|
|
|
}
|
|
|
-
|
|
|
+ isProcurement({ "param": "number.decimal" }).then(res => {
|
|
|
+ this.numberDecimal = res.data.data ? Number(res.data.data) : 0
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
@@ -1402,7 +1445,7 @@ export default {
|
|
|
// console.log(3);
|
|
|
// // this.$set(this.optionContactsBack, "addBtn", false)
|
|
|
// this['optionContacts'] = this['optionContactsBack'];
|
|
|
- // this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
|
|
|
+ // this.delColumnData(this.getColumnName('269.6'), this['optionContactsBack']);
|
|
|
// }
|
|
|
// if (!this.detailData.id) {
|
|
|
// this.form.businessSource = '内部销售'
|
|
@@ -1425,6 +1468,40 @@ export default {
|
|
|
this.inventoryData = res.data.data.records
|
|
|
])
|
|
|
},
|
|
|
+ viewInventory2() {
|
|
|
+ inventoryList({ cname: this.selectionMultilist[0].goodsName }).then(res => [
|
|
|
+ this.inventoryData2 = res.data.data.records
|
|
|
+ // res.data.data.records.forEach(item => {
|
|
|
+ // if (item.storageId == this.form.storageId && item.dot == this.selectionMultilist[0].dot) {
|
|
|
+ // if (Number(item.balanceQuantity) == Number(this.selectionMultilist[0].inventory)) {
|
|
|
+ // this.$message.success("库存一致,不需要同步");
|
|
|
+ // }
|
|
|
+ // if (Number(item.balanceQuantity) != Number(this.selectionMultilist[0].inventory)) {
|
|
|
+ // this.$confirm('是否更新库存', '提示', {
|
|
|
+ // confirmButtonText: '确定',
|
|
|
+ // cancelButtonText: '取消',
|
|
|
+ // type: 'warning'
|
|
|
+ // }).then(() => {
|
|
|
+ // this.form.orderItemsList.forEach(e => {
|
|
|
+ // if (e.goodsName == this.selectionMultilist[0].goodsName) {
|
|
|
+ // e.inventory = item.balanceQuantity
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // // this.editCustomer()
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ ])
|
|
|
+ },
|
|
|
+ synchronous(row) {
|
|
|
+ this.form.orderItemsList.forEach(e => {
|
|
|
+ if (e.goodsName == this.selectionMultilist[0].goodsName) {
|
|
|
+ e.inventory = row.balanceQuantity
|
|
|
+ e.dot = row.dot
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
uploadAfter(res, done, loading, column) {
|
|
|
if (Array.isArray(res)) {
|
|
|
if (res instanceof Array) {
|
|
@@ -1553,7 +1630,7 @@ export default {
|
|
|
},
|
|
|
// 获取左侧筛选
|
|
|
getAllWorkDicts() {
|
|
|
- getCorpTypes({whetherIntegral: '0'}).then(res => {
|
|
|
+ getCorpTypes({ whetherIntegral: '0' }).then(res => {
|
|
|
this.treeDataGoods = res.data.data;
|
|
|
});
|
|
|
},
|
|
@@ -1567,7 +1644,7 @@ export default {
|
|
|
this.treeDataGoods = [];
|
|
|
this.treeDeptId = "";
|
|
|
this.activeNameTabs = "searchList";
|
|
|
- this.goodsType=1
|
|
|
+ this.goodsType = 1
|
|
|
},
|
|
|
//刷新触发
|
|
|
refreshChange() {
|
|
@@ -1666,12 +1743,12 @@ export default {
|
|
|
// 价格
|
|
|
pricetype: false,
|
|
|
}
|
|
|
- if(item.goodsFilesList&&item.goodsFilesList.length){
|
|
|
- for (let ite of item.goodsFilesList) {
|
|
|
- if (ite.version == '0') {
|
|
|
- obj.url = ite.url
|
|
|
+ if (item.goodsFilesList && item.goodsFilesList.length) {
|
|
|
+ for (let ite of item.goodsFilesList) {
|
|
|
+ if (ite.version == '0') {
|
|
|
+ obj.url = ite.url
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
this.form.orderItemsList.push(obj)
|
|
@@ -1697,53 +1774,53 @@ export default {
|
|
|
},
|
|
|
//导入商品弹窗列表查询
|
|
|
onLoadfun(page, params = { artsVision: this.form.belongToCorpId }) {
|
|
|
- this.goodsListShow=[]
|
|
|
+ this.goodsListShow = []
|
|
|
this.loading = true;
|
|
|
- if(this.goodsType==1){
|
|
|
+ if (this.goodsType == 1) {
|
|
|
goodsPageXs({
|
|
|
- current: page.currentPage,
|
|
|
- size: page.pageSize,
|
|
|
- customId: this.form.customerId,
|
|
|
- stock: this.form.storageId,
|
|
|
- enableOrNot: 1,
|
|
|
- goodsTypeId: this.treeDeptId,
|
|
|
- ...Object.assign(params, this.SelectSearch),
|
|
|
- whetherIntegral: '0'
|
|
|
- }).then(res => {
|
|
|
- const data = res.data.data;
|
|
|
- this.page.total = data.total;
|
|
|
- this.pageList.total = data.total
|
|
|
- this.data = data.records;
|
|
|
- this.goodsListShow = data.records;
|
|
|
-
|
|
|
- for (let item of this.goodsListShow) {
|
|
|
- item.goodsNum = item.goodsNum ? item.goodsNum : 0
|
|
|
- }
|
|
|
- this.loading = false;
|
|
|
- })
|
|
|
+ current: page.currentPage,
|
|
|
+ size: page.pageSize,
|
|
|
+ customId: this.form.customerId,
|
|
|
+ stock: this.form.storageId,
|
|
|
+ enableOrNot: 1,
|
|
|
+ goodsTypeId: this.treeDeptId,
|
|
|
+ ...Object.assign(params, this.SelectSearch),
|
|
|
+ whetherIntegral: '0'
|
|
|
+ }).then(res => {
|
|
|
+ const data = res.data.data;
|
|
|
+ this.page.total = data.total;
|
|
|
+ this.pageList.total = data.total
|
|
|
+ this.data = data.records;
|
|
|
+ this.goodsListShow = data.records;
|
|
|
+
|
|
|
+ for (let item of this.goodsListShow) {
|
|
|
+ item.goodsNum = item.goodsNum ? item.goodsNum : 0
|
|
|
+ }
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
}
|
|
|
- if(this.goodsType==2){
|
|
|
- getGoodAllList({
|
|
|
- current: page.currentPage,
|
|
|
- size: page.pageSize,
|
|
|
- customId: this.form.customerId,
|
|
|
- stock: this.form.storageId,
|
|
|
- enableOrNot: 1,
|
|
|
- goodsTypeId: this.treeDeptId,
|
|
|
- ...Object.assign(params, this.SelectSearch),
|
|
|
- whetherIntegral: '0'
|
|
|
+ if (this.goodsType == 2) {
|
|
|
+ getGoodAllList({
|
|
|
+ current: page.currentPage,
|
|
|
+ size: page.pageSize,
|
|
|
+ customId: this.form.customerId,
|
|
|
+ stock: this.form.storageId,
|
|
|
+ enableOrNot: 1,
|
|
|
+ goodsTypeId: this.treeDeptId,
|
|
|
+ ...Object.assign(params, this.SelectSearch),
|
|
|
+ whetherIntegral: '0'
|
|
|
}).then(res => {
|
|
|
- res.data.data.records.forEach(item=>{
|
|
|
- item.goodsNum = item.goodsNum ? item.goodsNum : 0
|
|
|
- item.inventory= item.inventory ? item.inventory : 0
|
|
|
+ res.data.data.records.forEach(item => {
|
|
|
+ item.goodsNum = item.goodsNum ? item.goodsNum : 0
|
|
|
+ item.inventory = item.inventory ? item.inventory : 0
|
|
|
+ })
|
|
|
+ const data = res.data.data;
|
|
|
+ this.page.total = data.total;
|
|
|
+ this.pageList.total = data.total
|
|
|
+ this.data = data.records;
|
|
|
+ this.goodsListShow = data.records;
|
|
|
+ this.loading = false;
|
|
|
})
|
|
|
- const data = res.data.data;
|
|
|
- this.page.total = data.total;
|
|
|
- this.pageList.total = data.total
|
|
|
- this.data = data.records;
|
|
|
- this.goodsListShow = data.records;
|
|
|
- this.loading = false;
|
|
|
- })
|
|
|
}
|
|
|
},
|
|
|
// 采购明细行编辑
|
|
@@ -2026,7 +2103,7 @@ export default {
|
|
|
// }
|
|
|
// })
|
|
|
// this['optionContacts'] = this['optionContactsBack'];
|
|
|
- // this.delColumnData(this.getColumnName(269.1), this['optionContactsBack']);
|
|
|
+ // this.delColumnData(this.getColumnName(269.6), this['optionContactsBack']);
|
|
|
|
|
|
|
|
|
// this.form.outboundRecordsList.forEach(item=>{
|
|
@@ -2345,7 +2422,7 @@ export default {
|
|
|
if (this.form.orderItemsList[i].goodsNum <= 0) {
|
|
|
return this.$message.warning(`销售明细序号${Number(i) + 1}的数量不能为零`);
|
|
|
picihao = true
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
this.mingxibaocun = true
|
|
@@ -2569,7 +2646,7 @@ export default {
|
|
|
// }
|
|
|
// })
|
|
|
// this['optionContacts'] = this['optionContactsBack'];
|
|
|
- // this.delColumnData(this.getColumnName(269.1), this['optionContactsBack']);
|
|
|
+ // this.delColumnData(this.getColumnName(269.6), this['optionContactsBack']);
|
|
|
// this.optionContactsBack.column.forEach(item => {
|
|
|
// if (item.prop == 'dot') {
|
|
|
// this.$set(item, disabled, false)
|
|
@@ -2591,7 +2668,7 @@ export default {
|
|
|
// })
|
|
|
// console.log(324324);
|
|
|
// this['optionContacts'] = this['optionContactsBack'];
|
|
|
- // this.delColumnData(this.getColumnName(269.1), this['optionContactsBack']);
|
|
|
+ // this.delColumnData(this.getColumnName(269.6), this['optionContactsBack']);
|
|
|
// }
|
|
|
// // this.$set(this.form.orderItemsList,'goodsNum',66)
|
|
|
|
|
@@ -2883,13 +2960,13 @@ export default {
|
|
|
done(form)
|
|
|
},
|
|
|
// 新增商品
|
|
|
- rowAdd(row,type) {
|
|
|
+ rowAdd(row, type) {
|
|
|
if (!this.form.customerId) {
|
|
|
this.$message.error('请选择客户')
|
|
|
return
|
|
|
}
|
|
|
this.findObject(this.optionContactsBack.column, 'goodsId').dicUrl = `/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}&customId=${this.dicUrlWithCustomId}&enableOrNot=1&stock=${this.form.storageId}`
|
|
|
- this.goodsType=type
|
|
|
+ this.goodsType = type
|
|
|
this.optionContactsBack.column.forEach(its => {
|
|
|
if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
|
|
|
its.disabled = false
|
|
@@ -2898,7 +2975,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
this.getAllWorkDicts()
|
|
|
-
|
|
|
+
|
|
|
this.goodsListSave = []
|
|
|
setTimeout(res => {
|
|
|
this.refreshChange()
|