commit by yzf

master
Yang 3 years ago
parent 2cdb3fba97
commit 6c52c69d45

@ -54,7 +54,9 @@
this.initPage(); this.initPage();
}, },
methods: { methods: {
initPage() { initPage() {
debugger
let dataColumn = [{ let dataColumn = [{
type: "number", type: "number",
title: "序号", title: "序号",

@ -40,7 +40,7 @@
<lay-button @click="cancelClick"></lay-button> <lay-button @click="cancelClick"></lay-button>
</lay-form-item> </lay-form-item>
</div> </div>
<lay-layer :area="['70%', '80%']" v-model="showEditBox" title="选择包材"> <lay-layer :area="['70%', '80%']" v-model="showEditBox" title="选择配方">
<MaterialSelect @_getSeachData="_getSeachData" :dataType1="dataType" @cancelClick="showEditBox = false"> <MaterialSelect @_getSeachData="_getSeachData" :dataType1="dataType" @cancelClick="showEditBox = false">
</MaterialSelect> </MaterialSelect>
</lay-layer> </lay-layer>
@ -154,7 +154,11 @@ export default {
title: "物料描述", title: "物料描述",
key: "FDesc", key: "FDesc",
width: "110px", width: "110px",
width: "260px" },
{
title: "模式",
key: "FFactoryID",
width: "110px",
}, },
{ {
title: "产品分类", title: "产品分类",
@ -295,24 +299,22 @@ export default {
this.showEditBox = true; this.showEditBox = true;
}, },
_getSeachData(data) { _getSeachData(data) {
debugger
if (this.dataType == 1) { if (this.dataType == 1) {
this.formula1 = data.FTestCode; this.formula1 = data.FTestCode;
this.formula1Name = data.FTestCode+"+"+data.FVersionCode+"+"+data.FDesc; this.formula1Name = data.FTestCode+"+"+data.FVersionCode+"+"+data.FName;
this.fVersion1Code=data.FVersionCode; this.fVersion1Code=data.FVersionCode;
this.FDesc=data.FDesc; this.FDesc=data.FName;
this._getPageList(true); this._getPageList(true);
} else { } else {
this.formula2 = data.FTestCode; this.formula2 = data.FTestCode;
this.formula2Name = data.FTestCode+"+"+data.FVersionCode+"+"+data.FDesc; this.formula2Name = data.FTestCode+"+"+data.FVersionCode+"+"+data.FName;
this.fVersion2Code=data.FVersionCode; this.fVersion2Code=data.FVersionCode;
this.FNewDesc=data.FDesc; this.FNewDesc=data.FName;
} }
this.showEditBox = false; this.showEditBox = false;
}, },
// //
async _getPageList(isFirst) { async _getPageList(isFirst) {
debugger
if (isFirst) { if (isFirst) {
this.pageInfo.current = 1; this.pageInfo.current = 1;
this.pageInfo.total = 0; this.pageInfo.total = 0;
@ -329,8 +331,16 @@ export default {
} }
if (this.formula1Name != "") { if (this.formula1Name != "") {
let result = await getPageList(postData, "Material"); let result = await getPageList(postData, "Material");
debugger
let factoryList=[];
for(let i=0;i<this.factoryLists.length;i++){
factoryList.push(this.factoryLists[i]);
}
result.Data.List = result.Data.List || []; result.Data.List = result.Data.List || [];
result.Data.List.forEach((item) => { result.Data.List.forEach((item) => {
if(factoryList){
item.FFactoryID=factoryList.find(s=>s.FID==item.FFactoryID).FName;
}
let type = this.typeList.find(s => s.FValue == item.FType); let type = this.typeList.find(s => s.FValue == item.FType);
item.FTypeName = type == null ? item.FType : type.FName; item.FTypeName = type == null ? item.FType : type.FName;
if (this.dataInfo.FFormulaID == item.FID) this.selectedKey = item.FID if (this.dataInfo.FFormulaID == item.FID) this.selectedKey = item.FID
@ -366,7 +376,6 @@ export default {
} }
let ids = layer.load(0) let ids = layer.load(0)
debugger
let result = await InsertDataModel(postData); let result = await InsertDataModel(postData);
if (result.Code == 200) { if (result.Code == 200) {

@ -57,6 +57,11 @@
key: "FName", key: "FName",
align: 'center' align: 'center'
}, },
{
title: "版本号",
key: "FVersionCode",
align: 'center'
},
{ {
title: "操作", title: "操作",
key: "operator", key: "operator",
@ -110,10 +115,10 @@
this.postData.FPageIndex = this.pageInfo.current; this.postData.FPageIndex = this.pageInfo.current;
this.postData.FPageSize = this.pageInfo.limit; this.postData.FPageSize = this.pageInfo.limit;
let result = await getPageList(this.postData, "Formula"); let result = await getPageList(this.postData, "Formula");
debugger
result.Data.List = result.Data.List || []; result.Data.List = result.Data.List || [];
this.pageInfo.total = result.Data.Total || 0; this.pageInfo.total = result.Data.Total || 0;
this.dataList = result.Data.List; this.dataList = result.Data.List;
debugger
}, },
// //
dateFormat(dataStr) { dateFormat(dataStr) {
@ -121,7 +126,6 @@
}, },
_choseData(data) { _choseData(data) {
let $this = this; let $this = this;
debugger
layer.confirm("您确定要选择此子项吗?", { layer.confirm("您确定要选择此子项吗?", {
title: "提示", title: "提示",
btn: [{ btn: [{

@ -4,22 +4,32 @@
<lay-container class="dataInfo"> <lay-container class="dataInfo">
<lay-row space="10"> <lay-row space="10">
<lay-col md="6"><div class="grid-demo" style="text-align: right;">原配方</div></lay-col> <lay-col md="6">
<lay-col md="18"><div class="grid-demo" style="text-align: left;">{{dataInfoObj.FTestCode}}+{{dataInfoObj.FVersionCode}}+{{dataInfoObj.FDesc}}</div></lay-col> <div class="grid-demo" style="text-align: right;">原配方</div>
</lay-col>
<lay-col md="18">
<div class="grid-demo" style="text-align: left;">
{{ dataInfoObj.FTestCode }}+{{ dataInfoObj.FVersionCode }}+{{ dataInfoObj.FDesc }}</div>
</lay-col>
</lay-row> </lay-row>
<lay-row space="10"> <lay-row space="10">
<lay-col md="6"><div class="grid-demo" style="text-align: right;">变更后的配方</div></lay-col> <lay-col md="6">
<lay-col md="18"><div class="grid-demo" style="text-align: left;">{{dataInfoObj.FNewTestCode}}+{{dataInfoObj.FNewVersionCode}}+{{dataInfoObj.FNewDesc}}</div></lay-col> <div class="grid-demo" style="text-align: right;">变更后的配方</div>
</lay-col>
<lay-col md="18">
<div class="grid-demo" style="text-align: left;">
{{ dataInfoObj.FNewTestCode }}+{{ dataInfoObj.FNewVersionCode }}+{{ dataInfoObj.FNewDesc }}</div>
</lay-col>
</lay-row> </lay-row>
</lay-container> </lay-container>
<lay-quote v-if="dataList.length>0"></lay-quote> <lay-quote v-if="dataList.length > 0"></lay-quote>
<lay-container class="tableInfo" v-if="dataList.length>0"> <lay-container class="tableInfo" v-if="dataList.length > 0">
<lay-table :columns="dataColumn" :dataSource="dataList"> <lay-table :columns="dataColumn" :dataSource="dataList">
<template v-slot:operator="{ data }"> <template v-slot:operator="{ data }">
<lay-button v-if="data.seeCode!=''" size="xs" type="primary" @click="_getTeamworkView(data,1)"> <lay-button v-if="data.seeCode != ''" size="xs" type="primary" @click="_getTeamworkView(data, 1)">
查看 查看
</lay-button> </lay-button>
<lay-button v-if="data.outCode!=''" size="xs" type="primary" @click="_getTeamworkView(data,2)"> <lay-button v-if="data.outCode != ''" size="xs" type="primary" @click="_getTeamworkView(data, 2)">
导出 导出
</lay-button> </lay-button>
</template> </template>
@ -27,234 +37,244 @@
</lay-container> </lay-container>
</lay-scroll> </lay-scroll>
<lay-layer area="90%" v-model="showEditBox" title="视图查看"> <lay-layer area="90%" v-model="showEditBox" title="视图查看">
<ShowMaterial :viewList="viewList" :viewHeight="viewHeight" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></ShowMaterial> <ShowView :viewList="viewList" :viewHeight="viewHeight" @cancelClick="cancelClick"></ShowView>
</lay-layer>
<lay-layer area="90%" v-model="showEditBox1" title="配方视图">
<FormulaView :viewList="viewList" :viewHeight="viewHeight" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></FormulaView>
</lay-layer> </lay-layer>
</div> </div>
</template> </template>
<style scoped> <style scoped>
.box-data { .box-data {
margin: 10px auto; margin: 10px auto;
display: block; display: block;
} }
.dataInfo { .dataInfo {
max-width: 960px; max-width: 960px;
margin: 14px auto 20px; margin: 14px auto 20px;
overflow: hidden; overflow: hidden;
clear: both; clear: both;
float: none; float: none;
} }
.pro-item.state1 { .pro-item.state1 {
background-color: rgb(50, 189, 182, 0.9); background-color: rgb(50, 189, 182, 0.9);
background-image: url('../../../assets/state1.png'); background-image: url('../../../assets/state1.png');
box-shadow: 4px 4px 4px rgb(50, 189, 182, 0.4); box-shadow: 4px 4px 4px rgb(50, 189, 182, 0.4);
} }
.pro-item.state2 { .pro-item.state2 {
background-color: rgb(22, 138, 221, 0.9); background-color: rgb(22, 138, 221, 0.9);
background-image: url('../../../assets/state2.png'); background-image: url('../../../assets/state2.png');
box-shadow: 4px 4px 4px rgb(22, 138, 221, 0.4); box-shadow: 4px 4px 4px rgb(22, 138, 221, 0.4);
} }
.pro-item.none { .pro-item.none {
float: none !important; float: none !important;
display: block !important; display: block !important;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
overflow: hidden; overflow: hidden;
} }
.pro-item.none .left { .pro-item.none .left {
margin-top: 11px; margin-top: 11px;
} }
.pro-item { .pro-item {
background: rgb(187, 187, 187, 0.9) url('../../../assets/state0.png') no-repeat left top; background: rgb(187, 187, 187, 0.9) url('../../../assets/state0.png') no-repeat left top;
-webkit-border-radius: 6px; -webkit-border-radius: 6px;
-ms-border-radius: 6px; -ms-border-radius: 6px;
-o-border-radius: 6px; -o-border-radius: 6px;
-moz-border-radius: 6px; -moz-border-radius: 6px;
border-radius: 6px; border-radius: 6px;
width: 48%; width: 48%;
margin: 10px 1%; margin: 10px 1%;
padding: 16px 5px; padding: 16px 5px;
box-shadow: 4px 4px 4px rgb(187, 187, 187, 0.4); box-shadow: 4px 4px 4px rgb(187, 187, 187, 0.4);
} }
.pro-item .left { .pro-item .left {
width: 34%; width: 34%;
display: block; display: block;
text-align: center; text-align: center;
float: left; float: left;
margin-top: 13px; margin-top: 13px;
margin-bottom: 5px; margin-bottom: 5px;
} }
.pro-item .left.margin { .pro-item .left.margin {
margin-top: 6px; margin-top: 6px;
margin-bottom: 0; margin-bottom: 0;
} }
.pro-item .left.margin .group { .pro-item .left.margin .group {
margin: 6px auto 2px; margin: 6px auto 2px;
} }
.pro-item .left .num { .pro-item .left .num {
-webkit-border-radius: 32px; -webkit-border-radius: 32px;
-ms-border-radius: 32px; -ms-border-radius: 32px;
-o-border-radius: 32px; -o-border-radius: 32px;
-moz-border-radius: 32px; -moz-border-radius: 32px;
border-radius: 32px; border-radius: 32px;
display: block; display: block;
line-height: 32px; line-height: 32px;
font-size: 22px; font-size: 22px;
width: 32px; width: 32px;
border: 1px solid #222; border: 1px solid #222;
margin: 0 auto; margin: 0 auto;
} }
.pro-item .left .group { .pro-item .left .group {
font-weight: 500; font-weight: 500;
line-height: 22px; line-height: 22px;
margin: 10px auto 8px; margin: 10px auto 8px;
font-size: 16px; font-size: 16px;
max-width: 100px; max-width: 100px;
display: block; display: block;
overflow: hidden; overflow: hidden;
} }
.pro-item .right { .pro-item .right {
width: 63%; width: 63%;
display: inline-block; display: inline-block;
line-height: 22px; line-height: 22px;
} }
.pro-item .right p { .pro-item .right p {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis text-overflow: ellipsis
} }
.pro-next { .pro-next {
display: block; display: block;
background: url('../../../assets/state-next.jpg') no-repeat center; background: url('../../../assets/state-next.jpg') no-repeat center;
height: 30px; height: 30px;
margin: 10px auto; margin: 10px auto;
} }
.tableInfo { .tableInfo {
max-width: 96%; max-width: 96%;
margin: 20px auto; margin: 20px auto;
overflow: hidden; overflow: hidden;
clear: both; clear: both;
float: none; float: none;
} }
</style> </style>
<script> <script>
import { import {
ref, ref,
watch watch
} from 'vue'; } from 'vue';
import { import {
getTeamProcessList, getTeamProcessList,
getTeamworkView getTeamworkView
} from "/src/api/api/teamwork"; } from "/src/api/api/halfmaterialteamwork";
import { import {
getBasicRoleList getBasicRoleList
} from "/src/api/api/user"; } from "/src/api/api/user";
import ShowMaterial from './ShowMaterial.vue'; import ShowView from './ShowView.vue';
import FormulaView from './FormulaView.vue'; import FormulaView from './FormulaView.vue';
export default { export default {
components: { components: {
ShowMaterial, ShowView
FormulaView },
}, setup() {
setup() { const dataList = ref([]);
const dataList = ref([]); let dataColumn = [{
let dataColumn = [{ title: "视图",
title: "视图", key: "name",
key: "name",
},
{
title: "操作",
key: "operator",
width: "148px",
customSlot: "operator",
align: "center"
}
];
const dataProcess = ref({});
//
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,
objInfoObj
}
}, },
props: { {
dataInfoObj: { title: "操作",
type: Object, key: "operator",
default: () => {}, width: "148px",
} customSlot: "operator",
}, align: "center"
mounted() { }
this._getViewList(); ];
}, const dataProcess = ref({});
methods: { //
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,
objInfoObj
}
},
props: {
dataInfoObj: {
type: Object,
default: () => { },
}
},
mounted() {
this._getViewList();
},
methods: {
// //
async _getViewList() { async _getViewList() {
debugger this.dataList = [{ "name": "物料视图", "code": "1", "outCode": "6","seeCode":"1" }, { "name": "配方视图", "code": "2", "outCode": "7","seeCode":"2" }];
this.dataList = [{"name":"物料视图","code":"1","outCode":"6"},{"name":"配方视图","code":"2","outCode":"10"}]; },
}, async _getTeamworkView(data, type) {
async _getTeamworkView(data, type) { let viewType = parseInt(type == 1 ? data.seeCode : data.outCode);
debugger 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;
}
let idx = layer.load(2); let idx = layer.load(2);
let result = await getTeamworkView(postData);
layer.close(idx); layer.close(idx);
if (type == 1) { if (type == 1) {
let list = [];
if(data.code==1) let count = 0;
{ for (let key in result) {
this.objInfoObj=this.dataInfoObj; list.push(result[key]);
count += result[key].length;
};
if (count == 0) {
layer.msg("请稍等,视图信息还在编辑中", {
time: 2000,
icon: 3
});
} else {
this.viewList = list;
this.viewHeight = Math.ceil(500);
this.showEditBox = true; this.showEditBox = true;
} }
else if(data.code==2){
this.objInfoObj=this.dataInfoObj;
this.showEditBox1 = true;
}
} else { } else {
window.open(result); window.open(result);
} }
}, },
// //
dateFormat(dataStr) { dateFormat(dataStr) {
if (dataStr == null || dataStr == "") return ""; if (dataStr == null || dataStr == "") return "";
return dataStr.replace('T', ' ').split('.')[0]; return dataStr.replace('T', ' ').split('.')[0];
}, },
cancelClick(isFirst) { cancelClick(isFirst) {
this.$emit('cancelClick', isFirst ? isFirst : false); this.$emit('cancelClick', isFirst ? isFirst : false);
}
} }
} }
}
</script> </script>

@ -1,5 +1,6 @@
<template> <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-row space="10">
<lay-col span="24"> <lay-col span="24">
<lay-card> <lay-card>
@ -42,7 +43,7 @@
<span v-else style="color:#1E9FFF">{{ data.FStateName }}</span> <span v-else style="color:#1E9FFF">{{ data.FStateName }}</span>
</template> </template>
<template v-if="dataInfoObj == undefined || !dataInfoObj.FID" v-slot:operator="{ data }"> <template v-if="dataInfoObj == undefined || !dataInfoObj.FID" v-slot:operator="{ data }">
<lay-button size="xs" type="primary" @click="showEditMaterial(3,data)"></lay-button> <lay-button size="xs" type="primary" @click="showEditMaterial(3, data)">详情</lay-button>
</template> </template>
</lay-table> </lay-table>
</lay-card> </lay-card>
@ -70,10 +71,13 @@ import {
getBasicList, getBasicList,
getPageList getPageList
} from "/src/api/api/common"; } from "/src/api/api/common";
import{
getFactoryList
}from "/src/api/api/factory";
import ShowData1 from '../half/components/ShowData1.vue'; import ShowData1 from '../half/components/ShowData1.vue';
import EditMateria from '../half/components/EditMateria.vue'; import EditMateria from '../half/components/EditMateria.vue';
import EditView from '../half/components/EditView.vue'; import EditView from '../half/components/EditView.vue';
import {GetMaterialTeamworkPageList} from"/src/api/api/halfmaterialteamwork" import { GetMaterialTeamworkPageList } from "/src/api/api/halfmaterialteamwork"
import '@layui/layui-vue/es/checkbox/index.css'; import '@layui/layui-vue/es/checkbox/index.css';
import '@layui/layui-vue/es/radio/index.css'; import '@layui/layui-vue/es/radio/index.css';
@ -119,12 +123,12 @@ export default {
align: 'center' align: 'center'
}, },
{ {
title: "产品分类", title: "模式",
key: "FType", key: "FCreateFactoryID",
width: "150px", width: "150px",
align: 'center' align: 'center'
}, },
{ {
title: "发起时间", title: "发起时间",
key: "FAddDate", key: "FAddDate",
@ -156,6 +160,7 @@ export default {
const selectedKeys = ref(["1"]); const selectedKeys = ref(["1"]);
const checkbox = ref(false); const checkbox = ref(false);
const defaultToolbar = ref(true); const defaultToolbar = ref(true);
const factoryLists = ref([]);
const pageInfo = ref({ const pageInfo = ref({
total: 0, total: 0,
limit: 10, limit: 10,
@ -196,7 +201,8 @@ export default {
stateList, stateList,
hasLoaded, hasLoaded,
MaterialModel, MaterialModel,
dataItem dataItem,
factoryLists
}; };
}, },
props: { props: {
@ -219,9 +225,14 @@ export default {
this.dataColumn[7].hide = false; this.dataColumn[7].hide = false;
} }
this._getTypeList(); this._getTypeList();
this._getPageList(true); this._getFactoryList();
}, },
methods: { methods: {
async _getFactoryList(){
this.factoryLists=await getFactoryList()||[];
this._getPageList(true);
},
changePage(obj) { changePage(obj) {
this.pageInfo.current = obj.current; this.pageInfo.current = obj.current;
this.pageInfo.limit = obj.limit; this.pageInfo.limit = obj.limit;
@ -241,32 +252,37 @@ export default {
}, },
// //
async _getPageList(isFirst, showOk) { async _getPageList(isFirst, showOk) {
let factoryList=[];
this.pageInfo.total = 0; for(let i=0;i<this.factoryLists.length;i++){
if (isFirst) { factoryList.push(this.factoryLists[i]);
this.pageInfo.current = 1; }
this.pageInfo.total = 0;
}
this.postData.FPageIndex = this.pageInfo.current;
this.postData.FPageSize = this.pageInfo.limit;
if (this.dataInfoObj != undefined) {
this.postData.FDataType = this.dataInfoObj;
}
let $this=this; 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;
if (this.dataInfoObj != undefined) {
this.postData.FDataType = this.dataInfoObj;
}
let $this = this;
let result = await GetMaterialTeamworkPageList(this.postData); let result = await GetMaterialTeamworkPageList(this.postData);
this.dataList = result.Data.List.map(function(item){ this.dataList = result.Data.List.map(function (item) {
item.FAddDate = item.FAddDate == null ? "" : $this.dateFormat(item.FAddDate); item.FAddDate = item.FAddDate == null ? "" : $this.dateFormat(item.FAddDate);
if(item.FState==2)
{ if(factoryList){
item["FStateName"]="已完成"; item.FCreateFactoryID=factoryList.find(s=>s.FID==item.FCreateFactoryID).FName;
} }
else if(item.FState==1){ if (item.FState == 2) {
item["FStateName"]="进行中"; item["FStateName"] = "已完成";
}
else if (item.FState == 1) {
item["FStateName"] = "进行中";
} }
return item; return item;
}); });
debugger
this.hasLoaded = true; this.hasLoaded = true;
}, },
@ -283,13 +299,11 @@ export default {
this.editType = 1; this.editType = 1;
}, },
showEditMaterial(i,data) { showEditMaterial(i, data) {
debugger if (data) {
if(data) data["FTeamID"] = data.FID;
{
data["FTeamID"]=data.FID;
} }
this.objInfoObj=data; this.objInfoObj = data;
this.showEditBox[i] = true; this.showEditBox[i] = true;
}, },

Loading…
Cancel
Save