Yang 3 years ago
commit e84c566314

@ -9,6 +9,15 @@ export async function getListByTeamId(params) {
return result; return result;
} }
//根据物料路线ID获取物料视图
export async function getMaterialViewsByTeamId(params) {
let result = {};
await http.post('/api/View/GetMaterialViewsByTeamId', params).then((data) => {
result = data.Data;
});
return result;
}
//保存视图编辑的内容 //保存视图编辑的内容
export async function updateBatchById(params) { export async function updateBatchById(params) {
let result = {}; let result = {};

@ -1,24 +1,23 @@
<template> <template>
<lay-container fluid="true" <lay-container fluid="true" :style="'padding:10px;height:'+(dataInfoObj!=undefined?(dataInfoObj.FHeight+'px'):'auto')">
:style="'padding:10px;height:'+(dataInfoObj!=undefined?(dataInfoObj.FHeight+'px'):'auto')">
<lay-row space="10"> <lay-row space="10">
<lay-col span="24"> <lay-col span="24">
<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="FTeamworkType">
<lay-select v-model="searchObj.FType"> <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.FValue"
:label="tIdv.FName"></lay-select-option> :label="tIdv.FName"></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">
@ -39,9 +38,13 @@
<lay-button size="sm" type="normal" @click="showEditMaterial(1)"></lay-button> <lay-button size="sm" type="normal" @click="showEditMaterial(1)"></lay-button>
<lay-button size="sm" type="primary" @click="showEditMaterial(2)"></lay-button> <lay-button size="sm" type="primary" @click="showEditMaterial(2)"></lay-button>
</template> </template>
<template v-slot:FStateName="{ data }"> <template v-slot:FTeamworkType="{ data }">
<span v-if="data.FStateName=='已完成'" style="color:#5FB878">{{ data.FStateName }}</span> <span v-if="data.FTeamworkType==1" style="color:#5FB878"></span>
<span v-else style="color:#1E9FFF">{{ data.FStateName }}</span> <span v-else style="color:#1E9FFF">修改</span>
</template>
<template v-slot:FState="{ data }">
<span v-if="data.FState==1" style="color:#5FB878"></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="showEditMaterial(3)"></lay-button> <lay-button size="xs" type="primary" @click="showEditMaterial(3)"></lay-button>
@ -84,22 +87,23 @@
}, },
setup() { setup() {
let dataColumn = [ let dataColumn = [
{ {
title: "ID", title: "ID",
key: "FID", key: "FID",
width: "160px", width: "80px",
align: 'center', align: 'center',
hide: false hide: false
},{ },
title: "物料号",
key: "FMdmCode",
width: "300px",
align: 'center',
hide: false
},
{ {
title: "物料描述", title: "物料描述",
key: "FSaleCode", key: "FMaterialName",
width: "300px",
align: 'center',
hide: false
},
{
title: "物料号",
key: "FMaterialCode",
width: "160px", width: "160px",
align: 'center', align: 'center',
hide: false hide: false
@ -113,34 +117,35 @@
}, },
{ {
title: "产品分类", title: "产品分类",
key: "FDesc", key: "FMaterialType",
width: "400px", width: "200px",
align: 'center' align: 'center'
}, },
{ {
title: "发起时间", title: "发起时间",
key: "FAddDate", key: "FAddDate",
width: "180px", width: "200px",
align: 'center' align: 'center'
}, },
{ {
title: "发起人", title: "发起人",
key: "FUserName", key: "FUserName",
width: "178px", width: "160px",
align: 'center' align: 'center'
}, },
{ {
title: "类型", title: "类型",
key: "IsEdit", key: "FTeamworkType",
width: "98px", width: "100px",
align: 'center', align: 'center',
customSlot: '', customSlot: 'FTeamworkType',
}, },
{ {
title: "状态", title: "状态",
key: "FStateName", key: "FState",
width: "160px", width: "100px",
align: 'center' align: 'center',
customSlot: 'FState',
}, },
{ {
title: "操作", title: "操作",
@ -234,44 +239,49 @@
this.showEditBox[i] = false; this.showEditBox[i] = false;
} }
}, },
async _getTypeList() { _getTypeList() {
this.typeList = await getBasicList(33) || []; this.typeList = [{
0: "全部",
1: "新增",
2: "修改"
}]
}, },
// //
async _getPageList(isFirst, showOk) { async _getPageList(isFirst, showOk) {
//this.dataList = [];
this.pageInfo.total = 0; this.pageInfo.total = 0;
if (isFirst) { if (isFirst) {
this.pageInfo.current = 1; this.pageInfo.current = 1;
this.pageInfo.total = 0; this.pageInfo.total = 0;
} }
if (this.dataInfoObj && this.dataInfoObj.FID) {
this.postData.FTeamID = this.dataInfoObj.FID; //
this.postData.FIsUser = false; if (this.searchObj && this.searchObj.FMaterialCode) {
this.postData.FMaterialCode = this.searchObj.FMaterialCode
}
//
if (this.searchObj && this.searchObj.FTeamworkType) {
this.postData.FTeamworkType = this.searchObj.FTeamworkType
}
//
if (this.searchObj && this.searchObj.FState) {
this.postData.FState = this.searchObj.FState
} }
if (this.pageTypeObj && this.pageTypeObj == 2) {
this.postData.FState = 99; //
if (this.searchObj && this.searchObj.FDateRange) {
this.postData.FDateRange = this.searchObj.FDateRange
} }
this.postData.FPageIndex = this.pageInfo.current; this.postData.FPageIndex = this.pageInfo.current;
this.postData.FPageSize = this.pageInfo.limit; this.postData.FPageSize = this.pageInfo.limit;
let result = await getPageList(this.postData, "Task"); let result = await getPageList(this.postData, "MaterialTeamwork");
result.Data.List = result.Data.List || []; result.Data.List = result.Data.List || [];
result.Data.List.forEach((item) => { this.pageInfo.total = result.Data.Total || 0;
let type = this.typeList.find(s => s.FValue === item.FType);
item.FTypeName = type == null ? "" : type.FName;
let state = this.stateList.find(s => s.id === item.FState)
item.FStateName = state == null ? "" : state.name;
item.FAddDate = item.FAddDate == null ? "" : this.dateFormat(item.FAddDate);
item.FEditDate = item.FEditDate == null ? "" : this.dateFormat(item.FEditDate);
item.FFinishDate = item.FFinishDate == null ? "" : this.dateFormat(item.FFinishDate);
item["IsEdit"]=Math.floor(Math.random()*10)==0?"编辑":"新增";
});
this.pageInfo.total = result.Data.Total || 0;
debugger
this.dataList = result.Data.List; this.dataList = result.Data.List;
console.log('this.dataList', this.dataList);
this.hasLoaded = true; this.hasLoaded = true;
}, },
// //

@ -1,7 +1,7 @@
<template> <template>
<lay-form :model="dataInfo" class="dataInfo"> <lay-form :model="dataInfo" class="dataInfo">
<lay-form-item label="新增物料描述" prop="FSaleCode" required label-width="120" style="margin-bottom:30px;"> <lay-form-item label="新增物料描述" prop="FMaterialName" required label-width="120" style="margin-bottom:30px;">
<lay-input v-model="dataInfo.FSaleCode" @input="_inputSaleCode"></lay-input> <lay-input v-model="dataInfo.FMaterialName" @input="_inputSaleCode"></lay-input>
<p class="note">成品半成品中间品子项包材可以新增原料不允许新增</p> <p class="note">成品半成品中间品子项包材可以新增原料不允许新增</p>
</lay-form-item> </lay-form-item>
<lay-form-item label="选择模式" prop="FCreateFactoryID" required label-width="120" style="margin-bottom:30px;"> <lay-form-item label="选择模式" prop="FCreateFactoryID" required label-width="120" style="margin-bottom:30px;">
@ -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="是否原料" label-width="120"> <lay-form-item label="是否原料" prop="FIsRaw" label-width="120">
<lay-checkbox name="like" skin="primary" v-model="checked" value="1"></lay-checkbox> <lay-checkbox skin="primary" v-model="dataInfo.FIsRaw"></lay-checkbox>
</lay-form-item> </lay-form-item>
<lay-form-item label="试验号" required label-width="120"> <lay-form-item label="试验号" prop="FTestCode" required 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>
@ -111,7 +111,7 @@ import {
export default { export default {
setup() { setup() {
const checked = ref(false); const FIsRaw = ref(false);
const dataInfo = ref({ const dataInfo = ref({
FMaterialType: "ZMAT", FMaterialType: "ZMAT",
FWeightUnit: "KG" FWeightUnit: "KG"
@ -182,7 +182,7 @@ export default {
saleList, saleList,
factoryLists, factoryLists,
factoryValue, factoryValue,
checked FIsRaw
} }
}, },
props: { props: {
@ -210,7 +210,7 @@ export default {
async _getTeamData(dataId) { async _getTeamData(dataId) {
let result = await getDataModel({ let result = await getDataModel({
FID: dataId, FID: dataId,
FKey: "FID,FTestCode,FWeightUnit,FSaleCode,FMaterialType,FMaterialGroup,FFormulaTestCode,FFormulaName,FFormulaID,FPackCode,FCreateFactoryID" FKey: "FID,FTestCode,FWeightUnit,FSaleCode,FMaterialType,FMaterialGroup,FFormulaName,FFormulaID,FPackCode,FCreateFactoryID"
}, "Teamwork"); }, "Teamwork");
this.dataInfo = result || this.dataInfo; this.dataInfo = result || this.dataInfo;
}, },
@ -273,26 +273,17 @@ export default {
//- //-
async submitClick(isCreate) { async submitClick(isCreate) {
let postData = this.dataInfo; let postData = this.dataInfo;
postData.FSaleCode = (postData.FSaleCode || "").trim();
postData.FTestCode = (postData.FTestCode || "").trim(); postData.FTestCode = (postData.FTestCode || "").trim();
postData.FMaterialGroup = (postData.FMaterialGroup || "").trim(); postData.FMaterialGroup = (postData.FMaterialGroup || "").trim();
postData.FWeightUnit = (postData.FWeightUnit || "").trim(); postData.FWeightUnit = (postData.FWeightUnit || "").trim();
postData.FFormulaName = (postData.FFormulaName || "").trim();
postData.FCreateFactoryID=(postData.FCreateFactoryID==-1?"":postData.FCreateFactoryID); postData.FCreateFactoryID=(postData.FCreateFactoryID==-1?"":postData.FCreateFactoryID);
postData.FState = isCreate ? 1 : 0;
for (let key in postData) { for (let key in postData) {
if (postData[key] == "") return false; if (postData[key] == "") return false;
} }
// let indexs = [postData.FSaleCode.indexOf("-"), postData.FSaleCode.indexOf("@")];
// if (indexs[0] == -1 || indexs[1] == -1 || indexs[1] - indexs[0] < 2) {
// layer.msg('')
// return false;
// }
postData.FState = isCreate ? 1 : 0;
postData = JSON.parse(JSON.stringify(postData)); postData = JSON.parse(JSON.stringify(postData));
if (postData.FTestCode != postData.FFormulaTestCode) {
this.sureTextCode(postData);
return false;
}
this._postTermData(postData); this._postTermData(postData);
}, },
//- //-
@ -325,11 +316,12 @@ export default {
let result = 0; let result = 0;
let idx = layer.load(2); let idx = layer.load(2);
if (postData.FID && postData.FID > 0) { if (postData.FID && postData.FID > 0) {
result = await updateDataInfo(postData, "Teamwork") || 0; result = await updateDataInfo(postData, "MaterialTeamwork") || 0;
} else { } else {
result = await insertDataInfo(postData, "Teamwork") || 0; result = await insertDataInfo(postData, "MaterialTeamwork") || 0;
} }
if (result > 0) { console.log('result', result);
if (result.TaskId > 0) {
this.cancelClick(true); this.cancelClick(true);
} }
layer.close(idx); layer.close(idx);

File diff suppressed because one or more lines are too long

@ -44,7 +44,7 @@
<span v-else style="color:#1E9FFF">{{ data.FStateName }}</span> <span v-else style="color:#1E9FFF">{{ data.FStateName }}</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="showEditMaterial(3)"></lay-button> <lay-button size="xs" type="primary" @click="_clickSetInfo(data)"></lay-button>
</template> </template>
</lay-table> </lay-table>
</lay-card> </lay-card>
@ -84,22 +84,23 @@
}, },
setup() { setup() {
let dataColumn = [ let dataColumn = [
{ {
title: "编号", title: "编号",
key: "FID", key: "FID",
width: "160px", width: "80px",
align: 'center', align: 'center',
hide: false hide: false
},{ },
title: "物料号",
key: "FMdmCode",
width: "300px",
align: 'center',
hide: false
},
{ {
title: "物料描述", title: "物料描述",
key: "FSaleCode", key: "FMaterialName",
width: "200px",
align: 'center',
hide: false
},
{
title: "物料号",
key: "FMaterialCode",
width: "160px", width: "160px",
align: 'center', align: 'center',
hide: false hide: false
@ -112,15 +113,15 @@
hide: false hide: false
}, },
{ {
title: "来源", title: "事项",
key: "FDesc", key: "FDesc",
width: "160px", width: "160px",
align: 'center' align: 'center'
}, },
{ {
title: "产品分类", title: "产品分类",
key: "FDesc", key: "FMaterialType",
width: "400px", width: "200px",
align: 'center' align: 'center'
}, },
{ {
@ -132,13 +133,13 @@
{ {
title: "发起人", title: "发起人",
key: "FUserName", key: "FUserName",
width: "178px", width: "160px",
align: 'center' align: 'center'
}, },
{ {
title: "负责人", title: "负责人",
key: "IsEdit", key: "FUserName",
width: "98px", width: "200px",
align: 'center', align: 'center',
customSlot: '', customSlot: '',
}, },
@ -239,9 +240,6 @@
}, },
// //
async _getPageList(isFirst, showOk) { async _getPageList(isFirst, showOk) {
//this.dataList = []; //this.dataList = [];
this.pageInfo.total = 0; this.pageInfo.total = 0;
if (isFirst) { if (isFirst) {
@ -257,7 +255,8 @@
} }
this.postData.FPageIndex = this.pageInfo.current; this.postData.FPageIndex = this.pageInfo.current;
this.postData.FPageSize = this.pageInfo.limit; this.postData.FPageSize = this.pageInfo.limit;
let result = await getPageList(this.postData, "Task"); let result = await getPageList(this.postData, "MaterialTask");
console.log('result', result);
result.Data.List = result.Data.List || []; result.Data.List = result.Data.List || [];
result.Data.List.forEach((item) => { result.Data.List.forEach((item) => {
let type = this.typeList.find(s => s.FValue === item.FType); let type = this.typeList.find(s => s.FValue === item.FType);
@ -269,9 +268,7 @@
item.FFinishDate = item.FFinishDate == null ? "" : this.dateFormat(item.FFinishDate); item.FFinishDate = item.FFinishDate == null ? "" : this.dateFormat(item.FFinishDate);
}); });
this.pageInfo.total = result.Data.Total || 0; this.pageInfo.total = result.Data.Total || 0;
debugger
this.dataList = result.Data.List; this.dataList = result.Data.List;
debugger
this.hasLoaded = true; this.hasLoaded = true;
}, },
// //
@ -291,37 +288,21 @@
this.showEditBox[i] = true; this.showEditBox[i] = true;
}, },
_clickSetInfo(data, type) { _clickSetInfo(data, type) {
console.log('data', data);
for (let i = 0; i < this.showEditBox.length; i++) { for (let i = 0; i < this.showEditBox.length; i++) {
this.showEditBox[i] = false; this.showEditBox[i] = false;
} }
if (data.FType == 1) { if ((data.FType >= 3 && data.FType <= 7) || data.FType == 11) {
data.FBoxType = 1; //
} else if (data.FType == 2) {
data.FBoxType = 2; //BOM
} else if (data.FType == 9 || data.FType == 10) {
data.FBoxType = 4; //
} else if ((data.FType >= 3 && data.FType <= 7) || data.FType == 11) {
data.FBoxType = 3; // data.FBoxType = 3; //
} else if (data.FType == 8) {
data.FBoxType = 5; //
} else if (data.FType == 12) {
data.FBoxType = 6; //
} else if (data.FType == 13) {
data.FBoxType = 7; //
} else if (data.FType == 14) {
data.FBoxType = 8; //
} else if (data.FType == 15) { } else if (data.FType == 15) {
data.FBoxType = 9; // data.FBoxType = 9; //
}else if(data.FType==16){ } else {
this.dataItem=data;
data.FBoxType = 10; //
}else {
return layer.msg("未知事项类型"); return layer.msg("未知事项类型");
} }
data.FTeamID = data.FMaterialTeamID;
this.objInfoObj = data; this.objInfoObj = data;
this.editType = type; this.editType = type;
this.showEditBox[data.FBoxType] = true; this.showEditBox[3] = true;
}, },

Loading…
Cancel
Save