Commit 91adb124 authored by renjintao's avatar renjintao

mesplan

parent c104f68f
...@@ -71,28 +71,46 @@ export default { ...@@ -71,28 +71,46 @@ export default {
load(v) { load(v) {
this.dataImmut = []; this.dataImmut = [];
this.dataMut = []; this.dataMut = [];
let url = `${workflowUrl}/schema/intend`; //判断流程是否启用
let params = {
// this.$api.get(url, { schemaId: v }).then(r => { id: v
// if (r.success) { };
// // console.warn("VVVV",r) this.$api.get(`${workflowUrl}/schema/getbyid`, params).then(res => {
// r.result.nodes.map((u, i) => { if (res.success) {
// if (i > 0) { let wfStatus = res.result.status;
// let ids = u.defaultUsers.immutable.concat(u.defaultUsers.mutable); if (wfStatus == 0) {
// u.defaultUsers.immutable = ids; //启用
// u.userIds = this.$u.clone(ids); let url = `${workflowUrl}/schema/intend`;
// } else { this.$api.get(url, { schemaId: v }).then(r => {
// u.userIds = [this.currentUserId]; if (r.success) {
// } // console.warn("VVVV",r)
// }); r.result.nodes.map((u, i) => {
// this.dataImmut = r.result.nodes; if (i > 0) {
// this.processTitle = r.result.name; let ids = u.defaultUsers.immutable.concat(
// // if (this.dataImmut.length >= 1) { u.defaultUsers.mutable
// // this.immutData = this.dataImmut[1].defaultUsers.immutable );
// // } u.defaultUsers.immutable = ids;
// this.userIds(); u.userIds = this.$u.clone(ids);
// } } else {
// }); u.userIds = [this.currentUserId];
}
});
this.dataImmut = r.result.nodes;
this.processTitle = r.result.name;
// if (this.dataImmut.length >= 1) {
// this.immutData = this.dataImmut[1].defaultUsers.immutable
// }
this.userIds();
}
});
}
// else {
// this.$Message.error("流程未启用");
// }
} else {
this.$Message.error("操作失败");
}
});
}, },
userIds() { userIds() {
var ids = []; var ids = [];
......
...@@ -171,10 +171,25 @@ export default { ...@@ -171,10 +171,25 @@ export default {
} }
] ]
}, },
disabled: false disabled: false,
wfstatu: 1
}; };
}, },
mounted() { mounted() {
let params = {
id: "123327da-42b3-41f6-b785-cf933f137a95"
};
this.$api.get(`${workflowUrl}/schema/getbyid`, params).then(res => {
if (res.success) {
let wfStatus = res.result.status;
if (wfStatus == 0) {
this.wfstatu = 1;
} else {
this.wfstatu = 3;
}
}
});
this.loadTree(); this.loadTree();
}, },
methods: { methods: {
...@@ -182,7 +197,7 @@ export default { ...@@ -182,7 +197,7 @@ export default {
this.$refs.formValidate.validate(v => { this.$refs.formValidate.validate(v => {
if (v) { if (v) {
this.disabled = true; this.disabled = true;
this.orderSearchForm.status = 1; this.orderSearchForm.status = this.wfstatu;
Api.mesplancreate(this.orderSearchForm) Api.mesplancreate(this.orderSearchForm)
.then(r => { .then(r => {
this.disabled = false; this.disabled = false;
......
...@@ -147,7 +147,8 @@ export default { ...@@ -147,7 +147,8 @@ export default {
}, },
placeholdeinfo: "", placeholdeinfo: "",
list: [], list: [],
data1: [] data1: [],
wfstatu: 1
}; };
}, },
props: { props: {
...@@ -159,6 +160,19 @@ export default { ...@@ -159,6 +160,19 @@ export default {
} }
}, },
mounted() { mounted() {
let params = {
id: "123327da-42b3-41f6-b785-cf933f137a95"
};
this.$api.get(`${workflowUrl}/schema/getbyid`, params).then(res => {
if (res.success) {
let wfStatus = res.result.status;
if (wfStatus == 0) {
this.wfstatu = 1;
} else {
this.wfstatu = 3;
}
}
});
this.loadTree(); this.loadTree();
}, },
methods: { methods: {
...@@ -172,7 +186,7 @@ export default { ...@@ -172,7 +186,7 @@ export default {
this.$refs.formValidate.validate(v => { this.$refs.formValidate.validate(v => {
if (v) { if (v) {
this.disabled = true; this.disabled = true;
this.orderSearchForm.status = 1; this.orderSearchForm.status = this.wfstatu;
Api.mesorderupdate(this.orderSearchForm) Api.mesorderupdate(this.orderSearchForm)
.then(r => { .then(r => {
this.disabled = false; this.disabled = false;
......
This diff is collapsed.
<template> <template>
<div style="width:100%;margin:0 auto"> <div style="width:100%;margin:0 auto">
<Detail ref="detailRow" :row="row1" v-show="dataList.length==1"></Detail> <Table border :columns="columns1" :data="dataList" class="tableCommon" :height="tbHeight"></Table>
<Table
border
:columns="columns1"
:data="dataList"
class="tableCommon"
v-show="dataList.length>1"
:height="tbHeight"
></Table>
<div style="width100%;margin:40px auto"> <div style="width100%;margin:40px auto">
<Form <Row>
:model="orderForm" <Process ref="userProcess" schemaIdVal="123327da-42b3-41f6-b785-cf933f137a95" />
:label-width="110" </Row>
class="margin-top-20 margin-bottom-50"
:rules="ruleValidate"
ref="formValidate"
>
<Row>
<Col span="6">
<FormItem label="生产车间" style="width:100%" prop="ProductingPreparationPeople">
<WorkShopSelect ref="userSelected" v-model="orderForm.ProductingPreparationPeople" />
</FormItem>
</Col>
<Col span="6">
<FormItem label="完成时间" style="width:100%" prop="ProductingPreparationFinishDate">
<DatePicker
v-model="orderForm.ProductingPreparationFinishDate"
type="date"
placeholder="请选择日期"
@on-change="getTimeProductPFD"
></DatePicker>
</FormItem>
</Col>
<Col span="6">
<FormItem label="订单报价人员" style="width:100%" prop="QuotationPeople">
<UserSelect ref="userSelected" v-model="orderForm.QuotationPeople" />
</FormItem>
</Col>
<Col span="6">
<FormItem label="完成时间" style="width:100%" prop="QuotationFinishDate">
<DatePicker
v-model="orderForm.QuotationFinishDate"
type="date"
placeholder="请选择日期"
@on-change="getTimeQuotationFD"
></DatePicker>
</FormItem>
</Col>
</Row>
</Form>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import Detail from "./detail"; import Detail from "./detail";
import Process from "@/components/orderOperator/process";
var myDate = new Date(); var myDate = new Date();
export default { export default {
name: "send", name: "send",
components: { components: {
Detail Detail,
Process
}, },
data() { data() {
return { return {
...@@ -146,7 +103,7 @@ export default { ...@@ -146,7 +103,7 @@ export default {
}, },
rowList: [], rowList: [],
row1: {}, row1: {},
tbHeight: 0 tbHeight: 0,
}; };
}, },
props: { props: {
...@@ -167,46 +124,17 @@ export default { ...@@ -167,46 +124,17 @@ export default {
//返回审批数据 //返回审批数据
return objStr; return objStr;
}, },
getTimeProductPFD(value) { getUsers() {
this.orderForm.ProductingPreparationFinishDate = this.getFormatDateEnd( let ues = this.$refs.userProcess;
value return ues.immutData;
);
},
getTimeQuotationFD(value) {
this.orderForm.QuotationFinishDate = this.getFormatDateEnd(value);
},
getFormatDateEnd(dates) {
const d = new Date(dates);
const resDate =
d.getFullYear() +
"-" +
this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate()) +
" 23:59:59";
return resDate;
},
p(s) {
return s < 10 ? "0" + s : s;
}, },
l(key) { l(key) {
let vkey = "mes_plan" + "." + key; let vkey = "mes_plan" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
} }
}, },
created() { created() {},
//var theight = window.innerHeight - 400 + "px"; mounted() {},
// this.divHeight = theight;
},
mounted() {
// window.onresize = () => {
// ///浏览器窗口大小变化
// return (() => {
// window.screenHeight = window.innerHeight;
// this.divHeight = window.screenHeight - 400 + "px";
// })();
// };
},
watch: { watch: {
row(v) { row(v) {
if (v != []) { if (v != []) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment