Commit a9654517 authored by renjintao's avatar renjintao

ordersend

parent f978979b
......@@ -304,6 +304,9 @@ export default {
},
getTimeQuotationFD(value) {
this.orderForm.QuotationFinishDate = value;
},
p(s) {
return s < 10 ? "0" + s : s;
}
},
created() {
......
......@@ -35,6 +35,9 @@ export default {
pauseCauseGetpaged(params){//获取工单暂停记录
return Api.get(`${PlanUrl}/orderexecutepausecause/getpaged`, params);
},
orderrecovery(params) {//订单回收
return Api.post(`${PlanUrl}/mesorders/orderrecovery`, params);
},
// getplantdepartments(params) {// 组织为”车间“的部门
// return Api.get(`${systemUrl}/department/getplantdepartments`, params);
......
......@@ -30,6 +30,29 @@
<Modal v-model="SpeedModal" title="工单信息" fullscreen footer-hide class="recordM">
<Speed :result="result" :load="loading" :executeId="dispatchExecuteId" :orderId="orderId" />
</Modal>
<Modal v-model="recycleModal" title="确定回收订单" width="600" class="suspend">
<Form ref="form" :model="recovery" :rules="rulesRecycle" :label-width="120">
<Row>
<Col :span="24">
<FormItem :label="l('mesCode')">{{mesCode}}</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('demandFinishDate')" prop="demandFinishDate">
<DatePicker
type="date"
placeholder="请选择日期"
style="width:240px"
v-model="recovery.demandFinishDate"
></DatePicker>
</FormItem>
</Col>
</Row>
</Form>
<div slot="footer">
<Button @click="cancelRecycle">取消</Button>
<Button type="primary" @click="changeFinishiDate">确定</Button>
</div>
</Modal>
</div>
</template>
<script>
......@@ -50,8 +73,8 @@ export default {
data() {
return {
result: [],
dispatchExecuteId:null,//任务id
orderId:null,//订单id
dispatchExecuteId: null, //任务id
orderId: null, //订单id
SpeedModal: false,
rowSuspend: {},
recordId: 0,
......@@ -64,6 +87,7 @@ export default {
suspendModal: false,
recordModal: false,
deletelModal: false,
recycleModal: false,
curId: 0,
columns: [
{ key: "id", title: this.l("id"), hide: true, align: "left" },
......@@ -175,7 +199,7 @@ export default {
title: this.l("productName"),
align: "left",
easy: true,
high: true,
high: true
},
{
......@@ -245,7 +269,7 @@ export default {
code: "mes_xingchi_plan.order_material.routingType",
easy: true,
high: true,
width: 100,
width: 100
},
{
title: this.l("jindu"),
......@@ -334,7 +358,7 @@ export default {
key: "remark",
title: this.l("remark"),
align: "center",
hide:true
hide: true
},
{
title: "暂停记录",
......@@ -362,7 +386,9 @@ export default {
render: (h, params) => {
return h("div", { class: "action" }, [
h(
params.row.status == 5&&params.row.upSplitId==0 ? "Button" : "", //订单状态暂停,启动
params.row.status == 5 && params.row.upSplitId == 0
? "Button"
: "", //订单状态暂停,启动
{
props: {
type: "error",
......@@ -385,13 +411,16 @@ export default {
""
),
h(
params.row.status == 6&&params.row.upSplitId==0 ? "Button" : "", //订单状态执行中,暂停
params.row.status == 6 && params.row.upSplitId == 0
? "Button"
: "", //订单状态执行中,暂停
{
props: {
type: "success",
size: "small",
icon: "ios-pause",
ghost: true
ghost: true,
tooltip: "暂停"
},
style: {
fontSize: "18px",
......@@ -406,12 +435,44 @@ export default {
}
},
""
),
h(
params.row.status == 5 && params.row.upSplitId > 0 ? "op" : "", //订单状态执行中,暂停
{
attrs: {
icon: "md-sync",
type: "icon",
title: "回收订单",
oprate: "edit",
msg: "确认要恢复工序吗?"
},
on: {
click: () => {
this.recycle(params.row);
}
}
}
)
]);
}
}
],
loading: false
loading: false,
recovery: {
orderId: null,
demandFinishDate: "" //计划完成时间
},
mesCode: "",
rulesRecycle: {
demandFinishDate: [
{
required: true,
message: "请选择计划完成时间",
trigger: "change",
type: "date"
}
]
}
};
},
mounted() {},
......@@ -438,17 +499,19 @@ export default {
this.result = [];
this.loading = true;
this.SpeedModal = true;
this.dispatchExecuteId=row.dispatchExecuteId
this.orderId=row.id
this.dispatchExecuteId = row.dispatchExecuteId;
this.orderId = row.id;
Api.info({
routingHeaderId: row.routingHeaderId,
dispatchExecuteId: row.dispatchExecuteId
}).then(r => {
})
.then(r => {
if (r.success) {
this.result = r.result;
this.loading = false;
}
}).catch(err=>{
})
.catch(err => {
this.$Message.error("连接错误");
});
}
......@@ -499,6 +562,53 @@ export default {
}
});
},
recycle(row) {
//回收订单
this.recycleModal = true;
this.mesCode = row.mesCode;
this.recovery = {
orderId: row.id,
demandFinishDate: row.demandFinishDate
};
},
changeFinishiDate() {
let temTime = this.recovery.demandFinishDate;
this.recovery.demandFinishDate = "";
this.recovery.demandFinishDate = this.getFormatDateEnd(temTime);
Api.orderrecovery(this.recovery)
.then(res => {
if (res.success) {
this.$Message.success("回收成功");
this.$refs.grid.reload(this.easySearch);
this.recycleModal = false;
}
})
.catch(err => {
this.$Message.error("数据连接错误");
});
},
cancelRecycle() {
this.mesCode = "";
this.recovery = {
orderId: null,
demandFinishDate: "" //计划完成时间
};
this.recycleModal = false;
},
getFinishedDate(value) {
this.recovery.demandFinishDate = 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;
},
//截取字符串
sliceStr(str, lenS, lenE) {
return str.slice(lenS, lenE);
......@@ -507,6 +617,9 @@ export default {
this.curId = 0;
this.suspendModal = false;
},
p(s) {
return Number(s) < 10 ? "0" + s : s;
},
l(key) {
let vkey = "mes_order_watch" + "." + key;
return this.$t(vkey) || key;
......
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