修改调用MDM获取物料号

master
leo 3 years ago
parent a3a0fb0b52
commit ba921244b3

@ -10,8 +10,8 @@
</lay-form-item> </lay-form-item>
<lay-form-item label="类型" prop="FTeamworkType"> <lay-form-item label="类型" prop="FTeamworkType">
<lay-select v-model="searchObj.FTeamworkType"> <lay-select v-model="searchObj.FTeamworkType">
<lay-select-option v-for="(tIdv,tIdx) in typeList" :key="tIdx" :value="tIdv.FValue" <lay-select-option v-for="(tIdv,tIdx) in typeList" :key="tIdx" :value="tIdv.id"
:label="tIdv.FName"></lay-select-option> :label="tIdv.name"></lay-select-option>
</lay-select> </lay-select>
</lay-form-item> </lay-form-item>
<lay-form-item v-if="postData.FState!=99" label="事项状态" prop="FState"> <lay-form-item v-if="postData.FState!=99" label="事项状态" prop="FState">
@ -165,7 +165,6 @@
current: 1 current: 1
}); });
const dataList = ref([]); const dataList = ref([]);
const typeList = ref([]);
const searchObj = ref({}); const searchObj = ref({});
const postData = ref({}); const postData = ref({});
const MaterialModel= ref({}); const MaterialModel= ref({});
@ -174,12 +173,19 @@
const objInfoObj = ref({}); const objInfoObj = ref({});
const editType = ref(1); const editType = ref(1);
const stateList = ref([{ const stateList = ref([{
id: 1, id: 1,
name: "进行中" name: "进行中"
}, { }, {
id: 2, id: 2,
name: "已完成" name: "已完成"
}]); }]);
const typeList = ref([{
id: 1,
name: "新增"
}, {
id: 2,
name: "修改"
}]);
const hasLoaded = ref(false); const hasLoaded = ref(false);
const dataItem=ref([]); const dataItem=ref([]);
return { return {
@ -221,7 +227,6 @@
this.dataColumn[2].hide = true; this.dataColumn[2].hide = true;
this.dataColumn[7].hide = false; this.dataColumn[7].hide = false;
} }
this._getTypeList();
this._getPageList(true); this._getPageList(true);
}, },
methods: { methods: {
@ -239,13 +244,6 @@
this.showEditBox[i] = false; this.showEditBox[i] = false;
} }
}, },
_getTypeList() {
this.typeList = [{
0: "全部",
1: "新增",
2: "修改"
}]
},
// //
async _getPageList(isFirst, showOk) { async _getPageList(isFirst, showOk) {
this.pageInfo.total = 0; this.pageInfo.total = 0;

@ -26,10 +26,10 @@
{{ seletList[0].find(s => s.FValue == dataInfo.FWeightUnit).FName }} {{ seletList[0].find(s => s.FValue == dataInfo.FWeightUnit).FName }}
</p> </p>
</lay-form-item> </lay-form-item>
<lay-form-item label="是否原料" prop="FIsRaw" label-width="120"> <lay-form-item label="是否获取MDM编码" prop="FIsRaw" label-width="120">
<lay-checkbox skin="primary" v-model="dataInfo.FIsRaw"></lay-checkbox> <lay-checkbox skin="primary" v-model="dataInfo.FIsRaw"></lay-checkbox>
</lay-form-item> </lay-form-item>
<lay-form-item label="试验号" prop="FTestCode" required label-width="120"> <lay-form-item label="试验号" prop="FTestCode" label-width="120">
<lay-input v-model="dataInfo.FTestCode"></lay-input> <lay-input v-model="dataInfo.FTestCode"></lay-input>
</lay-form-item> </lay-form-item>
</lay-form> </lay-form>
@ -283,7 +283,7 @@ export default {
postData.FState = isCreate ? 1 : 0; postData.FState = isCreate ? 1 : 0;
for (let key in postData) { for (let key in postData) {
if (postData[key] == "") return false; if (postData[key] == "" && key != "FTestCode") return false;
} }
postData = JSON.parse(JSON.stringify(postData)); postData = JSON.parse(JSON.stringify(postData));

@ -6,19 +6,19 @@
<lay-card> <lay-card>
<lay-form :model="searchObj" class="search-box"> <lay-form :model="searchObj" class="search-box">
<lay-row class="search-items"> <lay-row class="search-items">
<lay-form-item label="物料号" prop="FSaleCode"> <lay-form-item label="物料号" prop="FMaterialCode">
<lay-input v-model="searchObj.FSaleCode"></lay-input> <lay-input v-model="searchObj.FMaterialCode"></lay-input>
</lay-form-item> </lay-form-item>
<lay-form-item label="类型" prop="FType"> <lay-form-item label="类型" prop="FType">
<lay-select v-model="searchObj.FType"> <lay-select v-model="searchObj.FType">
<lay-select-option v-for="(tIdv,tIdx) in typeList" :key="tIdx" :value="tIdv.FValue" <lay-select-option v-for="(tIdv,tIdx) in typeList" :key="tIdx" :value="tIdv.id"
:label="tIdv.FName"></lay-select-option> :label="tIdv.name"></lay-select-option>
</lay-select> </lay-select>
</lay-form-item> </lay-form-item>
<lay-form-item v-if="postData.FState!=99" label="事项状态" prop="FState"> <lay-form-item v-if="postData.FState!=99" label="事项状态" prop="FState">
<lay-select v-model="searchObj.FState"> <lay-select v-model="searchObj.FState">
<lay-select-option v-for="(tv,tx) in stateList" :key="tx" :value="tv.id" <lay-select-option v-for="(tv,tx) in stateList" :key="tx" :value="tv.id"
:label="tv.name"></lay-select-option> :label="tv.name"></lay-select-option>
</lay-select> </lay-select>
</lay-form-item> </lay-form-item>
<lay-form-item label="发起日期" prop="FDateRange"> <lay-form-item label="发起日期" prop="FDateRange">
@ -37,11 +37,10 @@
<template v-slot:toolbar> <template v-slot:toolbar>
<lay-button size="sm" @click="_getPageList(false,true)"></lay-button> <lay-button size="sm" @click="_getPageList(false,true)"></lay-button>
<lay-button size="sm" type="normal" style="float:right" @click="showEditMaterial(1)"></lay-button> <lay-button size="sm" type="normal" style="float:right" @click="showEditMaterial(1)"></lay-button>
</template> </template>
<template v-slot:FStateName="{ data }"> <template v-slot:FState="{ data }">
<span v-if="data.FStateName=='已完成'" style="color:#5FB878">{{ data.FStateName }}</span> <span v-if="data.FState==1" style="color:#5FB878"></span>
<span v-else style="color:#1E9FFF">{{ data.FStateName }}</span> <span v-else style="color:#1E9FFF">已完成</span>
</template> </template>
<template v-if="dataInfoObj == undefined|| !dataInfoObj.FID" v-slot:operator="{ data }"> <template v-if="dataInfoObj == undefined|| !dataInfoObj.FID" v-slot:operator="{ data }">
<lay-button size="xs" type="primary" @click="_clickSetInfo(data)"></lay-button> <lay-button size="xs" type="primary" @click="_clickSetInfo(data)"></lay-button>
@ -95,14 +94,14 @@
{ {
title: "物料号", title: "物料号",
key: "FMaterialCode", key: "FMaterialCode",
width: "160px", width: "120px",
align: 'center', align: 'center',
hide: false hide: false
}, },
{ {
title: "试验号", title: "试验号",
key: "FTestCode", key: "FTestCode",
width: "160px", width: "120px",
align: 'center', align: 'center',
hide: false hide: false
}, },
@ -115,7 +114,7 @@
{ {
title: "产品分类", title: "产品分类",
key: "FMaterialTypeName", key: "FMaterialTypeName",
width: "200px", width: "160px",
align: 'center' align: 'center'
}, },
{ {
@ -137,6 +136,13 @@
align: 'center', align: 'center',
customSlot: '', customSlot: '',
}, },
{
title: "状态",
key: "FState",
width: "100px",
align: 'center',
customSlot: 'FState',
},
{ {
title: "操作", title: "操作",
key: "operator", key: "operator",
@ -155,7 +161,16 @@
current: 1 current: 1
}); });
const dataList = ref([]); const dataList = ref([]);
const typeList = ref([]); const typeList = ref([{
id: 0,
name: "物料分类选择"
}, {
id: 1,
name: "物料视图编辑"
}, {
id: 2,
name: "物料视图确认"
}]);
const searchObj = ref({}); const searchObj = ref({});
const postData = ref({}); const postData = ref({});
const MaterialModel= ref({}); const MaterialModel= ref({});
@ -212,7 +227,6 @@
this.dataColumn[7].hide = false; this.dataColumn[7].hide = false;
} }
this._getTypeList();
this._getPageList(true); this._getPageList(true);
}, },
methods: { methods: {
@ -230,9 +244,6 @@
this.showEditBox[i] = false; this.showEditBox[i] = false;
} }
}, },
async _getTypeList() {
this.typeList = await getBasicList(33) || [];
},
// //
async _getPageList(isFirst, showOk) { async _getPageList(isFirst, showOk) {
//this.dataList = []; //this.dataList = [];
@ -240,6 +251,7 @@
if (isFirst) { if (isFirst) {
this.pageInfo.current = 1; this.pageInfo.current = 1;
this.pageInfo.total = 0; this.pageInfo.total = 0;
this.postData.FType = -1;
} }
if (this.dataInfoObj && this.dataInfoObj.FID) { if (this.dataInfoObj && this.dataInfoObj.FID) {
this.postData.FTeamID = this.dataInfoObj.FID; this.postData.FTeamID = this.dataInfoObj.FID;
@ -248,8 +260,10 @@
if (this.pageTypeObj && this.pageTypeObj == 2) { if (this.pageTypeObj && this.pageTypeObj == 2) {
this.postData.FState = 99; this.postData.FState = 99;
} }
if (!("FType" in this.postData)) this.postData.FType = -1;
this.postData.FPageIndex = this.pageInfo.current; this.postData.FPageIndex = this.pageInfo.current;
this.postData.FPageSize = this.pageInfo.limit; this.postData.FPageSize = this.pageInfo.limit;
console.log('this.postData', this.postData);
let result = await getPageList(this.postData, "MaterialTask"); let result = await getPageList(this.postData, "MaterialTask");
result.Data.List = result.Data.List || []; result.Data.List = result.Data.List || [];
@ -314,12 +328,12 @@
let val = this.searchObj[key]; let val = this.searchObj[key];
if (val != null && val !== "") this.postData[key] = val; if (val != null && val !== "") this.postData[key] = val;
} }
this._getPageList(true); this._getPageList(false);
}, },
//- //-
_clickReset() { _clickReset() {
this.searchObj = {}; this.searchObj = {};
this._clickSearch(); this._getPageList(true);
} }
} }
} }

Loading…
Cancel
Save