|
@@ -40,7 +40,7 @@
|
|
|
</template>
|
|
|
<template v-slot:makeupTable>
|
|
|
<div v-if="ismakeup===0">
|
|
|
- <by-table :propConfig="makeupTable" ref="makeupTable"></by-table>
|
|
|
+ <by-table :propConfig="makeupTable" ref="makeupTable" @onChangeRow="getMakeupTableValue"></by-table>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template v-slot:issued>
|
|
@@ -49,7 +49,7 @@
|
|
|
</template>
|
|
|
<template v-slot:materialSpec>
|
|
|
<el-radio v-model="materialSpec" :label="0" @input="changeSingle">单规格</el-radio>
|
|
|
- <el-radio v-model="materialSpec" :label="1" @input="changeSingle">多规格</el-radio>
|
|
|
+ <el-radio v-model="materialSpec" :label="1" @input="changeSingle" :disabled="ismakeup==0">多规格</el-radio>
|
|
|
</template>
|
|
|
<template v-slot:attributeName>
|
|
|
<div v-if="isSingle" key="item4">
|
|
@@ -113,7 +113,7 @@
|
|
|
<!-- 选择物料 -->
|
|
|
<productModal ref="product" :mulit="true" @confirm="confirmProduct" />
|
|
|
|
|
|
- <vxe-modal v-model="vxeValue" width="48%" height="88%" show-zoom resize transfer show-footer>
|
|
|
+ <vxe-modal v-model="vxeValue" width="48%" height="88%" show-zoom resize transfer show-footer mask-closable :loading="tableloading">
|
|
|
<template #title>
|
|
|
<span>关联金蝶财务系统物料</span>
|
|
|
</template>
|
|
@@ -139,7 +139,6 @@
|
|
|
<el-table
|
|
|
ref="multipleTable"
|
|
|
:data="newtableData"
|
|
|
- v-loading="tableloading"
|
|
|
stripe
|
|
|
border
|
|
|
style="width: 100%"
|
|
@@ -197,7 +196,7 @@
|
|
|
import api from '@/api/currency'
|
|
|
import other from '@/api/other'
|
|
|
import ForTab from "@/components/ForTab/index.vue";
|
|
|
- import productModal from "../orderTask/components/productModal.vue";
|
|
|
+ import productModal from "./components/productModal.vue";
|
|
|
import brandType from "./components/brandType.vue";
|
|
|
// import selectKin from "./components/selectKin.vue";
|
|
|
@Component({ components: { ForTab, productModal, brandType } })
|
|
@@ -589,7 +588,6 @@
|
|
|
size: 'mini',
|
|
|
placeholder: ' ',
|
|
|
type: "number",
|
|
|
- defaultValue:'0',
|
|
|
min: 0,
|
|
|
},
|
|
|
}
|
|
@@ -604,7 +602,6 @@
|
|
|
size: 'mini',
|
|
|
placeholder: ' ',
|
|
|
type: "number",
|
|
|
- defaultValue:0,
|
|
|
min: 0,
|
|
|
},
|
|
|
}
|
|
@@ -619,7 +616,6 @@
|
|
|
size: 'mini',
|
|
|
placeholder: ' ',
|
|
|
type: "number",
|
|
|
- defaultValue:0,
|
|
|
min: 0,
|
|
|
},
|
|
|
}
|
|
@@ -634,7 +630,6 @@
|
|
|
size: 'mini',
|
|
|
placeholder: ' ',
|
|
|
type: "number",
|
|
|
- defaultValue:0,
|
|
|
min: 0,
|
|
|
},
|
|
|
}
|
|
@@ -723,6 +718,9 @@
|
|
|
name: [{
|
|
|
required: true, message: '请输入名称', trigger: 'blur'
|
|
|
}],
|
|
|
+ // materialCode: [{
|
|
|
+ // required: true, message: '请输入物料编码', trigger: 'blur'
|
|
|
+ // }],
|
|
|
basePrice: [{
|
|
|
required: true, message: '请输入基本售价', trigger: 'blur'
|
|
|
}],
|
|
@@ -1086,7 +1084,7 @@
|
|
|
},
|
|
|
}
|
|
|
|
|
|
- tableloading = false
|
|
|
+ tableloading: boolean = true
|
|
|
tableRadio: any = {}
|
|
|
tableData: any = []
|
|
|
newtableData: any = []
|
|
@@ -1095,6 +1093,8 @@
|
|
|
tablePageSize: any = 10
|
|
|
tablePageNum: any = 1
|
|
|
|
|
|
+ productDataList: any = []
|
|
|
+
|
|
|
mounted() {
|
|
|
this.getAttribute()
|
|
|
this.timer = setInterval(() => {
|
|
@@ -1111,28 +1111,16 @@
|
|
|
this.tableSearchForm.stime = '2020-01-01';
|
|
|
this.tableSearchForm.etime = y+'-'+m+'-'+d;
|
|
|
this.etime = y+'-'+m+'-'+d;
|
|
|
- this.getFinancialCode()
|
|
|
- this.getTreeList();
|
|
|
- }
|
|
|
- getTreeList(){
|
|
|
- api.treeList('maindataMaterialCategory').then((res : any) => {
|
|
|
- console.log(res);
|
|
|
- var data:any = [{
|
|
|
- id: 0,
|
|
|
- name: '物料分类',
|
|
|
- children: res.data
|
|
|
- }];
|
|
|
- (this as any).$refs.sideTree.setData(data);
|
|
|
- })
|
|
|
+ // this.getFinancialCode()
|
|
|
}
|
|
|
// 确定商品新增
|
|
|
confirmProduct(e : any) {
|
|
|
- console.log(e);
|
|
|
this.$nextTick(() => {
|
|
|
let nowData = (this.$refs.makeupTable as any).getValue();
|
|
|
let names = '';
|
|
|
if (e.length > 0) {
|
|
|
for (const item of e) {
|
|
|
+ this.productDataList.push(item)
|
|
|
let t = true;
|
|
|
for (const t_item of nowData) {
|
|
|
if (item.id == t_item.materialSkuId) {
|
|
@@ -1167,9 +1155,11 @@
|
|
|
//点击树获取数据
|
|
|
onChangeTree(e : any) {
|
|
|
this.categoryIds = e.id;
|
|
|
+ var ids:any = e.id;
|
|
|
+ if(e.id[0]==0) ids = 0;
|
|
|
let loading = this.$loading({ target: '.main-container' });
|
|
|
api.byCategoryPage({
|
|
|
- categoryId: e.id,
|
|
|
+ categoryId: ids,
|
|
|
pageSize: 20,
|
|
|
pageNo: 1,
|
|
|
}, 'maindataMaterialCategory').then((res : any) => {
|
|
@@ -1222,9 +1212,9 @@
|
|
|
// if (parseInt(v.height) <= 0) return this.$message.warning('物料属性高度不能小于1');
|
|
|
if (!v.skuTitle) return this.$message.warning('物料标题必填');
|
|
|
if (!v.skuCode) return this.$message.warning('物料编码必填');
|
|
|
- if(v.weight&&v.weight!=0){
|
|
|
- v.weight = v.weight/1000
|
|
|
- }
|
|
|
+ // if(v.weight&&v.weight!=0){
|
|
|
+ // v.weight = v.weight/1000
|
|
|
+ // }
|
|
|
};
|
|
|
data = { maindataMaterialReceiveParam: query, maindataMaterialSkus: this.tableList }
|
|
|
let newArray : any = []
|
|
@@ -1266,12 +1256,13 @@
|
|
|
// if (parseInt(v.width) <= 0) return this.$message.warning('物料宽不能小于1');
|
|
|
// if (!v.height) return this.$message.warning('物料高必填');
|
|
|
// if (parseInt(v.height) <= 0) return this.$message.warning('物料高不能小于1');
|
|
|
- if (!v.skuTitle) return this.$message.warning('物料标题必填');
|
|
|
- if (!v.skuCode) return this.$message.warning('物料编码必填');
|
|
|
+ if (!v.skuTitle) return this.$message.warning('物料属性的标题需必填');
|
|
|
+ if (!v.skuCode) return this.$message.warning('物料属性的物料编码需必填');
|
|
|
|
|
|
- if(v.weight&&v.weight!=0){
|
|
|
- v.weight = v.weight/1000
|
|
|
- }
|
|
|
+ // if(v.weight&&v.weight!=0){
|
|
|
+ // v.weight = v.weight/1000
|
|
|
+ // }
|
|
|
+ v.ismakeup = 1
|
|
|
};
|
|
|
data.maindataMaterialSkus[0].isDeleted = 0;
|
|
|
data.maindataMaterialReceiveParam.attributeList = ""
|
|
@@ -1295,7 +1286,6 @@
|
|
|
if (res.code === 200) {
|
|
|
this.isShow = 'home';
|
|
|
// (this as any).$refs.sideTree.request();
|
|
|
- this.getTreeList();
|
|
|
this.getDataList();
|
|
|
this.$message.success('保存成功');
|
|
|
}
|
|
@@ -1306,7 +1296,6 @@
|
|
|
if (res.code === 200) {
|
|
|
this.isShow = 'home';
|
|
|
// (this as any).$refs.sideTree.request();
|
|
|
- this.getTreeList();
|
|
|
this.getDataList();
|
|
|
this.$message.success('保存成功');
|
|
|
}
|
|
@@ -1398,10 +1387,13 @@
|
|
|
this.towTable = '' // 表格数据
|
|
|
this.attributeList = []; // 属性规格
|
|
|
this.$nextTick(() => {
|
|
|
- console.log(info.data);
|
|
|
+ // console.log(info.data);
|
|
|
info.data.map((v : any, i : any) => {
|
|
|
- if(v.weight!='0.00'&&v.weight!=0&&v.weight!='0'){
|
|
|
- v.weight = parseFloat(v.weight)*1000
|
|
|
+ // if(v.volume&&v.weight!='0.00'&&v.weight!=0&&v.weight!='0'){
|
|
|
+ // v.weight = parseFloat(v.weight)*1000
|
|
|
+ // }
|
|
|
+ if(v.volume&&v.volume!='0.00'&&v.volume!=0&&v.volume!='0'){
|
|
|
+ v.volume = parseFloat(v.volume).toFixed(2)
|
|
|
}
|
|
|
});
|
|
|
(this as any).$refs.singeTable.setValue(info.data);
|
|
@@ -1414,8 +1406,11 @@
|
|
|
info.data.map((v : any, i : any) => {
|
|
|
v = Object.assign(v, skuRuleList[i])
|
|
|
v.dataIndex = i
|
|
|
- if(v.weight!='0.00'&&v.weight!=0&&v.weight!='0'){
|
|
|
- v.weight = parseFloat(v.weight)*1000
|
|
|
+ // if(v.volume&&v.weight!='0.00'&&v.weight!=0&&v.weight!='0'){
|
|
|
+ // v.weight = parseFloat(v.weight)*1000
|
|
|
+ // }
|
|
|
+ if(v.volume&&v.volume!='0.00'&&v.volume!=0&&v.volume!='0'){
|
|
|
+ v.volume = parseFloat(v.volume).toFixed(2)
|
|
|
}
|
|
|
});
|
|
|
newColumns.map((v : any) => {
|
|
@@ -1659,6 +1654,11 @@
|
|
|
// 打开关联金蝶财务系统物料选择
|
|
|
openVxeData(){
|
|
|
this.vxeValue = true;
|
|
|
+ if(this.tableData.length==0){
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.getFinancialCode();
|
|
|
+ },0)
|
|
|
+ }
|
|
|
}
|
|
|
// 获取关联金蝶财务系统物料列表
|
|
|
getFinancialCode(){
|
|
@@ -1703,17 +1703,17 @@
|
|
|
val = [{
|
|
|
skuTitle: this.tableRadio.fname,
|
|
|
skuSubtitle: this.tableRadio.fname,
|
|
|
- skuCode: '',
|
|
|
+ // skuCode: '',
|
|
|
financialCode: this.tableRadio.fnumber,
|
|
|
- price: '0',
|
|
|
+ // price: '0',
|
|
|
unit: this.tableRadio.fbaseUnitName,
|
|
|
unitCode: this.tableRadio.fbaseUnitCode,
|
|
|
- shelfLife: '0',
|
|
|
- weight: '0',
|
|
|
- length: '0',
|
|
|
- width: '0',
|
|
|
- height: '0',
|
|
|
- volume: '0',
|
|
|
+ // shelfLife: '0',
|
|
|
+ // weight: '0',
|
|
|
+ // length: '0',
|
|
|
+ // width: '0',
|
|
|
+ // height: '0',
|
|
|
+ // volume: '0',
|
|
|
}];
|
|
|
}else{
|
|
|
val[0].skuTitle = this.tableRadio.fname;
|
|
@@ -1722,7 +1722,6 @@
|
|
|
val[0].unit = this.tableRadio.fbaseUnitName;
|
|
|
val[0].unitCode = this.tableRadio.fbaseUnitCode;
|
|
|
}
|
|
|
- console.log(222,val);
|
|
|
(this as any).$refs.singeTable.setValue(val);
|
|
|
(this as any).$refs.form.setValue(val2);
|
|
|
this.vxeValue = false;
|
|
@@ -1808,6 +1807,54 @@
|
|
|
e.volume = (e.length * e.width * e.height).toFixed(2);
|
|
|
}
|
|
|
}
|
|
|
+ // 监听组合商品表格数据
|
|
|
+ getMakeupTableValue(e : any) {
|
|
|
+ // console.log('监听表格 ==> ', e);
|
|
|
+ // console.log(this.productDataList)
|
|
|
+ this.volumeCount()
|
|
|
+ }
|
|
|
+ volumeCount(){
|
|
|
+ let nowData:any = (this.$refs.makeupTable as any).getValue();
|
|
|
+ var data:any = {
|
|
|
+ weight: 0,
|
|
|
+ length: 0,
|
|
|
+ width: 0,
|
|
|
+ height: 0
|
|
|
+ }
|
|
|
+ for (let i in this.productDataList) {
|
|
|
+ for (let j in nowData) {
|
|
|
+ if(this.productDataList[i].id==nowData[j].materialSkuId){
|
|
|
+ var number:any = 1;
|
|
|
+ if(nowData[j].number){
|
|
|
+ var number:any = parseFloat(nowData[j].number).toFixed(2);
|
|
|
+ }
|
|
|
+ if(this.productDataList[i].weight){
|
|
|
+ var weight:any = parseFloat(this.productDataList[i].weight).toFixed(2);
|
|
|
+ data.weight += weight*number;
|
|
|
+ }
|
|
|
+ if(this.productDataList[i].length){
|
|
|
+ var length:any = parseFloat(this.productDataList[i].length).toFixed(2);
|
|
|
+ data.length += length*number;
|
|
|
+ }
|
|
|
+ if(this.productDataList[i].width){
|
|
|
+ var width:any = parseFloat(this.productDataList[i].width).toFixed(2);
|
|
|
+ data.width += width*number;
|
|
|
+ }
|
|
|
+ if(this.productDataList[i].height){
|
|
|
+ var height:any = parseFloat(this.productDataList[i].height).toFixed(2);
|
|
|
+ data.height += height*number;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var val = (this as any).$refs.singeTable.getValue();
|
|
|
+ val[0].weight = data.weight;
|
|
|
+ val[0].length = data.length;
|
|
|
+ val[0].width = data.width;
|
|
|
+ val[0].height = data.height;
|
|
|
+ (this as any).$refs.singeTable.setValue(val);
|
|
|
+ }
|
|
|
+
|
|
|
// 排序生成
|
|
|
forFun(data : any, i : number, v ?: any) {
|
|
|
if (data.list) {
|
|
@@ -1888,7 +1935,7 @@
|
|
|
type: 'warning',
|
|
|
center: true
|
|
|
}).then(() => {
|
|
|
- console.log(this.tableList);
|
|
|
+ // console.log(this.tableList);
|
|
|
(this as any).tableList.map((v : any) => {
|
|
|
if (v.dataIndex === item.dataIndex) v.isDeleted = 1;
|
|
|
})
|
|
@@ -1925,18 +1972,30 @@
|
|
|
}
|
|
|
getPageList(query : any) {
|
|
|
let loading = this.$loading({ target: '.main-container' });
|
|
|
- api.pageList(query, 'maindataMaterial').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);
|
|
|
- loading.close();
|
|
|
- } else this.$message.error(res.msg);
|
|
|
- })
|
|
|
+ api.treeList('maindataMaterialCategory').then((treeRes : any) => {
|
|
|
+ if(treeRes.code==200){
|
|
|
+ api.pageList(query, 'maindataMaterial').then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+
|
|
|
+ var data:any = [{
|
|
|
+ id: 0,
|
|
|
+ name: '物料分类',
|
|
|
+ children: treeRes.data
|
|
|
+ }];
|
|
|
+ (this as any).$refs.sideTree.setData(data);
|
|
|
+
|
|
|
+ (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);
|
|
|
+ loading.close();
|
|
|
+ } else this.$message.error(res.msg);
|
|
|
+ }).catch(() => loading.close());
|
|
|
+ }
|
|
|
+ }).catch(() => loading.close());
|
|
|
}
|
|
|
// 工具栏方法
|
|
|
clickHandle(e : any) {
|
|
@@ -1957,27 +2016,44 @@
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning',
|
|
|
center: true
|
|
|
- }).then(() => {
|
|
|
+ }).then((res) => {
|
|
|
+ console.log(res)
|
|
|
let data = (this.$refs.makeupTable as any).getValue();// 获取表格数据
|
|
|
- let i = -1;
|
|
|
- let j = -1;
|
|
|
- for (const v of data) {
|
|
|
- i++;
|
|
|
- if (v.id == item.id) {
|
|
|
- break
|
|
|
- }
|
|
|
- };
|
|
|
- for (const v of this.makeupList) {
|
|
|
- j++;
|
|
|
- if (v.id == item.id && item.isDeleted === 0) {
|
|
|
- break
|
|
|
+ // let i = -1;
|
|
|
+ // let j = -1;
|
|
|
+ // for (const v of data) {
|
|
|
+ // i++;
|
|
|
+ // if (v.id == item.id) {
|
|
|
+ // break
|
|
|
+ // }
|
|
|
+ // };
|
|
|
+ // for (const v of this.makeupList) {
|
|
|
+ // j++;
|
|
|
+ // if (v.id == item.id && item.isDeleted === 0) {
|
|
|
+ // break
|
|
|
+ // }
|
|
|
+ // };
|
|
|
+ // this.makeupList[j].isDeleted = 1;
|
|
|
+ // data.splice(i, 1);
|
|
|
+ // this.productDataList.splice(i, 1);
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ if(data[i].materialSkuId == item.materialSkuId){
|
|
|
+ if(item.isDeleted == 0){
|
|
|
+ this.makeupList[i].isDeleted = 1;
|
|
|
+ }
|
|
|
+ data.splice(i, 1);
|
|
|
+ this.productDataList.splice(i, 1)
|
|
|
}
|
|
|
};
|
|
|
- this.makeupList[j].isDeleted = 1;
|
|
|
- data.splice(i, 1);
|
|
|
(this.$refs.makeupTable as any).setValue(data);// 设置表格数据
|
|
|
this.$message.success('删除成功');
|
|
|
- }).catch(() => this.$message.info('已取消删除'));
|
|
|
+ // setTimeout(()=> {
|
|
|
+ // this.volumeCount()
|
|
|
+ // }, 10);
|
|
|
+ }).catch((err) => {
|
|
|
+ this.$message.info('已取消删除');
|
|
|
+ console.log(err)
|
|
|
+ });
|
|
|
}
|
|
|
// 内页删除
|
|
|
pageDelete(item : any) {
|
|
@@ -1992,7 +2068,6 @@
|
|
|
this.$message.success('删除成功');
|
|
|
this.isShow = 'home';
|
|
|
// (this as any).$refs.sideTree.request();
|
|
|
- this.getTreeList();
|
|
|
this.getDataList();
|
|
|
} else this.$message.error(res.msg);
|
|
|
}).catch(() => {});
|
|
@@ -2017,7 +2092,6 @@
|
|
|
other.deleteSpuAndSku({ ids: ids }, 'maindataMaterial').then((res : any) => {
|
|
|
if (res.code === 200) {
|
|
|
// (this as any).$refs.sideTree.request();
|
|
|
- this.getTreeList();
|
|
|
this.getDataList();
|
|
|
this.$message.success('删除成功');
|
|
|
} else this.$message.error(res.msg);
|
|
@@ -2035,7 +2109,6 @@
|
|
|
other.deleteSpuAndSku({ ids: item.id }, 'maindataMaterial').then((res : any) => {
|
|
|
if (res.code === 200) {
|
|
|
// (this as any).$refs.sideTree.request();
|
|
|
- this.getTreeList();
|
|
|
this.getDataList();
|
|
|
this.$message.success('删除成功');
|
|
|
} else this.$message.error(res.msg);
|
|
@@ -2046,7 +2119,6 @@
|
|
|
onRefresh() {
|
|
|
(this as any).$refs.moduleView.clearSearch();
|
|
|
// (this as any).$refs.sideTree.request();
|
|
|
- this.getTreeList();
|
|
|
this.categoryIds = '';
|
|
|
this.getDataList();
|
|
|
}
|