Commit 4d15583d authored by renjintao's avatar renjintao

process

parent 7266e7cd
...@@ -4,25 +4,29 @@ ...@@ -4,25 +4,29 @@
<Divider /> <Divider />
<Timeline> <Timeline>
<div> <div>
<TimelineItem v-for="(item, index) in dataImmut" :key="index"> <TimelineItem v-for="(item, index) in dataImmut" :key="index">
<Badge :count="index + 1" slot="dot" :type="index==cur?'primary':'normal'"></Badge> <Badge :count="index + 1" slot="dot" :type="index==cur?'primary':'normal'"></Badge>
<p class="time">{{ item.name }} <p class="time">
&nbsp;(<state code="workflow.form.audit.type" :value="item.operation" />) {{ item.name }}
<Icon v-if="item.isFixed" type="ios-lock"/> &nbsp;(
<state code="workflow.form.audit.type" :value="item.operation" />)
<Icon v-if="item.isFixed" type="ios-lock" />
</p> </p>
<p class="content" v-if="index==0"> <p class="content" v-if="index==0">
发起人: <User :value="currentUserId" /> 发起人:
<User :value="currentUserId" />
</p> </p>
<p class="content" v-else> <p class="content" v-else>
<span>审批人:</span> <span>审批人:</span>
<CheckboxGroup v-model="item.userIds" @on-change="userIds"> <CheckboxGroup v-model="item.userIds" @on-change="userIds">
<Checkbox v-for="(item1, index1) in item.defaultUsers.immutable" <Checkbox
:key="index1" :label="item1" :disabled="item.isFixed"> v-for="(item1, index1) in item.defaultUsers.immutable"
<User :key="index1"
:value="item1" :label="item1"
style="margin-right:5px;" :disabled="item.isFixed"
/> >
</Checkbox> <User :value="item1" style="margin-right:5px;" />
</Checkbox>
</CheckboxGroup> </CheckboxGroup>
</p> </p>
<!-- <p class="content" v-else> <!-- <p class="content" v-else>
...@@ -31,7 +35,7 @@ ...@@ -31,7 +35,7 @@
:value="item1" :value="item1"
style="margin-right:5px;" style="margin-right:5px;"
/> />
</p> --> </p>-->
</TimelineItem> </TimelineItem>
</div> </div>
</Timeline> </Timeline>
...@@ -39,81 +43,81 @@ ...@@ -39,81 +43,81 @@
</template> </template>
<script> <script>
export default { export default {
name: 'process', name: "process",
components: {}, components: {},
data() { data() {
return { return {
currentUserId: 0, currentUserId: 0,
processTitle: '审批流程', processTitle: "审批流程",
dataImmut: [], dataImmut: [],
dataMut: [], dataMut: [],
cur:0, cur: 0,
immutData: [], immutData: [],
ids:[], ids: [],
schemaId: '' schemaId: ""
} };
}, },
props: { props: {
schemaIdVal: { schemaIdVal: {
type: String, type: String,
default: '' default: ""
} }
}, },
created() { created() {
this.currentUserId=this.$store.state.userInfo.userId this.currentUserId = this.$store.state.userInfo.userId;
this.load(this.schemaIdVal) this.load(this.schemaIdVal);
}, },
methods: { methods: {
load(v) { load(v) {
this.dataImmut = [] this.dataImmut = [];
this.dataMut = [] this.dataMut = [];
let url = `${workflowUrl}/schema/intend` let url = `${workflowUrl}/schema/intend`;
this.$api.get(url, { schemaId: v }).then((r) => { // this.$api.get(url, { schemaId: v }).then(r => {
if (r.success) { // if (r.success) {
// console.warn("VVVV",r) // // console.warn("VVVV",r)
r.result.nodes.map((u,i)=>{ // r.result.nodes.map((u, i) => {
if(i>0){ // if (i > 0) {
let ids=u.defaultUsers.immutable.concat(u.defaultUsers.mutable) // let ids = u.defaultUsers.immutable.concat(u.defaultUsers.mutable);
u.defaultUsers.immutable=ids; // u.defaultUsers.immutable = ids;
u.userIds=this.$u.clone(ids); // u.userIds = this.$u.clone(ids);
}else{ // } else {
u.userIds=[this.currentUserId] // u.userIds = [this.currentUserId];
} // }
}) // });
this.dataImmut = r.result.nodes // this.dataImmut = r.result.nodes;
this.processTitle = r.result.name // this.processTitle = r.result.name;
// if (this.dataImmut.length >= 1) { // // if (this.dataImmut.length >= 1) {
// this.immutData = this.dataImmut[1].defaultUsers.immutable // // this.immutData = this.dataImmut[1].defaultUsers.immutable
// } // // }
this.userIds(); // this.userIds();
} // }
}) // });
}, },
userIds(){ userIds() {
var ids=[]; var ids = [];
this.dataImmut.map((u,i)=>{ this.dataImmut.map((u, i) => {
ids.push({ ids.push({
id:u.id, id: u.id,
userIds:u.userIds userIds: u.userIds
}) });
}) });
this.immutData=ids; this.immutData = ids;
// console.warn(ids); // console.warn(ids);
}, },
l(key) { l(key) {
key = 'orderInfo' + '.' + key key = "orderInfo" + "." + key;
return this.$t(key) return this.$t(key);
} }
}, },
computed: {}, computed: {},
watch: { watch: {
schemaIdVal(v) { schemaIdVal(v) {
if (v) { if (v) {
this.load(v) this.load(v);
} }
} }
} }
} };
</script> </script>
<style scoped></style> <style scoped></style>
<template>
<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"
v-show="dataList.length>1"
:height="tbHeight"
></Table>
<div style="width100%;margin:40px auto">
<Form
:model="orderForm"
:label-width="110"
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>
</template>
<script>
import Detail from "./detail";
var myDate = new Date();
export default {
name: "send",
components: {
Detail
},
data() {
return {
divHeight: "400px",
roleTitle: "工艺员",
orderForm: {
ProductingPreparationPeople: null, //生产准备
ProductingPreparationFinishDate: "", //生产准备完成时间
QuotationPeople: null, //订单报价人员
QuotationFinishDate: "" //订单报价完成时间
},
columns1: [
{
title: this.l("mesCode"),
key: "mesCode",
width: 180,
tooltip: true
},
{
title: this.l("productName"),
key: "productName",
tooltip: true
},
{
key: "drawnNumber",
title: this.l("drawnNumber"),
align: "center",
width: 140
},
{
title: this.l("projectNumber"),
key: "projectNumber",
width: 140
},
{
title: this.l("batchNumber"),
key: "batchNumber",
width: 120,
tooltip: true
},
{
title: this.l("quantity"),
key: "quantity",
align: "right",
width: 70
}
],
dataList: [],
row1: {},
dataListRetrun: [], //确定后返回数据
ruleValidate: {
ProductingPreparationPeople: [
{
required: true,
message: "请选择人员",
trigger: "change",
type: "number"
}
],
ProductingPreparationFinishDate: [
{
required: true,
message: "请选择时间",
trigger: "change"
}
],
QuotationPeople: [
{
required: true,
message: "请选择人员",
trigger: "change",
type: "number"
}
],
QuotationFinishDate: [
{
required: true,
message: "请选择时间",
trigger: "change"
}
]
},
rowList: [],
row1: {},
tbHeight: 0
};
},
props: {
row: {
type: Array,
default: () => {
return [];
}
}
},
methods: {
returnData() {
let objStr = {};
objStr.ProductingPreparationPeople = this.orderForm.ProductingPreparationPeople;
objStr.ProductingPreparationFinishDate = this.orderForm.ProductingPreparationFinishDate;
objStr.QuotationPeople = this.orderForm.QuotationPeople;
objStr.QuotationFinishDate = this.orderForm.QuotationFinishDate;
//返回审批数据
return objStr;
},
getTimeProductPFD(value) {
this.orderForm.ProductingPreparationFinishDate = this.getFormatDateEnd(
value
);
},
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) {
let vkey = "mes_plan" + "." + key;
return this.$t(vkey) || key;
}
},
created() {
//var theight = window.innerHeight - 400 + "px";
// this.divHeight = theight;
},
mounted() {
// window.onresize = () => {
// ///浏览器窗口大小变化
// return (() => {
// window.screenHeight = window.innerHeight;
// this.divHeight = window.screenHeight - 400 + "px";
// })();
// };
},
watch: {
row(v) {
if (v != []) {
this.dataList = this.$u.clone(this.row);
this.row1 = this.dataList[0];
this.tbHeight = 0;
if (this.dataList.length > 3) {
this.tbHeight = 200;
}
}
}
}
};
</script>
\ No newline at end of file
...@@ -155,6 +155,7 @@ ...@@ -155,6 +155,7 @@
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import ApiWorkflow from "../workflow/process/api";
import iQuill from "@/components/quill"; import iQuill from "@/components/quill";
export default { export default {
name: "Add", name: "Add",
...@@ -172,7 +173,7 @@ export default { ...@@ -172,7 +173,7 @@ export default {
code: "", code: "",
productId: null, productId: null,
productName: "", productName: "",
productBomId:null, productBomId: null,
version: "", version: "",
author: null, author: null,
departmentId: null, departmentId: null,
...@@ -182,7 +183,7 @@ export default { ...@@ -182,7 +183,7 @@ export default {
upDetailId: null, upDetailId: null,
routingType: null, routingType: null,
status: 0, status: 0,
approvalStatus: 0, approvalStatus: 4,
remark: "", remark: "",
approvalStatusRemark: "", approvalStatusRemark: "",
auditUserId1: "", auditUserId1: "",
...@@ -243,19 +244,37 @@ export default { ...@@ -243,19 +244,37 @@ export default {
} else { } else {
this.entity.fileId = ""; this.entity.fileId = "";
} }
Api.create(this.entity) ApiWorkflow.getbyid({
.then(r => { id: "2085025d-9c38-4834-846a-8f9d2f4c8553"
this.disabled = false; })
if (r.success) { .then(res => {
this.$Message.success("保存成功"); if (res.success) {
this.$emit("on-ok"); let wfStatus = res.result.status;
} else { if (wfStatus == 0) {
this.$Message.error("保存失败"); this.entity.approvalStatus = 4;
} else {
this.entity.approvalStatus = 1;
}
Api.create(this.entity)
.then(r => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch(err => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
} }
}) })
.catch(err => { .catch(err => {
this.disabled = false; this.disabled = false;
this.$Message.error("保存失败"); this.$Message.error("操作失败");
console.warn(err); console.warn(err);
}); });
} }
......
...@@ -127,11 +127,12 @@ ...@@ -127,11 +127,12 @@
</Col> </Col>
</Row> </Row>
</Form> </Form>
<changeSendReview ref="changeSendReview" @on-ok="ok"></changeSendReview> <changeSendReview ref="changeSendReview" @on-ok="ok"></changeSendReview>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import ApiWorkflow from "../../../workflow/process/api";
import iQuill from "@/components/quill"; import iQuill from "@/components/quill";
import changeSendReview from "./changeSendReview.vue"; import changeSendReview from "./changeSendReview.vue";
export default { export default {
...@@ -197,6 +198,27 @@ export default { ...@@ -197,6 +198,27 @@ export default {
.cathc(err => { .cathc(err => {
this.$Message.error("数据连接错误"); this.$Message.error("数据连接错误");
}); });
ApiWorkflow.getbyid({
id: "d0cdafe3-2341-4499-a4f5-278ef0f30740"
})
.then(res1 => {
alret(JSON.stringify(res1))
if (res1.success) {
let wfStatus = res1.result.status;
if (wfStatus == 0) {
this.submitShow = true;
// this.entity.approvalStatus = 4;
} else {
// this.entity.approvalStatus = 1;
this.submitShow = false;
}
}
})
.catch(err => {
this.$Message.error("操作失败");
console.warn(err);
});
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate(v => { this.$refs.form.validate(v => {
...@@ -291,9 +313,8 @@ export default { ...@@ -291,9 +313,8 @@ export default {
this.entity.departmentId = v; this.entity.departmentId = v;
this.entity.departmentName = items.name; this.entity.departmentName = items.name;
}, },
ok() ok() {
{ this.$emit("on-ok");
this.$emit("on-ok")
}, },
l(key) { l(key) {
key = "routing_header_changeorder" + "." + key; key = "routing_header_changeorder" + "." + key;
......
...@@ -33,4 +33,7 @@ export default { ...@@ -33,4 +33,7 @@ export default {
updateNode(params) { //流程设计编辑保存 updateNode(params) { //流程设计编辑保存
return Api.post(`${workflowUrl}/node/update`, params); return Api.post(`${workflowUrl}/node/update`, params);
}, },
getbyid(params) {//根据shemaId获取详细详细
return Api.get(`${workflowUrl}/schema/getbyid`, params); //流程
},
} }
\ No newline at end of file
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