|
@@ -128,7 +128,7 @@
|
|
|
</span>
|
|
|
</template> -->
|
|
|
<template slot-scope="{type,size,row,index,disabled}" slot="menu">
|
|
|
- <el-button v-if="mingxibaocun" :size="size" :disabled="disabled || isAdd" :type="type"
|
|
|
+ <el-button v-if="row.mingxibaocun" :size="size" :disabled="disabled || isAdd" :type="type"
|
|
|
:icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="hangeditBtn(row, index)">编辑
|
|
|
</el-button>
|
|
|
<el-button v-else :size="size" :disabled="disabled || isAdd" :type="type"
|
|
@@ -218,7 +218,7 @@
|
|
|
<basic-container>
|
|
|
<avue-crud :option="optionTwo" :table-loading="loading" :data="goodsListShow" ref="crud"
|
|
|
@refresh-change="refreshChange" @selection-change="selectionChange" @search-change="goodsSearch"
|
|
|
- :page.sync="page" @on-load="onLoad"
|
|
|
+ :page.sync="page" @on-load="onLoadfun"
|
|
|
@resetColumn="resetCrud" @saveColumn="saveCrud" >
|
|
|
<template slot="menuLeft">
|
|
|
<el-tabs v-model="activeNameTabs" @tab-click="tabHandle">
|
|
@@ -239,6 +239,12 @@
|
|
|
<span v-else>{{ row.dot }}</span>
|
|
|
</template>
|
|
|
|
|
|
+ <template slot="price" slot-scope="{row}">
|
|
|
+ <el-input-number v-if="form.storageId && row.whether=='1'" v-model="row.price" size="small" :controls="false"
|
|
|
+ style="width: 100%" />
|
|
|
+ <span v-else>{{ row.price }}</span>
|
|
|
+ </template>
|
|
|
+
|
|
|
<template slot-scope="scope" slot="menu">
|
|
|
<el-button type="text" icon="el-icon-edit" size="small"
|
|
|
@click.stop="importStagList(scope.row, scope.index)" v-if="activeNameTabs == 'searchList'"
|
|
@@ -284,7 +290,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
// 编辑还是保存
|
|
|
- mingxibaocun:true,
|
|
|
+ // mingxibaocun:true,
|
|
|
// 批次号请求到的数据
|
|
|
picihaolist:[],
|
|
|
// 添加轮胎弹窗
|
|
@@ -1161,7 +1167,7 @@ export default {
|
|
|
nodeClick(data) {
|
|
|
this.treeDeptId = data.id;
|
|
|
this.page.currentPage = 1;
|
|
|
- this.onLoad(this.page, {goodsTypeId:this.treeDeptId});
|
|
|
+ this.onLoadfun(this.page, {goodsTypeId:this.treeDeptId});
|
|
|
},
|
|
|
closeGoods() {
|
|
|
this.treeDataGoods = [];
|
|
@@ -1172,7 +1178,7 @@ export default {
|
|
|
refreshChange() {
|
|
|
this.treeDeptId = ''
|
|
|
this.page.currentPage = 1;
|
|
|
- this.onaloadfun(this.page);
|
|
|
+ this.onLoadfun(this.page);
|
|
|
},
|
|
|
// 这个方法是解决 this.onLoad is not a function 的问题
|
|
|
onaloadfun(page, params = { artsVision: this.form.belongToCorpId }) {
|
|
@@ -1188,6 +1194,25 @@ export default {
|
|
|
this.pageList.total = data.total
|
|
|
this.data = data.records;
|
|
|
this.goodsListShow = data.records;
|
|
|
+
|
|
|
+ // // 获取单价数据
|
|
|
+ // for(let item of this.goodsListShow) {
|
|
|
+ // let page = {}
|
|
|
+ // if (this.form.storageId) {
|
|
|
+ // page.storageId = this.form.storageId
|
|
|
+ // }
|
|
|
+ // page.goodsId = item.goodsId
|
|
|
+ // if (this.form.storageId) {
|
|
|
+ // dotList(page).then(res=>{
|
|
|
+ // console.log(res.data.data,1206)
|
|
|
+ // item.price = res.data.data[0].inventoryCostPrice
|
|
|
+ // // console.log(item)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
this.loading = false;
|
|
|
})
|
|
|
// getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId, null).then(res => {
|
|
@@ -1210,7 +1235,7 @@ export default {
|
|
|
...params,
|
|
|
artsVision: this.form.belongToCorpId
|
|
|
}
|
|
|
- this.onLoad(this.page, params);
|
|
|
+ this.onLoadfun(this.page, params);
|
|
|
done()
|
|
|
},
|
|
|
// 标签页切换
|
|
@@ -1226,9 +1251,9 @@ export default {
|
|
|
// 商品信息价格计算
|
|
|
amountChange(row) {
|
|
|
// 价格
|
|
|
- if (!row.price) {
|
|
|
- row.price = 0;
|
|
|
- }
|
|
|
+ // if (!row.price) {
|
|
|
+ // row.price = 0;
|
|
|
+ // }
|
|
|
},
|
|
|
importStagList(row, index, type) {
|
|
|
this.goodsListSave.push(row);
|
|
@@ -1265,22 +1290,25 @@ export default {
|
|
|
console.log(res.data,'获取到的数据')
|
|
|
let obj = {}
|
|
|
if(res.data.data.length>0){
|
|
|
- obj.price = res.data.data[0].inventoryCostPrice,
|
|
|
+ // obj.price = res.data.data[0].inventoryCostPrice,
|
|
|
obj.inventory = res.data.data[0].balanceQuantity,
|
|
|
obj.pattern = res.data.data[0].brandItem,
|
|
|
obj.goodsDescription = res.data.data[0].productDescription,
|
|
|
+ // 规格型号
|
|
|
+ obj.propertyName = res.data.data[0].typeno,
|
|
|
// 小计
|
|
|
obj.subTotalMoney = item.goodsNum * res.data.data[0].inventoryCostPrice
|
|
|
}
|
|
|
this.form.orderItemsList.push({
|
|
|
...obj,
|
|
|
- goodsId:item.goodsId,
|
|
|
+ price:item.price,
|
|
|
+ goodsId:item.id,
|
|
|
goodsName:item.cname,
|
|
|
dot:item.dot,
|
|
|
brandName:item.brandName,
|
|
|
brandId:item.brandId,
|
|
|
goodsNo:item.code,
|
|
|
- propertyName:item.typeno,
|
|
|
+ // propertyName:item.typeno,
|
|
|
|
|
|
goodsNum:item.goodsNum,
|
|
|
units:item.unit,
|
|
@@ -1294,7 +1322,9 @@ export default {
|
|
|
// 价格数量
|
|
|
goodsNumtype:false,
|
|
|
// 价格
|
|
|
- pricetype:false
|
|
|
+ pricetype:false,
|
|
|
+ // 是否是编辑状态
|
|
|
+ mingxibaocun:true
|
|
|
})
|
|
|
})
|
|
|
}
|
|
@@ -1306,7 +1336,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
//导入轮胎弹窗列表查询
|
|
|
- onLoad(page, params = { artsVision: this.form.belongToCorpId }) {
|
|
|
+ onLoadfun(page, params = { artsVision: this.form.belongToCorpId }) {
|
|
|
this.loading = true;
|
|
|
getList({
|
|
|
...params,
|
|
@@ -1319,6 +1349,23 @@ export default {
|
|
|
this.pageList.total = data.total
|
|
|
this.data = data.records;
|
|
|
this.goodsListShow = data.records;
|
|
|
+
|
|
|
+ // 获取单价数据
|
|
|
+ for(let item of this.goodsListShow) {
|
|
|
+ let page = {}
|
|
|
+ if (this.form.storageId) {
|
|
|
+ page.storageId = this.form.storageId
|
|
|
+ }
|
|
|
+ page.goodsId = item.id
|
|
|
+ if (this.form.storageId && item.whether=='1') {
|
|
|
+ dotList(page).then(res=>{
|
|
|
+ console.log(res.data.data,1206)
|
|
|
+ item.price = res.data.data[0].inventoryCostPrice
|
|
|
+ // console.log(item)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
this.loading = false;
|
|
|
})
|
|
|
// getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId, null).then(res => {
|
|
@@ -1339,14 +1386,14 @@ export default {
|
|
|
row.goodsNumtype = true
|
|
|
row.pricetype = true
|
|
|
// 编辑和保存状态切换
|
|
|
- this.mingxibaocun = false
|
|
|
+ row.mingxibaocun = false
|
|
|
},
|
|
|
// 保存按钮
|
|
|
hangbaocun(row) {
|
|
|
row.dotedittype = false
|
|
|
row.goodsNumtype = false
|
|
|
row.pricetype = false
|
|
|
- this.mingxibaocun = true
|
|
|
+ row.mingxibaocun = true
|
|
|
},
|
|
|
// 批次号获取数据
|
|
|
picihaolistfun(goodsId){
|