|
@@ -9,7 +9,7 @@
|
|
</div>
|
|
</div>
|
|
<div class="bill-main" v-show="isShow==='home'" key="item2">
|
|
<div class="bill-main" v-show="isShow==='home'" key="item2">
|
|
<module-view :propConfig="config" ref="moduleView" @pagination="getDataList" @search="getDataList"
|
|
<module-view :propConfig="config" ref="moduleView" @pagination="getDataList" @search="getDataList"
|
|
- @resert="getDataList" @clickHandle="clickHandle" @detail="getDetail" @onRefresh="onRefresh" />
|
|
|
|
|
|
+ @resert="onRefresh" @clickHandle="clickHandle" @detail="getDetail" @onRefresh="onRefresh" />
|
|
</div>
|
|
</div>
|
|
<!-- 新增/编辑 -->
|
|
<!-- 新增/编辑 -->
|
|
<div class="detil" v-show="isShow==='add'" key="item3">
|
|
<div class="detil" v-show="isShow==='add'" key="item3">
|
|
@@ -29,17 +29,17 @@
|
|
<el-button class="button-new-tag" @click="getTagsValue">添加</el-button>
|
|
<el-button class="button-new-tag" @click="getTagsValue">添加</el-button>
|
|
</template>
|
|
</template>
|
|
<template v-slot:status>
|
|
<template v-slot:status>
|
|
- <el-radio v-model="radioStatus" :label="1">启用</el-radio>
|
|
|
|
- <el-radio v-model="radioStatus" :label="2">备用</el-radio>
|
|
|
|
- <el-radio v-model="radioStatus" :label="3">禁用</el-radio>
|
|
|
|
|
|
+ <el-radio v-model="status" :label="0">启用</el-radio>
|
|
|
|
+ <el-radio v-model="status" :label="1">备用</el-radio>
|
|
|
|
+ <el-radio v-model="status" :label="2">禁用</el-radio>
|
|
</template>
|
|
</template>
|
|
<template v-slot:ismakeup>
|
|
<template v-slot:ismakeup>
|
|
- <el-radio v-model="ismakeup" :label="1">是</el-radio>
|
|
|
|
- <el-radio v-model="ismakeup" :label="2">否</el-radio>
|
|
|
|
|
|
+ <el-radio v-model="ismakeup" :label="0">是</el-radio>
|
|
|
|
+ <el-radio v-model="ismakeup" :label="1">否</el-radio>
|
|
</template>
|
|
</template>
|
|
<template v-slot:issued>
|
|
<template v-slot:issued>
|
|
- <el-radio v-model="issued" :label="1">是</el-radio>
|
|
|
|
- <el-radio v-model="issued" :label="2">否</el-radio>
|
|
|
|
|
|
+ <el-radio v-model="issued" :label="0">是</el-radio>
|
|
|
|
+ <el-radio v-model="issued" :label="1">否</el-radio>
|
|
</template>
|
|
</template>
|
|
<template v-slot:materialSpec>
|
|
<template v-slot:materialSpec>
|
|
<el-radio v-model="materialSpec" :label="0" @input="changeSingle">单规格</el-radio>
|
|
<el-radio v-model="materialSpec" :label="0" @input="changeSingle">单规格</el-radio>
|
|
@@ -127,11 +127,11 @@
|
|
data : any = []
|
|
data : any = []
|
|
expandedKeys : any = []
|
|
expandedKeys : any = []
|
|
materialSpec : any = 0
|
|
materialSpec : any = 0
|
|
- radioStatus : any = 1
|
|
|
|
- ismakeup : any = 1
|
|
|
|
- issued : any = 1
|
|
|
|
|
|
+ status : any = 0
|
|
|
|
+ ismakeup : any = 0
|
|
|
|
+ issued : any = 0
|
|
textarea : any = ''
|
|
textarea : any = ''
|
|
- categoryId : any = ''
|
|
|
|
|
|
+ categoryIds : any = ''
|
|
selectList = []
|
|
selectList = []
|
|
selectValue = ''
|
|
selectValue = ''
|
|
// tab
|
|
// tab
|
|
@@ -799,7 +799,6 @@
|
|
table: {
|
|
table: {
|
|
attr: {
|
|
attr: {
|
|
size: 'mini',
|
|
size: 'mini',
|
|
- // seq: true,
|
|
|
|
align: 'left',
|
|
align: 'left',
|
|
checkbox: true,
|
|
checkbox: true,
|
|
height: 560,
|
|
height: 560,
|
|
@@ -810,25 +809,27 @@
|
|
field: 'name',
|
|
field: 'name',
|
|
isDetail: true,
|
|
isDetail: true,
|
|
}, {
|
|
}, {
|
|
|
|
+ width: 200,
|
|
title: '简称',
|
|
title: '简称',
|
|
field: 'shortName'
|
|
field: 'shortName'
|
|
}, {
|
|
}, {
|
|
|
|
+ width: 200,
|
|
title: '货号',
|
|
title: '货号',
|
|
field: 'itemNumber'
|
|
field: 'itemNumber'
|
|
}, {
|
|
}, {
|
|
- // width: 120,
|
|
|
|
|
|
+ width: 200,
|
|
title: '财务编号',
|
|
title: '财务编号',
|
|
field: 'accountingCode'
|
|
field: 'accountingCode'
|
|
}, {
|
|
}, {
|
|
- // width: 120,
|
|
|
|
|
|
+ width: 200,
|
|
title: '国际码',
|
|
title: '国际码',
|
|
field: 'nsCode'
|
|
field: 'nsCode'
|
|
}, {
|
|
}, {
|
|
- width: 80,
|
|
|
|
|
|
+ width: 90,
|
|
title: '基本售价',
|
|
title: '基本售价',
|
|
field: 'basePrice'
|
|
field: 'basePrice'
|
|
}, {
|
|
}, {
|
|
- width: 80,
|
|
|
|
|
|
+ width: 90,
|
|
title: '市场价格', // (市场价格统一售价)
|
|
title: '市场价格', // (市场价格统一售价)
|
|
field: 'markPrice'
|
|
field: 'markPrice'
|
|
},
|
|
},
|
|
@@ -862,8 +863,8 @@
|
|
}
|
|
}
|
|
//点击树获取数据
|
|
//点击树获取数据
|
|
onChangeTree(e : any) {
|
|
onChangeTree(e : any) {
|
|
- this.categoryId = e.id;
|
|
|
|
- api.byCategoryPage({ categoryId: e.id },'maindataMaterialCategory').then((res : any) => {
|
|
|
|
|
|
+ this.categoryIds = e.id;
|
|
|
|
+ api.byCategoryPage({ categoryId: e.id }, 'maindataMaterialCategory').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
(this.$refs.moduleView as any).setTableValue(res.data.records);
|
|
(this.$refs.moduleView as any).setTableValue(res.data.records);
|
|
let page = {
|
|
let page = {
|
|
@@ -883,7 +884,7 @@
|
|
query.materialSpec = this.materialSpec; // 商品规格
|
|
query.materialSpec = this.materialSpec; // 商品规格
|
|
query.attributeList = JSON.stringify(this.attributeList) // 物料属性
|
|
query.attributeList = JSON.stringify(this.attributeList) // 物料属性
|
|
query.attributeId = this.attributeId // 物料属性ID
|
|
query.attributeId = this.attributeId // 物料属性ID
|
|
- query.status = this.radioStatus; // 物料状态
|
|
|
|
|
|
+ query.status = this.status; // 物料状态
|
|
query.tags = this.tagsData.join(","); // 标签
|
|
query.tags = this.tagsData.join(","); // 标签
|
|
// query.ismakeup = this.ismakeup; // 商品组合
|
|
// query.ismakeup = this.ismakeup; // 商品组合
|
|
query.issued = this.issued; // 是否公布
|
|
query.issued = this.issued; // 是否公布
|
|
@@ -999,8 +1000,9 @@
|
|
// 编辑
|
|
// 编辑
|
|
getDetail(e : any) {
|
|
getDetail(e : any) {
|
|
console.log('编辑 ==> ', e);
|
|
console.log('编辑 ==> ', e);
|
|
- (this as any).$refs.byTool.setTool({ return: true, save: true, delete: true })
|
|
|
|
|
|
+ (this as any).$refs.byTool.setTool({ return: true, save: true, delete: true });
|
|
this.loading = this.$loading({ target: '.my-container' });
|
|
this.loading = this.$loading({ target: '.my-container' });
|
|
|
|
+ // api.single({id:e.id},'maindataMaterial').then((res:any) => {})
|
|
api.single({ id: e.vmCategoryId }, 'maindataMaterialVmcategory').then((res : any) => {
|
|
api.single({ id: e.vmCategoryId }, 'maindataMaterialVmcategory').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
if (res.data) e.vmCategoryName = res.data.name;
|
|
if (res.data) e.vmCategoryName = res.data.name;
|
|
@@ -1033,6 +1035,9 @@
|
|
if (e.attributeList) this.attributeList = JSON.parse(e.attributeList);
|
|
if (e.attributeList) this.attributeList = JSON.parse(e.attributeList);
|
|
other.selectByMaterialId({ id: e.id }, 'maindataMaterialSku').then((res : any) => {
|
|
other.selectByMaterialId({ id: e.id }, 'maindataMaterialSku').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
|
+ this.status = e.status
|
|
|
|
+ this.ismakeup = e.ismakeup
|
|
|
|
+ this.issued = e.issued
|
|
if (this.isSingle) {
|
|
if (this.isSingle) {
|
|
this.selectValue = '' // 物料属性名称
|
|
this.selectValue = '' // 物料属性名称
|
|
this.towTable = '' // 表格数据
|
|
this.towTable = '' // 表格数据
|
|
@@ -1175,7 +1180,7 @@
|
|
}, 0)
|
|
}, 0)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- }).catch(() => {});
|
|
|
|
|
|
+ }).catch(() => { });
|
|
}
|
|
}
|
|
// 切换商品规格
|
|
// 切换商品规格
|
|
changeSingle() {
|
|
changeSingle() {
|
|
@@ -1321,7 +1326,7 @@
|
|
type: 'warning',
|
|
type: 'warning',
|
|
center: true
|
|
center: true
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- this.attributeList.splice(index, 1)
|
|
|
|
|
|
+ this.attributeList.splice(index, 1);
|
|
this.generateNow();
|
|
this.generateNow();
|
|
this.$message.success('删除成功!');
|
|
this.$message.success('删除成功!');
|
|
}).catch(() => this.$message.info('已取消删除'));
|
|
}).catch(() => this.$message.info('已取消删除'));
|
|
@@ -1336,9 +1341,7 @@
|
|
}).then(() => {
|
|
}).then(() => {
|
|
console.log(this.tableList);
|
|
console.log(this.tableList);
|
|
(this as any).tableList.map((v : any) => {
|
|
(this as any).tableList.map((v : any) => {
|
|
- if (v.dataIndex === item.dataIndex) {
|
|
|
|
- v.isDeleted = 1
|
|
|
|
- }
|
|
|
|
|
|
+ if (v.dataIndex === item.dataIndex) v.isDeleted = 1;
|
|
})
|
|
})
|
|
let filterList = this.tableList.filter((v : any) => v.isDeleted !== 1);
|
|
let filterList = this.tableList.filter((v : any) => v.isDeleted !== 1);
|
|
(this as any).$refs.table.setValue(filterList); // 设置表格数据
|
|
(this as any).$refs.table.setValue(filterList); // 设置表格数据
|
|
@@ -1364,15 +1367,13 @@
|
|
}
|
|
}
|
|
clearInterval(this.timer)
|
|
clearInterval(this.timer)
|
|
let query = (this.$refs.moduleView as any).getQuery();
|
|
let query = (this.$refs.moduleView as any).getQuery();
|
|
- query.categoryId = this.categoryId;
|
|
|
|
- let newData : any = {}
|
|
|
|
- for (let key in query) {
|
|
|
|
- if (query[key].toString()) {
|
|
|
|
- newData[key] = query[key]
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- // console.log('表单字段 ==> ', newData);
|
|
|
|
- api.pageList(newData, 'maindataMaterial').then((res : any) => {
|
|
|
|
|
|
+ if (this.categoryIds) query.categoryIds = this.categoryIds;
|
|
|
|
+ console.log('表单字段 ==> ', query);
|
|
|
|
+ this.getPageList(query)
|
|
|
|
+ }
|
|
|
|
+ getPageList(query : any) {
|
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
|
|
+ api.pageList(query, 'maindataMaterial').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
(this.$refs.moduleView as any).setTableValue(res.data.records);
|
|
(this.$refs.moduleView as any).setTableValue(res.data.records);
|
|
let page = {
|
|
let page = {
|
|
@@ -1380,7 +1381,8 @@
|
|
pageSize: res.data.size, //每页条数
|
|
pageSize: res.data.size, //每页条数
|
|
total: res.data.total //总条数
|
|
total: res.data.total //总条数
|
|
};
|
|
};
|
|
- (this.$refs.moduleView as any).setPage(page)
|
|
|
|
|
|
+ (this.$refs.moduleView as any).setPage(page);
|
|
|
|
+ loading.close();
|
|
} else this.$message.error(res.msg);
|
|
} else this.$message.error(res.msg);
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -1388,7 +1390,6 @@
|
|
clickHandle(e : any) {
|
|
clickHandle(e : any) {
|
|
if (e === 'onAdd') this.onAdd();
|
|
if (e === 'onAdd') this.onAdd();
|
|
if (e === 'onDelete') this.doDelete();
|
|
if (e === 'onDelete') this.doDelete();
|
|
- if (e === 'onExport') this.onExport();
|
|
|
|
}
|
|
}
|
|
// 内页工具栏方法
|
|
// 内页工具栏方法
|
|
insideTools(e : any) {
|
|
insideTools(e : any) {
|
|
@@ -1459,28 +1460,10 @@
|
|
}
|
|
}
|
|
// 刷新
|
|
// 刷新
|
|
onRefresh() {
|
|
onRefresh() {
|
|
- this.loading = this.$loading({ target: '.main-container' });
|
|
|
|
(this as any).$refs.moduleView.clearSearch();
|
|
(this as any).$refs.moduleView.clearSearch();
|
|
- api.pageList({}, 'maindataMaterialSku').then((res : any) => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- (this.$refs.moduleView as any).setTableValue(res.data.records);
|
|
|
|
- let page = {
|
|
|
|
- pageNo: res.data.current, //当前页
|
|
|
|
- pageSize: res.data.size, //每页条数
|
|
|
|
- total: res.data.total //总条数
|
|
|
|
- };
|
|
|
|
- (this.$refs.moduleView as any).setPage(page);
|
|
|
|
- this.loading.close();
|
|
|
|
- } else this.$message.error(res.msg);
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- //导出
|
|
|
|
- onExport() {
|
|
|
|
- let urlArr = '/maindata/maindataMaterial';
|
|
|
|
- let query = (this.$refs.moduleView as any).getQuery();
|
|
|
|
- (this as any).$download(urlArr + '/export', {
|
|
|
|
- ...query
|
|
|
|
- }, urlArr[urlArr.length - 1] + `_${new Date().getTime()}.xlsx`)
|
|
|
|
|
|
+ (this as any).$refs.sideTree.request();
|
|
|
|
+ this.categoryIds = '';
|
|
|
|
+ this.getDataList();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|