|
|
|
|
@ -9,12 +9,6 @@
|
|
|
|
|
<template v-slot:toolbar v-if="dataInfoObj.FCanEdit != 2">
|
|
|
|
|
<lay-button size="sm" @click="saveBatch" type="primary" :disabled="editColumn.length === 0">保存
|
|
|
|
|
</lay-button>
|
|
|
|
|
<lay-input :class="this.isShow ? 'isShow' : 'isHidden'" v-model="inputCodeValue" :readonly="true">
|
|
|
|
|
<template #prepend>半成品编号:</template>
|
|
|
|
|
</lay-input>
|
|
|
|
|
<lay-input :class="this.isShow ? 'isShow' : 'isHidden'" v-model="inputDescValue" :readonly="true">
|
|
|
|
|
<template #prepend>描述:</template>
|
|
|
|
|
</lay-input>
|
|
|
|
|
<lay-button size="sm" type="primary" style="float:right;" :disabled="editColumn.length === 0"
|
|
|
|
|
@click="_clickFreezingColumnSetting()">固定项
|
|
|
|
|
</lay-button>
|
|
|
|
|
@ -92,10 +86,12 @@ import {
|
|
|
|
|
ref
|
|
|
|
|
} from 'vue';
|
|
|
|
|
import {
|
|
|
|
|
getMaterialViewsByTeamId,
|
|
|
|
|
getListByTeamId,
|
|
|
|
|
updateBatchById2
|
|
|
|
|
updateMaterialViewById
|
|
|
|
|
} from "/src/api/api/view";
|
|
|
|
|
import {
|
|
|
|
|
getMaterialViewsByTeamId,
|
|
|
|
|
updateMaterial
|
|
|
|
|
} from "/src/api/api/materialEdit"
|
|
|
|
|
import {
|
|
|
|
|
getBasicRoleList,
|
|
|
|
|
GetFreezingColumns
|
|
|
|
|
@ -106,8 +102,7 @@ import {
|
|
|
|
|
} from "/src/api/api/common";
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
getInfoData,
|
|
|
|
|
changeInfoData
|
|
|
|
|
getInfoData
|
|
|
|
|
} from "/src/api/api/materialType";
|
|
|
|
|
import OperateLog from "./OperateLog.vue";
|
|
|
|
|
import FormulaView from "./FormulaView.vue";
|
|
|
|
|
@ -187,7 +182,7 @@ export default {
|
|
|
|
|
async getUserPower() {
|
|
|
|
|
if (this.dataInfoObj.FCanEdit != 2) {
|
|
|
|
|
this.userPower[0] = (await getBasicRoleList({
|
|
|
|
|
FRoleType: 84,
|
|
|
|
|
FRoleType: 40,
|
|
|
|
|
FViewType: this.dataInfoObj.FViewType
|
|
|
|
|
}) || []).map(it => parseInt(it.F2))
|
|
|
|
|
this.userPower[1] = (await getBasicRoleList({
|
|
|
|
|
@ -200,19 +195,8 @@ export default {
|
|
|
|
|
async initPage(idx) {
|
|
|
|
|
let _data = await getMaterialViewsByTeamId({
|
|
|
|
|
teamId: this.dataInfoObj.FTeamID,
|
|
|
|
|
viewType: 10,
|
|
|
|
|
teamType: 1
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
console.log('_data', _data);
|
|
|
|
|
|
|
|
|
|
if (this.dataInfoObj.FViewType == 1 || this.dataInfoObj.FViewType == 10) {
|
|
|
|
|
this.inputCodeValue = _data.rows[0].HalfCode;
|
|
|
|
|
this.inputDescValue = _data.rows[0].HalfDesc;
|
|
|
|
|
this.isShow = true;
|
|
|
|
|
} else if (this.dataInfoObj.FViewType == 2 || this.dataInfoObj.FViewType == 3 || this.dataInfoObj.FViewType == 4) {
|
|
|
|
|
this.isBomShow = true;
|
|
|
|
|
}
|
|
|
|
|
}, "MaterialTeamwork");
|
|
|
|
|
|
|
|
|
|
this.typeList[0] = _data.types.filter(s => s.FDepth == 1) || [];
|
|
|
|
|
this.typeList[1] = _data.types.filter(s => s.FDepth != 1) || [];
|
|
|
|
|
@ -246,20 +230,15 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// //修改项移到前面
|
|
|
|
|
// if (this.dataInfoObj.FCanEdit != 2) {
|
|
|
|
|
// let tempColumn1 = dataColumn.filter(s => s.customSlot) || [];
|
|
|
|
|
// let tempColumn2 = dataColumn.filter(s => s.customSlot == undefined) || [];
|
|
|
|
|
// dataColumn = [...tempColumn1, ...tempColumn2];
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
let columnsList = [];
|
|
|
|
|
let col7 = dataColumn.filter(s => s.fieldType == 7) || [];
|
|
|
|
|
|
|
|
|
|
_data.rows.forEach((item, i) => {
|
|
|
|
|
|
|
|
|
|
columnsList = _data.columns.map(function (items) {
|
|
|
|
|
let str = _data.infos[i][items.key + "Type"];
|
|
|
|
|
let info = _data.infos[i]
|
|
|
|
|
if (info) {
|
|
|
|
|
let str = info[items.key + "Type"];
|
|
|
|
|
if (typeof (str) != "undefined") {
|
|
|
|
|
switch (str) {
|
|
|
|
|
case "1":
|
|
|
|
|
@ -272,6 +251,7 @@ export default {
|
|
|
|
|
return items.cellClass = items.cellClass + " four";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return items["cellClass"]="";
|
|
|
|
|
})
|
|
|
|
|
@ -296,7 +276,21 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
item.FTypeID1 = (item.FTypeID1 == 0 || item.FTypeID1 == -1) ? "" : item.FTypeID1;
|
|
|
|
|
item.FTypeID2 = (item.FTypeID2 == 0 || item.FTypeID2 == -1) ? "" : item.FTypeID2;
|
|
|
|
|
|
|
|
|
|
if (this.dataInfoObj.FCanEdit == 2) {
|
|
|
|
|
let fType1 = this.typeList[0].find((t) => {
|
|
|
|
|
return t.FID === item.FTypeID1
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
let fType2 = this.typeList[1].find((t) => {
|
|
|
|
|
return t.FID === item.FTypeID2
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
item.FTypeID1 = fType1.FName;
|
|
|
|
|
item.FTypeID2 = fType2.FName;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
let saveId = this.dataInfoObj.FViewType + "_" + this.dataInfoObj.FID;
|
|
|
|
|
localStorage.setItem('EditView' + saveId, JSON.stringify(_data.rows));
|
|
|
|
|
|
|
|
|
|
@ -305,7 +299,11 @@ export default {
|
|
|
|
|
this.dataColumn = dataColumn;
|
|
|
|
|
this.originalColumns = this.deepCopy(dataColumn);
|
|
|
|
|
this.getFreezingColumns();
|
|
|
|
|
|
|
|
|
|
if (this.dataInfoObj.FCanEdit != 2) {
|
|
|
|
|
this._changeType(_data.rows[0],2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
layer.close(idx);
|
|
|
|
|
}, 500);
|
|
|
|
|
@ -457,7 +455,7 @@ export default {
|
|
|
|
|
if (updateLog != "") {
|
|
|
|
|
delete updateObj.LogList
|
|
|
|
|
// 发送保存请求
|
|
|
|
|
let _result = await updateBatchById2(updateObj);
|
|
|
|
|
let _result = await updateMaterial(updateObj, "MaterialTeamwork");
|
|
|
|
|
if (_result.Code === 200) {
|
|
|
|
|
await commonSave({
|
|
|
|
|
teamId: updateObj.FTeamID,
|
|
|
|
|
@ -470,7 +468,7 @@ export default {
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
layer.close(idx);
|
|
|
|
|
layer.msg('保存成功');
|
|
|
|
|
$this.$emit('cancelClick', true, true);
|
|
|
|
|
$this.$emit('cancelClick', true, false);
|
|
|
|
|
$this.$refs.OperateLog._getPageList();
|
|
|
|
|
}, 500);
|
|
|
|
|
}
|
|
|
|
|
|