Commit 4d15583d authored by renjintao's avatar renjintao

process

parent 7266e7cd
......@@ -4,25 +4,29 @@
<Divider />
<Timeline>
<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>
<p class="time">{{ item.name }}
&nbsp;(<state code="workflow.form.audit.type" :value="item.operation" />)
<Icon v-if="item.isFixed" type="ios-lock"/>
<p class="time">
{{ item.name }}
&nbsp;(
<state code="workflow.form.audit.type" :value="item.operation" />)
<Icon v-if="item.isFixed" type="ios-lock" />
</p>
<p class="content" v-if="index==0">
发起人: <User :value="currentUserId" />
发起人:
<User :value="currentUserId" />
</p>
<p class="content" v-else>
<span>审批人:</span>
<CheckboxGroup v-model="item.userIds" @on-change="userIds">
<Checkbox v-for="(item1, index1) in item.defaultUsers.immutable"
:key="index1" :label="item1" :disabled="item.isFixed">
<User
:value="item1"
style="margin-right:5px;"
/>
</Checkbox>
<Checkbox
v-for="(item1, index1) in item.defaultUsers.immutable"
:key="index1"
:label="item1"
:disabled="item.isFixed"
>
<User :value="item1" style="margin-right:5px;" />
</Checkbox>
</CheckboxGroup>
</p>
<!-- <p class="content" v-else>
......@@ -31,7 +35,7 @@
:value="item1"
style="margin-right:5px;"
/>
</p> -->
</p>-->
</TimelineItem>
</div>
</Timeline>
......@@ -39,81 +43,81 @@
</template>
<script>
export default {
name: 'process',
name: "process",
components: {},
data() {
return {
currentUserId: 0,
processTitle: '审批流程',
processTitle: "审批流程",
dataImmut: [],
dataMut: [],
cur:0,
cur: 0,
immutData: [],
ids:[],
schemaId: ''
}
ids: [],
schemaId: ""
};
},
props: {
schemaIdVal: {
type: String,
default: ''
default: ""
}
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.load(this.schemaIdVal)
this.currentUserId = this.$store.state.userInfo.userId;
this.load(this.schemaIdVal);
},
methods: {
load(v) {
this.dataImmut = []
this.dataMut = []
let url = `${workflowUrl}/schema/intend`
this.dataImmut = [];
this.dataMut = [];
let url = `${workflowUrl}/schema/intend`;
this.$api.get(url, { schemaId: v }).then((r) => {
if (r.success) {
// console.warn("VVVV",r)
r.result.nodes.map((u,i)=>{
if(i>0){
let ids=u.defaultUsers.immutable.concat(u.defaultUsers.mutable)
u.defaultUsers.immutable=ids;
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();
}
})
// this.$api.get(url, { schemaId: v }).then(r => {
// if (r.success) {
// // console.warn("VVVV",r)
// r.result.nodes.map((u, i) => {
// if (i > 0) {
// let ids = u.defaultUsers.immutable.concat(u.defaultUsers.mutable);
// u.defaultUsers.immutable = ids;
// 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();
// }
// });
},
userIds(){
var ids=[];
this.dataImmut.map((u,i)=>{
ids.push({
id:u.id,
userIds:u.userIds
})
})
this.immutData=ids;
userIds() {
var ids = [];
this.dataImmut.map((u, i) => {
ids.push({
id: u.id,
userIds: u.userIds
});
});
this.immutData = ids;
// console.warn(ids);
},
l(key) {
key = 'orderInfo' + '.' + key
return this.$t(key)
key = "orderInfo" + "." + key;
return this.$t(key);
}
},
computed: {},
watch: {
schemaIdVal(v) {
if (v) {
this.load(v)
this.load(v);
}
}
}
}
};
</script>
<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 @@
</template>
<script>
import Api from "./api";
import ApiWorkflow from "../workflow/process/api";
import iQuill from "@/components/quill";
export default {
name: "Add",
......@@ -172,7 +173,7 @@ export default {
code: "",
productId: null,
productName: "",
productBomId:null,
productBomId: null,
version: "",
author: null,
departmentId: null,
......@@ -182,7 +183,7 @@ export default {
upDetailId: null,
routingType: null,
status: 0,
approvalStatus: 0,
approvalStatus: 4,
remark: "",
approvalStatusRemark: "",
auditUserId1: "",
......@@ -243,19 +244,37 @@ export default {
} else {
this.entity.fileId = "";
}
Api.create(this.entity)
.then(r => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
ApiWorkflow.getbyid({
id: "2085025d-9c38-4834-846a-8f9d2f4c8553"
})
.then(res => {
if (res.success) {
let wfStatus = res.result.status;
if (wfStatus == 0) {
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 => {
this.disabled = false;
this.$Message.error("保存失败");
this.$Message.error("操作失败");
console.warn(err);
});
}
......
......@@ -127,11 +127,12 @@
</Col>
</Row>
</Form>
<changeSendReview ref="changeSendReview" @on-ok="ok"></changeSendReview>
<changeSendReview ref="changeSendReview" @on-ok="ok"></changeSendReview>
</div>
</template>
<script>
import Api from "./api";
import ApiWorkflow from "../../../workflow/process/api";
import iQuill from "@/components/quill";
import changeSendReview from "./changeSendReview.vue";
export default {
......@@ -197,6 +198,27 @@ export default {
.cathc(err => {
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() {
this.$refs.form.validate(v => {
......@@ -291,9 +313,8 @@ export default {
this.entity.departmentId = v;
this.entity.departmentName = items.name;
},
ok()
{
this.$emit("on-ok")
ok() {
this.$emit("on-ok");
},
l(key) {
key = "routing_header_changeorder" + "." + key;
......
......@@ -33,4 +33,7 @@ export default {
updateNode(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