Yang 3 years ago
commit e84c566314

@ -9,6 +9,15 @@ export async function getListByTeamId(params) {
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) {
let result = {};

@ -1,24 +1,23 @@
<template>
<lay-container fluid="true"
:style="'padding:10px;height:'+(dataInfoObj!=undefined?(dataInfoObj.FHeight+'px'):'auto')">
<lay-container fluid="true" :style="'padding:10px;height:'+(dataInfoObj!=undefined?(dataInfoObj.FHeight+'px'):'auto')">
<lay-row space="10">
<lay-col span="24">
<lay-card>
<lay-form :model="searchObj" class="search-box">
<lay-row class="search-items">
<lay-form-item label="物料号" prop="FSaleCode">
<lay-input v-model="searchObj.FSaleCode"></lay-input>
<lay-form-item label="物料号" prop="FMaterialCode">
<lay-input v-model="searchObj.FMaterialCode"></lay-input>
</lay-form-item>
<lay-form-item label="当前流程" prop="FType">
<lay-select v-model="searchObj.FType">
<lay-form-item label="类型" prop="FTeamworkType">
<lay-select v-model="searchObj.FTeamworkType">
<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-form-item>
<lay-form-item v-if="postData.FState!=99" label="事项状态" prop="FState">
<lay-select v-model="searchObj.FState">
<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-form-item>
<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="primary" @click="showEditMaterial(2)"></lay-button>
</template>
<template v-slot:FStateName="{ data }">
<span v-if="data.FStateName=='已完成'" style="color:#5FB878">{{ data.FStateName }}</span>
<span v-else style="color:#1E9FFF">{{ data.FStateName }}</span>
<template v-slot:FTeamworkType="{ data }">
<span v-if="data.FTeamworkType==1" style="color:#5FB878"></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 v-if="dataInfoObj == undefined|| !dataInfoObj.FID" v-slot:operator="{ data }">
<lay-button size="xs" type="primary" @click="showEditMaterial(3)"></lay-button>
@ -84,22 +87,23 @@
},
setup() {
let dataColumn = [
{
title: "ID",
key: "FID",
width: "160px",
align: 'center',
hide: false
},{
title: "物料号",
key: "FMdmCode",
width: "300px",
align: 'center',
hide: false
},
{
title: "ID",
key: "FID",
width: "80px",
align: 'center',
hide: false
},
{
title: "物料描述",
key: "FSaleCode",
key: "FMaterialName",
width: "300px",
align: 'center',
hide: false
},
{
title: "物料号",
key: "FMaterialCode",
width: "160px",
align: 'center',
hide: false
@ -113,34 +117,35 @@
},
{
title: "产品分类",
key: "FDesc",
width: "400px",
key: "FMaterialType",
width: "200px",
align: 'center'
},
{
title: "发起时间",
key: "FAddDate",
width: "180px",
width: "200px",
align: 'center'
},
{
title: "发起人",
key: "FUserName",
width: "178px",
width: "160px",
align: 'center'
},
{
title: "类型",
key: "IsEdit",
width: "98px",
key: "FTeamworkType",
width: "100px",
align: 'center',
customSlot: '',
customSlot: 'FTeamworkType',
},
{
title: "状态",
key: "FStateName",
width: "160px",
align: 'center'
key: "FState",
width: "100px",
align: 'center',
customSlot: 'FState',
},
{
title: "操作",
@ -234,44 +239,49 @@
this.showEditBox[i] = false;
}
},
async _getTypeList() {
this.typeList = await getBasicList(33) || [];
_getTypeList() {
this.typeList = [{
0: "全部",
1: "新增",
2: "修改"
}]
},
//
async _getPageList(isFirst, showOk) {
//this.dataList = [];
this.pageInfo.total = 0;
if (isFirst) {
this.pageInfo.current = 1;
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.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.forEach((item) => {
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.pageInfo.total = result.Data.Total || 0;
this.dataList = result.Data.List;
console.log('this.dataList', this.dataList);
this.hasLoaded = true;
},
//

@ -1,7 +1,7 @@
<template>
<lay-form :model="dataInfo" class="dataInfo">
<lay-form-item label="新增物料描述" prop="FSaleCode" required label-width="120" style="margin-bottom:30px;">
<lay-input v-model="dataInfo.FSaleCode" @input="_inputSaleCode"></lay-input>
<lay-form-item label="新增物料描述" prop="FMaterialName" required label-width="120" style="margin-bottom:30px;">
<lay-input v-model="dataInfo.FMaterialName" @input="_inputSaleCode"></lay-input>
<p class="note">成品半成品中间品子项包材可以新增原料不允许新增</p>
</lay-form-item>
<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 }}
</p>
</lay-form-item>
<lay-form-item label="是否原料" label-width="120">
<lay-checkbox name="like" skin="primary" v-model="checked" value="1"></lay-checkbox>
<lay-form-item label="是否原料" prop="FIsRaw" label-width="120">
<lay-checkbox skin="primary" v-model="dataInfo.FIsRaw"></lay-checkbox>
</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-form-item>
</lay-form>
@ -111,7 +111,7 @@ import {
export default {
setup() {
const checked = ref(false);
const FIsRaw = ref(false);
const dataInfo = ref({
FMaterialType: "ZMAT",
FWeightUnit: "KG"
@ -182,7 +182,7 @@ export default {
saleList,
factoryLists,
factoryValue,
checked
FIsRaw
}
},
props: {
@ -210,7 +210,7 @@ export default {
async _getTeamData(dataId) {
let result = await getDataModel({
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");
this.dataInfo = result || this.dataInfo;
},
@ -273,26 +273,17 @@ export default {
//-
async submitClick(isCreate) {
let postData = this.dataInfo;
postData.FSaleCode = (postData.FSaleCode || "").trim();
postData.FTestCode = (postData.FTestCode || "").trim();
postData.FMaterialGroup = (postData.FMaterialGroup || "").trim();
postData.FWeightUnit = (postData.FWeightUnit || "").trim();
postData.FFormulaName = (postData.FFormulaName || "").trim();
postData.FCreateFactoryID=(postData.FCreateFactoryID==-1?"":postData.FCreateFactoryID);
postData.FState = isCreate ? 1 : 0;
for (let key in postData) {
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));
if (postData.FTestCode != postData.FFormulaTestCode) {
this.sureTextCode(postData);
return false;
}
this._postTermData(postData);
},
//-
@ -325,11 +316,12 @@ export default {
let result = 0;
let idx = layer.load(2);
if (postData.FID && postData.FID > 0) {
result = await updateDataInfo(postData, "Teamwork") || 0;
result = await updateDataInfo(postData, "MaterialTeamwork") || 0;
} 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);
}
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>
</template>
<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>
</lay-table>
</lay-card>
@ -84,22 +84,23 @@
},
setup() {
let dataColumn = [
{
title: "编号",
key: "FID",
width: "160px",
align: 'center',
hide: false
},{
title: "物料号",
key: "FMdmCode",
width: "300px",
align: 'center',
hide: false
},
{
title: "编号",
key: "FID",
width: "80px",
align: 'center',
hide: false
},
{
title: "物料描述",
key: "FSaleCode",
key: "FMaterialName",
width: "200px",
align: 'center',
hide: false
},
{
title: "物料号",
key: "FMaterialCode",
width: "160px",
align: 'center',
hide: false
@ -112,15 +113,15 @@
hide: false
},
{
title: "来源",
title: "事项",
key: "FDesc",
width: "160px",
align: 'center'
},
{
title: "产品分类",
key: "FDesc",
width: "400px",
key: "FMaterialType",
width: "200px",
align: 'center'
},
{
@ -132,13 +133,13 @@
{
title: "发起人",
key: "FUserName",
width: "178px",
width: "160px",
align: 'center'
},
{
title: "负责人",
key: "IsEdit",
width: "98px",
key: "FUserName",
width: "200px",
align: 'center',
customSlot: '',
},
@ -239,9 +240,6 @@
},
//
async _getPageList(isFirst, showOk) {
//this.dataList = [];
this.pageInfo.total = 0;
if (isFirst) {
@ -257,7 +255,8 @@
}
this.postData.FPageIndex = this.pageInfo.current;
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.forEach((item) => {
let type = this.typeList.find(s => s.FValue === item.FType);
@ -269,9 +268,7 @@
item.FFinishDate = item.FFinishDate == null ? "" : this.dateFormat(item.FFinishDate);
});
this.pageInfo.total = result.Data.Total || 0;
debugger
this.dataList = result.Data.List;
debugger
this.hasLoaded = true;
},
//
@ -291,37 +288,21 @@
this.showEditBox[i] = true;
},
_clickSetInfo(data, type) {
console.log('data', data);
for (let i = 0; i < this.showEditBox.length; i++) {
this.showEditBox[i] = false;
}
if (data.FType == 1) {
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) {
if ((data.FType >= 3 && data.FType <= 7) || data.FType == 11) {
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) {
data.FBoxType = 9; //
}else if(data.FType==16){
this.dataItem=data;
data.FBoxType = 10; //
}else {
} else {
return layer.msg("未知事项类型");
}
data.FTeamID = data.FMaterialTeamID;
this.objInfoObj = data;
this.editType = type;
this.showEditBox[data.FBoxType] = true;
this.showEditBox[3] = true;
},

Loading…
Cancel
Save