leo 2 years ago
commit 116f9550af

@ -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 v-if="isFormula" @changeFormula="changeFormula" :teamId="dataInfoObj.FTeamID" :dataInfoObj="dataInfoObj" :halfId="dataInfoObj.FMaterialHalfIDs">
</FormulaView> </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"
@ -191,6 +191,7 @@ export default {
const idx = ref([]); const idx = ref([]);
const materialInfoList = ref([]); const materialInfoList = ref([]);
const dataRowsList=ref(""); const dataRowsList=ref("");
const isFormula=ref(true);
return { return {
dataColumn, dataColumn,
dataList, dataList,
@ -213,7 +214,8 @@ export default {
infoList, infoList,
materialInfoList, materialInfoList,
idx, idx,
dataRowsList dataRowsList,
isFormula
}; };
}, },
@ -229,10 +231,10 @@ export default {
}, },
mounted() { mounted() {
this.getUserPower(); this.getUserPower();
this.initPage(this.idx);
}, },
methods: { methods: {
async getUserPower() { async getUserPower() {
this.idx=layer.load(2)
if (this.dataInfoObj.FCanEdit != 2) { if (this.dataInfoObj.FCanEdit != 2) {
this.userPower[0] = (await getBasicRoleList({ this.userPower[0] = (await getBasicRoleList({
FRoleType: 84, FRoleType: 84,
@ -247,10 +249,10 @@ export default {
Type: 2 Type: 2
}) || []).map(it => parseInt(it.F2)) }) || []).map(it => parseInt(it.F2))
} }
this.initPage(layer.load(2)); this.initPage();
}, },
async initPage(idx) { async initPage() {
this.idx = idx; let idx = this.idx
let _data = await getListByHalfMaterialTeamId({ let _data = await getListByHalfMaterialTeamId({
teamId: this.dataInfoObj.FTeamID, teamId: this.dataInfoObj.FTeamID,
viewType: this.dataInfoObj.FViewType viewType: this.dataInfoObj.FViewType
@ -355,14 +357,20 @@ export default {
item["info"] = $this.materialInfoList.Data.find(s => s.FDataID == item.FTypeID2); item["info"] = $this.materialInfoList.Data.find(s => s.FDataID == item.FTypeID2);
if(typeof(item["FTypeID1"])=="string") if(typeof(item["FTypeID1"])=="string"&&item["FTypeID1"]!="")
{ {
item["FTypeID1"]=parseInt(item["FTypeID1"]); if(!isNaN(parseInt(item["FTypeID1"])))
{
item["FTypeID1"]=parseInt(item["FTypeID1"]);
}
} }
if(typeof(item["FTypeID2"])=="string") if(typeof(item["FTypeID2"])=="string"&&item["FTypeID2"]!="")
{ {
item["FTypeID2"]=parseInt(item["FTypeID2"]); if(!isNaN(parseInt(item["FTypeID2"])))
{
item["FTypeID2"]=parseInt(item["FTypeID2"]);
}
} }
let fType1 = $this.typeList[0].find((t) => { let fType1 = $this.typeList[0].find((t) => {
@ -398,6 +406,7 @@ export default {
return item; return item;
}); });
this.dataColumn = dataColumn; this.dataColumn = dataColumn;
layer.close(idx);
this.originalColumns = this.deepCopy(dataColumn); this.originalColumns = this.deepCopy(dataColumn);
let freezingColumns = freezingCols.FFreezingColumns let freezingColumns = freezingCols.FFreezingColumns
@ -416,9 +425,7 @@ export default {
} }
//this._changeType(_data.rows[0],2); //this._changeType(_data.rows[0],2);
setTimeout(function () {
layer.close(idx);
}, 500);
}, },
cancelClick(isRefresh) { cancelClick(isRefresh) {
@ -586,6 +593,10 @@ export default {
}, },
deepCopy(arr) { deepCopy(arr) {
return JSON.parse(JSON.stringify(arr)) return JSON.parse(JSON.stringify(arr))
},
changeFormula(val){
debugger
this.isFormula=val;
} }
} }
} }

@ -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 v-if="isFormula" @changeFormula="changeFormula" :teamId="dataInfoObj.FTeamID" :dataInfoObj="dataInfoObj" :halfId="dataInfoObj.FMaterialHalfIDs">
</FormulaView> </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"
@ -188,6 +188,7 @@ export default {
const materialInfoList = ref([]); const materialInfoList = ref([]);
const idx = ref([]); const idx = ref([]);
const dataRowsList=ref(""); const dataRowsList=ref("");
const isFormula=ref(true);
return { return {
dataColumn, dataColumn,
dataList, dataList,
@ -209,7 +210,8 @@ export default {
tmpDataColumn, tmpDataColumn,
materialInfoList, materialInfoList,
idx, idx,
dataRowsList dataRowsList,
isFormula
}; };
}, },
props: { props: {
@ -359,16 +361,21 @@ export default {
this.dataList = _data.rows.map(function (item) { this.dataList = _data.rows.map(function (item) {
item["info"] = $this.materialInfoList.Data.find(s => s.FDataID == item.FTypeID2); item["info"] = $this.materialInfoList.Data.find(s => s.FDataID == item.FTypeID2);
if(typeof(item["FTypeID1"])=="string") if(typeof(item["FTypeID1"])=="string"&&item["FTypeID1"]!="")
{ {
item["FTypeID1"]=parseInt(item["FTypeID1"]); if(!isNaN(parseInt(item["FTypeID1"])))
{
item["FTypeID1"]=parseInt(item["FTypeID1"]);
}
} }
if(typeof(item["FTypeID2"])=="string") if(typeof(item["FTypeID2"])=="string"&&item["FTypeID2"]!="")
{ {
item["FTypeID2"]=parseInt(item["FTypeID2"]); if(!isNaN(parseInt(item["FTypeID2"])))
{
item["FTypeID2"]=parseInt(item["FTypeID2"]);
}
} }
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
@ -610,6 +617,10 @@ export default {
}, },
deepCopy(arr) { deepCopy(arr) {
return JSON.parse(JSON.stringify(arr)) return JSON.parse(JSON.stringify(arr))
},
changeFormula(val){
debugger
this.isFormula=val;
} }
} }
} }

@ -77,7 +77,6 @@
}, },
methods: { methods: {
async initPage() { async initPage() {
let ids = layer.load(2)
let dataColumn = [{ let dataColumn = [{
type: "number", type: "number",
title: "序号", title: "序号",
@ -90,7 +89,7 @@
FType: 1, FType: 1,
HalfId : this.dataInfoObj.FMaterialHalfIDs HalfId : this.dataInfoObj.FMaterialHalfIDs
}; };
debugger
let result = await getTeamworkView(postData); let result = await getTeamworkView(postData);
let formulaList = result["List1"] let formulaList = result["List1"]
@ -114,7 +113,11 @@
} }
// this.dataColumn = dataColumn; // this.dataColumn = dataColumn;
this.dataList = dataList; this.dataList = dataList;
layer.close(ids);
if(formulaList.length==0)
{
this.$emit('changeFormula', false);
}
} }
} }
} }

Loading…
Cancel
Save