leo 3 years ago
commit cc7aa78207

@ -17,4 +17,13 @@ export async function getFormulaList() {
dataList = data.Data;
});
return dataList;
}
export async function getFormulaByFTestCode(param){
let result = 0;
await http.post('/api/Formula/GetFormulaByFTestCode', param || {}).then((data) => {
result = data.Data;
});
return result;
}

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

@ -93,7 +93,7 @@ import {
ref
} from 'vue';
import {
getListByTeamId,
getListByHalfMaterialTeamId,
updateBatchById2,
updateBatchById3
} from "/src/api/api/view";
@ -199,7 +199,7 @@ export default {
this.initPage(layer.load(2));
},
async initPage(idx) {
let _data = await getListByTeamId({
let _data = await getListByHalfMaterialTeamId({
teamId: this.dataInfoObj.FTeamID,
viewType: this.dataInfoObj.FViewType
});
@ -299,29 +299,33 @@ export default {
if (this.dataInfoObj.FCanEdit == 2) {
let fType1 = this.typeList[0].find((t) => {
return t.FID === item.FTypeID1
if(item.FTypeID1){
return t.FID == item.FTypeID1
}
});
let fType2 = this.typeList[1].find((t) => {
return t.FID === item.FTypeID2
if(item.FTypeID2){
return t.FID == item.FTypeID2
}
})
item.FTypeID1 = fType1.FName;
item.FTypeID2 = fType2.FName;
item.FTypeID1 = fType1?fType1.FName:item.FTypeID1;
item.FTypeID2 = fType2?fType2.FName:item.FTypeID2;
}
});
let saveId = this.dataInfoObj.FViewType + "_" + this.dataInfoObj.FID;
localStorage.setItem('EditView' + saveId, JSON.stringify(_data.rows));
this.editColumn = editColumn;
this.dataList = _data.rows;
this.dataColumn = dataColumn;
debugger
this.originalColumns = this.deepCopy(dataColumn);
this.getFreezingColumns();
this._changeType(_data.rows[0],2);
//this._changeType(_data.rows[0],2);
setTimeout(function () {
layer.close(idx);
}, 500);
@ -435,7 +439,9 @@ export default {
let saveId = this.dataInfoObj.FViewType + "_" + this.dataInfoObj.FID;
let cacheDataList = JSON.parse(localStorage.getItem('EditView' + saveId));
console.log('cacheDataList', cacheDataList);
this.dataList.forEach((row, index) => {
debugger
let cache = cacheDataList[index];
let dataObj = {};
console.log('this.editColumn', this.editColumn);
@ -476,6 +482,7 @@ export default {
}
});
let updateLog = updateObj.LogList.join("、");
debugger
if (updateLog != "") {
delete updateObj.LogList
//

@ -93,7 +93,7 @@ import {
ref
} from 'vue';
import {
getListByTeamId,
getListByHalfMaterialTeamId,
updateBatchById4
} from "/src/api/api/view";
import {
@ -198,15 +198,15 @@ export default {
this.initPage(layer.load(2));
},
async initPage(idx) {
let _data = await getListByTeamId({
let _data = await getListByHalfMaterialTeamId({
teamId: this.dataInfoObj.FTeamID,
viewType: this.dataInfoObj.FViewType
});
console.log('_data', _data);
debugger
console.log('_data', _data);
if (this.dataInfoObj.FViewType == 1 || this.dataInfoObj.FViewType == 10) {
this.inputCodeValue = _data.rows[0]?_data.rows[0].HalfCode:"";
this.inputDescValue = _data.rows[0]?_data.rows[0].HalfDesc:"";
this.inputCodeValue = _data.rows[0] ? _data.rows[0].HalfCode : "";
this.inputDescValue = _data.rows[0] ? _data.rows[0].HalfDesc : "";
this.isShow = true;
} else if (this.dataInfoObj.FViewType == 2 || this.dataInfoObj.FViewType == 3 || this.dataInfoObj.FViewType == 4) {
this.isBomShow = true;
@ -215,7 +215,7 @@ export default {
this.typeList[0] = _data.types.filter(s => s.FDepth == 1) || [];
this.typeList[1] = _data.types.filter(s => s.FDepth != 1) || [];
let dataColumn = _data.columns || [];
let editColumn = dataColumn.filter(it => {
let b = false;
if (this.dataInfoObj.FCanEdit != 2) {
@ -257,21 +257,24 @@ export default {
_data.rows.forEach((item, i) => {
columnsList = _data.columns.map(function (items) {
let str = _data.infos[i][items.key + "Type"];
if (typeof (str) != "undefined") {
switch (str) {
case "1":
return items.cellClass = items.cellClass + " one";
case "2":
return items.cellClass = items.cellClass + " twe";
case "3":
return items.cellClass = items.cellClass + " three";
case "4":
return items.cellClass = items.cellClass + " four";
let info = _data.infos[i]
if (info) {
let str = info[items.key + "Type"];
if (typeof (str) != "undefined") {
switch (str) {
case "1":
return items.cellClass = items.cellClass + " one";
case "2":
return items.cellClass = items.cellClass + " twe";
case "3":
return items.cellClass = items.cellClass + " three";
case "4":
return items.cellClass = items.cellClass + " four";
}
}
}
}
return items["cellClass"]="";
return items["cellClass"] = "";
})
let k3Code = item.FBaseMaterialDesc;
if (k3Code.indexOf("@") > 0) {
@ -292,33 +295,72 @@ export default {
item[col.key] = info[col.key] || item[col.key] || "";
});
}
item.FTypeID1 = (item.FTypeID1 == 0 || item.FTypeID1 == -1) ? "" : item.FTypeID1;
item.FTypeID2 = (item.FTypeID2 == 0 || item.FTypeID2 == -1) ? "" : item.FTypeID2;
// 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) => {
// if(item.FTypeID1){
// return t.FID == item.FTypeID1
// }
// });
// let fType2 = this.typeList[1].find((t) => {
// if(item.FTypeID2){
// return t.FID == item.FTypeID2
// }
// })
// item.FTypeID1 = fType1?fType1.FName:item.FTypeID1;
// item.FTypeID2 = fType2?fType2.FName:item.FTypeID2;
//}
});
debugger
let saveId = this.dataInfoObj.FViewType + "_" + this.dataInfoObj.FID;
localStorage.setItem('EditView' + saveId, JSON.stringify(_data.rows));
console.log('editColumn', editColumn);
this.editColumn = editColumn;
this.dataList = _data.rows;
let $this=this;
this.dataList = _data.rows.map(function(item){
if ($this.dataInfoObj.FCanEdit == 2) {
let fType1 = $this.typeList[0].find((t) => {
if(item.FTypeID1){
return t.FID == item.FTypeID1
}
});
let fType2 = $this.typeList[1].find((t) => {
if(item.FTypeID2){
return t.FID == item.FTypeID2
}
})
item.FTypeID1 = fType1?fType1.FName:item.FTypeID1;
item.FTypeID2 = fType2?fType2.FName:item.FTypeID2;
}
return item;
});
this.dataColumn = dataColumn;
this.originalColumns = this.deepCopy(dataColumn);
this.getFreezingColumns();
debugger
this._changeType(_data.rows[0],2);
//this._changeType(_data.rows[0], 2);
setTimeout(function () {
layer.close(idx);
}, 500);
},
async getFreezingColumns() {
let result = await GetFreezingColumns();
let result = await GetFreezingColumns();
let freezingColumns = result.FFreezingColumns
if (freezingColumns) {
let c_list = freezingColumns.split(",")
c_list.forEach(c => {
if(c && c.length > 0) {
if (c && c.length > 0) {
this.freezingColumnSetting.push(c)
}
})
@ -377,34 +419,34 @@ export default {
}
this.dataColumn.map(function (item) {
let str = result[item.key + "Type"];
if (typeof (str) != "undefined") {
switch (str) {
case "1":
if (typeof (item.cellClass) == "undefined") {
return item["cellClass"] = "one";
}
return item.cellClass = item.cellClass.split(" ")[0] + " one";
case "2":
if (typeof (item.cellClass) == "undefined") {
return item["cellClass"] = "twe";
}
return item.cellClass = item.cellClass.split(" ")[0] + " twe";
case "3":
if (typeof (item.cellClass) == "undefined") {
return item["cellClass"] = "three";
}
return item.cellClass = item.cellClass.split(" ")[0] + " three";
case "4":
if (typeof (item.cellClass) == "undefined") {
return item["cellClass"] = "four";
}
return item.cellClass = item.cellClass.split(" ")[0] + " four";
}
}
return item["cellClass"]="";
// let str = result[item.key + "Type"];
// if (typeof (str) != "undefined") {
// switch (str) {
// case "1":
// if (typeof (item.cellClass) == "undefined") {
// return item["cellClass"] = "one";
// }
// return item.cellClass = item.cellClass.split(" ")[0] + " one";
// case "2":
// if (typeof (item.cellClass) == "undefined") {
// return item["cellClass"] = "twe";
// }
// return item.cellClass = item.cellClass.split(" ")[0] + " twe";
// case "3":
// if (typeof (item.cellClass) == "undefined") {
// return item["cellClass"] = "three";
// }
// return item.cellClass = item.cellClass.split(" ")[0] + " three";
// case "4":
// if (typeof (item.cellClass) == "undefined") {
// return item["cellClass"] = "four";
// }
// return item.cellClass = item.cellClass.split(" ")[0] + " four";
// }
// }
return item["cellClass"] = "";
})
}
}
@ -508,9 +550,9 @@ export default {
})
this.dataColumn = freezingColumns.concat(this.tmpDataColumn);
} else {
this.dataColumn = this.tmpDataColumn;
this.dataColumn = this.tmpDataColumn;
}
this.$nextTick();
},

@ -11,7 +11,7 @@
} from 'vue';
import {
getTeamworkView
} from "/src/api/api/teamwork";
} from "/src/api/api/halfmaterialteamwork";
export default {
setup() {
@ -59,6 +59,10 @@
}
},
props: {
dataInfoObj: {
type: Object,
default: () => {},
},
teamId: {
type: String,
default: () => ""
@ -81,10 +85,10 @@
let dataList = [];
let postData = {
FTeamID: this.teamId,
FTeamID: this.dataInfoObj.FID,
FViewType: 2,
FType: 1,
HalfId : this.halfId
HalfId : this.dataInfoObj.FMaterialHalfIDs
};
let result = await getTeamworkView(postData);
@ -108,7 +112,6 @@
dataList.push(item);
});
}
// this.dataColumn = dataColumn;
this.dataList = dataList;
}

@ -5,9 +5,11 @@
<lay-row space="10">
<lay-col md="6"><div class="grid-demo" style="text-align: right;">原配方</div></lay-col>
<lay-col md="18"><div class="grid-demo" style="text-align: left;">配方号+版本号+描述</div></lay-col>
<lay-col md="18"><div class="grid-demo" style="text-align: left;">{{dataInfoObj.FTestCode}}+{{dataInfoObj.FVersionCode}}+{{dataInfoObj.FDesc.trim()}}</div></lay-col>
</lay-row>
<lay-row space="10">
<lay-col md="6"><div class="grid-demo" style="text-align: right;">变更后的配方</div></lay-col>
<lay-col md="18"><div class="grid-demo" style="text-align: left;">配方号+版本号+描述</div></lay-col>
<lay-col md="18"><div class="grid-demo" style="text-align: left;">{{dataInfoObj.NewFTestCode}}+{{dataInfoObj.NewFVersionCode}}+{{dataInfoObj.NewFDesc.trim()}}</div></lay-col>
</lay-row>
</lay-container>
<lay-quote v-if="dataList.length>0"></lay-quote>
@ -25,7 +27,10 @@
</lay-container>
</lay-scroll>
<lay-layer area="90%" v-model="showEditBox" title="视图查看">
<ShowMaterial :viewList="viewList" :viewHeight="viewHeight" @cancelClick="cancelClick"></ShowMaterial>
<ShowMaterial :viewList="viewList" :viewHeight="viewHeight" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></ShowMaterial>
</lay-layer>
<lay-layer area="90%" v-model="showEditBox1" title="配方视图">
<FormulaView :viewList="viewList" :viewHeight="viewHeight" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></FormulaView>
</lay-layer>
</div>
</template>
@ -164,10 +169,12 @@
} from "/src/api/api/user";
import ShowMaterial from './ShowMaterial.vue';
import FormulaView from './FormulaView.vue';
export default {
components: {
ShowMaterial
ShowMaterial,
FormulaView
},
setup() {
const dataList = ref([]);
@ -187,16 +194,20 @@
//
const viewTypeCount = ref(5);
const showEditBox = ref(false);
const showEditBox1 = ref(false);
const viewList = ref([]);
const viewHeight = ref(500);
const objInfoObj=ref([]);
return {
dataList,
dataColumn,
dataProcess,
viewTypeCount,
showEditBox,
showEditBox1,
viewList,
viewHeight
viewHeight,
objInfoObj
}
},
props: {
@ -212,25 +223,26 @@
//
async _getViewList() {
this.dataList = [{"name":"新物料视图","seeCode":"1","outCode":"6"},{"name":"受影响的物料视图","seeCode":"5","outCode":"10"},{"name":"配方视图","seeCode":"5","outCode":"10"}];
debugger
this.dataList = [{"name":"物料视图","code":"1","outCode":"6"},{"name":"配方视图","code":"2","outCode":"10"}];
},
async _getTeamworkView(data, type) {
let viewType = parseInt(type == 1 ? data.seeCode : data.outCode);
if (type == 2) viewType = viewType - this.viewTypeCount;
let postData = {
FTeamID: this.dataInfoObj.FID,
FViewType: viewType,
FType: type,
HalfId : this.dataInfoObj.FMaterialHalfIDs
};
if (this.dataInfoObj.FProgress == "100" || this.dataInfoObj.FProgress == "100%") {
postData.FFinish = 1;
}
debugger
let idx = layer.load(2);
let result = await getTeamworkView(postData);
layer.close(idx);
if (type == 1) {
this.showEditBox = true;
if(data.code==1)
{
this.objInfoObj=this.dataInfoObj;
this.showEditBox = true;
}
else if(data.code==2){
this.objInfoObj=this.dataInfoObj;
this.showEditBox1 = true;
}
} else {
window.open(result);
}

@ -0,0 +1,104 @@
<template>
<lay-container fluid="true" class="content-box">
<lay-button size="sm" type="primary" @click="_downSAP()">SAP</lay-button>
<lay-button size="sm" type="primary" @click="_downMateialView()"></lay-button>
<lay-table height="360px" v-if="dataColumn.length > 0" :columns="dataColumn" :data-source="dataList"
:cellStyle="cellStyle">
</lay-table>
</lay-container>
</template>
<style scoped>
.content-box {
height: 400px;
margin: 20px 10px;
display: block;
position: relative;
clear: both;
float: none;
}
</style>
<script>
import {
ref
} from 'vue';
import {
getPageList
} from "/src/api/api/common";
import {
getFormulaByFTestCode
} from "/src/api/api/formula";
import {
DownMateialView,
DownSAP
} from "/src/api/api/material";
import {
getListByHalfMaterialTeamId
} from "/src/api/api/view"
export default {
setup() {
const dataColumn = ref([]);
const dataList = ref([]);
const cellStyle = function (row, column, rowIndex, columnIndex) {
return column.style || "";
};
const pageInfo = ref({
total: 0,
limit: 10,
current: 1
});
return {
dataColumn,
dataList,
cellStyle,
pageInfo
}
},
props: {
dataInfoObj: {
type: Object,
default: () => { },
}
},
mounted() {
this._getViewList();
},
methods: {
async _downMateialView() {
let result = await DownMateialView({
FID: this.dataInfoObj.FID,
FName: this.dataInfoObj.FName
});
if (result.Code == "200") {
window.location.href = result.Data
}
},
async _downSAP() {
let result = await DownSAP({
FID: this.dataInfoObj.FID,
FName: this.dataInfoObj.FName
});
if (result.Code == "200") {
window.location.href = result.Data
}
},
//
async _getViewList() {
debugger
let _data = await getFormulaByFTestCode({
"code":this.dataInfoObj.NewFTestCode
});
debugger
this.dataColumn =_data.columns;
this.dataList =_data.rows;
},
cancelClick() {
this.$emit('cancelClick', false);
}
}
}
</script>

File diff suppressed because one or more lines are too long

@ -42,7 +42,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="showEditMaterial(3,data)"></lay-button>
</template>
</lay-table>
</lay-card>
@ -268,7 +268,9 @@ export default {
this.editType = 1;
},
showEditMaterial(i) {
showEditMaterial(i,data) {
debugger
this.objInfoObj=data;
this.showEditBox[i] = true;
},
_clickSetInfo(data, type) {

Loading…
Cancel
Save