commit by yzf

master
Yang 3 years ago
parent d0ab78a96e
commit 4989d2b1d2

@ -320,7 +320,7 @@
this._clickSetInfo(this.dataItem,1); this._clickSetInfo(this.dataItem,1);
}, },
_clickSetInfo(data, type) { _clickSetInfo(data, type) {
debugger
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;
} }

@ -1,6 +1,6 @@
<template> <template>
<lay-container style="height:700px;overflow: auto;" fluid="true" class="content-box"> <lay-container style="height:700px;overflow: auto;" fluid="true" class="content-box">
<FormulaView :teamId="dataInfoObj.FTeamID" :halfId="dataInfoObj.FMaterialHalfIDs"></FormulaView> <MaterialList :teamId="dataInfoObj.FTeamID" :halfId="dataInfoObj.FMaterialHalfIDs"></MaterialList>
<lay-table id="dataTable" v-if="dataColumn.length > 0" height="320px" :columns="dataColumn" :data-source="dataList" <lay-table id="dataTable" v-if="dataColumn.length > 0" height="320px" :columns="dataColumn" :data-source="dataList"
:cellStyle="cellStyle" :cellClassName="cellClassName"> :cellStyle="cellStyle" :cellClassName="cellClassName">
@ -98,12 +98,12 @@ import {
import { EditTypeList } from "/src/api/api/teamwork"; import { EditTypeList } from "/src/api/api/teamwork";
import OperateLog from "./OperateLog.vue"; import OperateLog from "./OperateLog.vue";
import FormulaView from "./FormulaView.vue"; import MaterialList from "./MaterialList.vue";
export default { export default {
components: { components: {
OperateLog, OperateLog,
FormulaView, MaterialList,
}, },
setup() { setup() {
let dataColumn = [{ let dataColumn = [{

@ -107,7 +107,7 @@ import {
import { import {
getInfoData, getInfoData,
changeInfoData GetMaterialInfoList
} from "/src/api/api/materialType"; } from "/src/api/api/materialType";
import OperateLog from "./OperateLog.vue"; import OperateLog from "./OperateLog.vue";
import FormulaView from "./FormulaView.vue"; import FormulaView from "./FormulaView.vue";
@ -133,12 +133,34 @@ export default {
[] []
]); ]);
const cellStyle = function (row, column, rowIndex, columnIndex) { const cellStyle = function (row, column, rowIndex, columnIndex) {
let back = column.table == "TFS_ViewMaterial" ? "background:rgb(246, 246, 246)" : "" let back = column.table == "TFS_ViewMaterial" ? "background:rgb(246, 246, 246)" : "";
let info = row["info"];
if (info) {
if (typeof(document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0])!="undefined") {
switch (info[column.key + "Type"]) {
case "1":
return document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0].classList.add("one");
case "2":
return document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0].classList.add("twe");
case "3":
return document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0].classList.add("three");
case "4":
return document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0].classList.add("four");
default:
document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0].classList.remove("one");
document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0].classList.remove("twe");
document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0].classList.remove("three");
document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0].classList.remove("four")
return "";
}
}
}
return back; return back;
} };
const cellClassName = function (row, column, rowIndex, columnIndex) { const cellClassName = function (row, column, rowIndex, columnIndex) {
return column.cellClass || ""; return column.cellClass = column.key + "_" + rowIndex + "_" + columnIndex;
} };
const inputCodeValue = ref(""); const inputCodeValue = ref("");
const inputDescValue = ref(""); const inputDescValue = ref("");
const visible2 = ref(false) const visible2 = ref(false)
@ -149,6 +171,9 @@ export default {
const freezingColumnSetting = ref([]); const freezingColumnSetting = ref([]);
const originalColumns = ref([]); const originalColumns = ref([]);
const tmpDataColumn = ref([]); const tmpDataColumn = ref([]);
const idx = ref([]);
const materialInfoList=ref([]);
return { return {
dataColumn, dataColumn,
dataList, dataList,
@ -167,7 +192,9 @@ export default {
showFreezingColumnSettingBox, showFreezingColumnSettingBox,
freezingColumnSetting, freezingColumnSetting,
originalColumns, originalColumns,
tmpDataColumn tmpDataColumn,
materialInfoList,
idx
}; };
}, },
props: { props: {
@ -182,6 +209,7 @@ export default {
}, },
mounted() { mounted() {
this.getUserPower(); this.getUserPower();
this.initPage(this.idx);
}, },
methods: { methods: {
async getUserPower() { async getUserPower() {
@ -198,14 +226,15 @@ export default {
this.initPage(layer.load(2)); this.initPage(layer.load(2));
}, },
async initPage(idx) { async initPage(idx) {
console.log('this.dataInfoObj', this.dataInfoObj); console.log('this.dataInfoObj', this.dataInfoObj);
let _data = await getListByTeamId({ let _data = await getListByTeamId({
teamId: this.dataInfoObj.FTeamID, teamId: this.dataInfoObj.FTeamID,
viewType: this.dataInfoObj.FViewType viewType: this.dataInfoObj.FViewType
}); });
this.materialInfoList = await GetMaterialInfoList() || null;
let freezingCols = await GetFreezingColumns(); let freezingCols = await GetFreezingColumns();
debugger
if (this.dataInfoObj.FViewType == 1 || this.dataInfoObj.FViewType == 10) { if (this.dataInfoObj.FViewType == 1 || this.dataInfoObj.FViewType == 10) {
this.inputCodeValue = _data.rows[0]?_data.rows[0].HalfCode:""; this.inputCodeValue = _data.rows[0]?_data.rows[0].HalfCode:"";
this.inputDescValue = _data.rows[0]?_data.rows[0].HalfDesc:""; this.inputDescValue = _data.rows[0]?_data.rows[0].HalfDesc:"";
@ -303,7 +332,11 @@ export default {
localStorage.setItem('EditView' + saveId, JSON.stringify(_data.rows)); localStorage.setItem('EditView' + saveId, JSON.stringify(_data.rows));
this.editColumn = editColumn; this.editColumn = editColumn;
this.dataList = _data.rows; let $this=this;
this.dataList = _data.rows.map(function (item) {
item["info"]=$this.materialInfoList.Data.find(s=>s.FDataID==item.FTypeID2);
return item;
});
this.dataColumn = dataColumn; this.dataColumn = dataColumn;
this.originalColumns = this.deepCopy(dataColumn); this.originalColumns = this.deepCopy(dataColumn);
@ -391,7 +424,14 @@ export default {
if (typeName.indexOf("成品") > 0) { if (typeName.indexOf("成品") > 0) {
data.FViewType = 1 data.FViewType = 1
} }
let $this=this;
this.dataList.map(function (item) {
if(item.FID==data.FID)
{
item.info=$this.materialInfoList.Data.find(s=>s.FDataID==data.FTypeID2);
}
return item;
})
this.dataColumn.map(function (item) { this.dataColumn.map(function (item) {
let str = result[item.key + "Type"]; let str = result[item.key + "Type"];

@ -0,0 +1,142 @@
<template>
<p>替代料</p>
<lay-form :model="searchObj" class="search-box">
<lay-row class="search-items">
<lay-form-item label="物料号" prop="FCode">
<lay-input v-model="searchObj.FCode"></lay-input>
</lay-form-item>
<lay-form-item label="试验号" prop="FTestCode">
<lay-input v-model="searchObj.FTestCode"></lay-input>
</lay-form-item>
<lay-form-item label="物料描述" prop="FName">
<lay-input v-model="searchObj.FName"></lay-input>
</lay-form-item>
</lay-row>
<lay-form-item class="search-btn">
<lay-button size="sm" type="primary" @click="_clickSearch"></lay-button>
<lay-button size="sm" @click="_clickReset"></lay-button>
</lay-form-item>
</lay-form>
<lay-table style="height: 30vh;overflow: auto;" :columns="dataColumn" id="id" :dataSource="dataList"
:page="dataList.length > 0 ? pageInfo : null" @change="changePage">
</lay-table>
</template>
<script>
import {
ref,
watch
} from "vue";
import {
getPageList
} from "/src/api/api/common";
import '@layui/layui-vue/es/checkbox/index.css';
import '@layui/layui-vue/es/radio/index.css';
export default {
setup() {
let dataColumn = [{
title: "物料号",
key: "FCode",
align: 'center'
},
{
title: "试验号",
key: "FTestCode",
align: 'center'
},
{
title: "物料描述",
key: "FName",
align: 'center'
}
];
const pageInfo = ref({
total: 0,
limit: 5,
current: 1
});
const dataList = ref([]);
const searchObj = ref({});
const postData = ref({});
const objInfoObj = ref({});
return {
dataColumn,
dataList,
pageInfo,
searchObj,
postData,
objInfoObj,
};
},
props: {
dataInfoObj: {
type: Object,
default: () => { },
}
},
mounted() {
this._getPageList(true);
},
methods: {
changePage(obj) {
this.pageInfo.current = obj.current;
this._getPageList();
},
//
async _getPageList(isFirst, showOk) {
this.pageInfo.total = 0;
if (isFirst) {
this.pageInfo.current = 1;
this.pageInfo.total = 0;
}
this.postData.FPageIndex = this.pageInfo.current;
this.postData.FPageSize = this.pageInfo.limit;
this.postData.FType = 40;
let result = await getPageList(this.postData, "Material");
result.Data.List = result.Data.List || [];
this.pageInfo.total = result.Data.Total || 0;
this.dataList = result.Data.List;
},
//
dateFormat(dataStr) {
return dataStr.replace('T', ' ').split('.')[0];
},
_choseData(data) {
let $this = this;
layer.confirm("您确定要选择此子项吗?", {
title: "提示",
btn: [{
text: '确定',
callback: function (id) {
layer.close(id);
$this.$emit('selectClick', data)
}
},
{
text: '取消',
callback: function (id) {
layer.close(id);
}
}
]
});
},
//-
_clickSearch() {
this.postData = {};
for (let key in this.searchObj) {
let val = this.searchObj[key];
if (val != null && val !== "") this.postData[key] = val;
}
this._getPageList(true);
},
//-
_clickReset() {
this.searchObj = {};
this._clickSearch();
}
}
}
</script>

@ -28,7 +28,7 @@
</lay-form-item> </lay-form-item>
<lay-form-item class="remark"> <lay-form-item class="remark">
<p>备注配方变更需要重新下载BOM配方配方变更后一下内容需要重新更新到SAP</p> <p>备注配方变更需要重新下载BOM配方配方变更后一下内容需要重新更新到SAP</p>
<p>1如果实验号变更那么实验号对应的受影响的物料会自动更新实验号</p> <p>1如果试验号变更那么试验号对应的受影响的物料会自动更新试验号</p>
<p>2配方变更会重新下载BOM配方</p> <p>2配方变更会重新下载BOM配方</p>
<p>3新BOM配方对应的配方视图重新生成同时用户需要更新到SAP</p> <p>3新BOM配方对应的配方视图重新生成同时用户需要更新到SAP</p>
<p>4新BOM配方中的新的物料需要用户维护视图并更新到SAP</p> <p>4新BOM配方中的新的物料需要用户维护视图并更新到SAP</p>
@ -298,13 +298,13 @@ export default {
debugger debugger
if (this.dataType == 1) { if (this.dataType == 1) {
this.formula1 = data.FTestCode; this.formula1 = data.FTestCode;
this.formula1Name = data.FName; this.formula1Name = data.FTestCode+"+"+data.FVersionCode+"+"+data.FDesc;
this.fVersion1Code=data.FVersionCode; this.fVersion1Code=data.FVersionCode;
this.FDesc=data.FDesc; this.FDesc=data.FDesc;
this._getPageList(true); this._getPageList(true);
} else { } else {
this.formula2 = data.FTestCode; this.formula2 = data.FTestCode;
this.formula2Name = data.FName; this.formula2Name = data.FTestCode+"+"+data.FVersionCode+"+"+data.FDesc;
this.fVersion2Code=data.FVersionCode; this.fVersion2Code=data.FVersionCode;
this.FNewDesc=data.FDesc; this.FNewDesc=data.FDesc;
} }

@ -1,6 +1,6 @@
<template> <template>
<lay-container fluid="true" class="content-box"> <lay-container fluid="true" class="content-box">
<!-- <FormulaView :teamId="dataInfoObj.FTeamID" :dataInfoObj="dataInfoObj" :halfId="dataInfoObj.FMaterialHalfIDs"></FormulaView> --> <FormulaView :teamId="dataInfoObj.FTeamID" :dataInfoObj="dataInfoObj" :halfId="dataInfoObj.FMaterialHalfIDs"></FormulaView>
<lay-layer area="90%" v-model="showFreezingColumnSettingBox" title="固定列设置" :end="closeFreezingSetting"> <lay-layer area="90%" v-model="showFreezingColumnSettingBox" title="固定列设置" :end="closeFreezingSetting">
<FreezingColumnSetting v-if="showFreezingColumnSettingBox" :columns="originalColumns" <FreezingColumnSetting v-if="showFreezingColumnSettingBox" :columns="originalColumns"
:freezingColumns="freezingColumnSetting" @cancelClick="setFreezingColumnsSetting"></FreezingColumnSetting> :freezingColumns="freezingColumnSetting" @cancelClick="setFreezingColumnsSetting"></FreezingColumnSetting>

@ -1,6 +1,6 @@
<template> <template>
<lay-container fluid="true" class="content-box"> <lay-container fluid="true" class="content-box">
<!-- <FormulaView :teamId="dataInfoObj.FTeamID" :halfId="dataInfoObj.FMaterialHalfIDs"></FormulaView> --> <FormulaView :teamId="dataInfoObj.FTeamID" :halfId="dataInfoObj.FMaterialHalfIDs"></FormulaView>
<lay-layer area="90%" v-model="showFreezingColumnSettingBox" title="固定列设置" :end="closeFreezingSetting"> <lay-layer area="90%" v-model="showFreezingColumnSettingBox" title="固定列设置" :end="closeFreezingSetting">
<FreezingColumnSetting v-if="showFreezingColumnSettingBox" :columns="originalColumns" <FreezingColumnSetting v-if="showFreezingColumnSettingBox" :columns="originalColumns"
:freezingColumns="freezingColumnSetting" @cancelClick="setFreezingColumnsSetting"></FreezingColumnSetting> :freezingColumns="freezingColumnSetting" @cancelClick="setFreezingColumnsSetting"></FreezingColumnSetting>

@ -77,15 +77,16 @@
}, },
methods: { methods: {
async initPage() { async initPage() {
let ids = layer.load(2)
let dataColumn = [{ let dataColumn = [{
type: "number", type: "number",
title: "序号", title: "序号",
width: "56" width: "56"
}]; }];
let dataList = []; let dataList = [];
debugger
let postData = { let postData = {
FTeamID: this.dataInfoObj.FID, FTeamID: this.dataInfoObj.FTeamID,
FViewType: 2, FViewType: 2,
FType: 1, FType: 1,
HalfId : this.dataInfoObj.FMaterialHalfIDs HalfId : this.dataInfoObj.FMaterialHalfIDs
@ -114,6 +115,7 @@
} }
// this.dataColumn = dataColumn; // this.dataColumn = dataColumn;
this.dataList = dataList; this.dataList = dataList;
layer.close(ids);
} }
} }
} }

@ -83,7 +83,7 @@ export default {
}, },
// //
async _getViewList() { async _getViewList() {
let ids = layer.load(2);
let _data = await getListByHalfMaterialTeamId({ let _data = await getListByHalfMaterialTeamId({
teamId: this.dataInfoObj.FID, teamId: this.dataInfoObj.FID,
viewType: "2" viewType: "2"
@ -91,26 +91,28 @@ export default {
debugger debugger
this.typeList[0] = _data.types.filter(s => s.FDepth == 1) || []; this.typeList[0] = _data.types.filter(s => s.FDepth == 1) || [];
this.typeList[1] = _data.types.filter(s => s.FDepth != 1) || []; this.typeList[1] = _data.types.filter(s => s.FDepth != 1) || [];
this.dataColumn =_data.columns; this.dataColumn =_data.columns;
let $this=this; let $this=this;
this.dataList =_data.rows.map(function(item){ this.dataList =_data.rows.map(function(item){
let fType1 = $this.typeList[0].find((t) => { let fType1 = $this.typeList[0].find((t) => {
if(item.FTypeID1){ if (item.FTypeID1) {
return t.FID == item.FTypeID1 return t.FID == item.FTypeID1
} }
}); });
let fType2 = $this.typeList[1].find((t) => { let fType2 = $this.typeList[1].find((t) => {
if(item.FTypeID2){ if (item.FTypeID2) {
return t.FID == item.FTypeID2 return t.FID == item.FTypeID2
} }
}); })
item["FTypeID1"]=fType1.FName; item.FTypeID1 = fType1 ? fType1.FName : "";
item["FTypeID2"]=fType2.FName; item.FTypeID2 = fType2 ? fType2.FName : "";
return item; return item;
}); });
layer.close(ids);
}, },
cancelClick() { cancelClick() {
this.$emit('cancelClick', false); this.$emit('cancelClick', false);

@ -241,7 +241,7 @@ export default {
}, },
// //
async _getPageList(isFirst, showOk) { async _getPageList(isFirst, showOk) {
this.pageInfo.total = 0; this.pageInfo.total = 0;
if (isFirst) { if (isFirst) {
this.pageInfo.current = 1; this.pageInfo.current = 1;
@ -285,7 +285,9 @@ export default {
}, },
showEditMaterial(i,data) { showEditMaterial(i,data) {
debugger debugger
data["FTeamID"]=data.FID;
this.objInfoObj=data; this.objInfoObj=data;
this.showEditBox[i] = true; this.showEditBox[i] = true;
}, },
_clickSetInfo(data, type) { _clickSetInfo(data, type) {

@ -50,18 +50,18 @@
</lay-card> </lay-card>
</lay-col> </lay-col>
</lay-row> </lay-row>
<lay-layer :area="modelArea[2]" v-model="showEditBox[2]" :title="编辑物料"> <lay-layer :area="modelArea[2]" v-model="showEditBox[2]" title="编辑物料">
<EditMateria v-if="showEditBox[2]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></EditMateria> <EditMateria v-if="showEditBox[2]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></EditMateria>
</lay-layer> </lay-layer>
<lay-layer :area="modelArea[1]" v-model="showEditBox[1]" :title="物料视图"> <lay-layer :area="modelArea[1]" v-model="showEditBox[1]" title="物料视图">
<EditView v-if="showEditBox[1]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></EditView> <EditView v-if="showEditBox[1]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></EditView>
</lay-layer> </lay-layer>
<lay-layer :area="modelArea[3]" v-model="showEditBox[3]" :title="物料视图"> <lay-layer :area="modelArea[3]" v-model="showEditBox[3]" title="物料视图">
<EditViewOFF v-if="showEditBox[3]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></EditViewOFF> <EditViewOFF v-if="showEditBox[3]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></EditViewOFF>
</lay-layer> </lay-layer>
<lay-layer :area="modelArea[0]" v-model="showEditBox[0]" :title="BOM下载"> <lay-layer :area="modelArea[0]" v-model="showEditBox[0]" title="BOM下载">
<BOMDownload v-if="showEditBox[0]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></BOMDownload> <BOMDownload v-if="showEditBox[0]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></BOMDownload>
</lay-layer> </lay-layer>
</lay-container> </lay-container>

Loading…
Cancel
Save