Commit 5d5bcee3 authored by renjintao's avatar renjintao

execute

parent 059cf8b3
......@@ -46,6 +46,7 @@
@on-drag-drop="onDragDrop"
@on-selection-change="selectionChange"
@on-select="onSelect"
:row-key="rowKey"
></Table>
</div>
<div class="table-footer">
......@@ -225,6 +226,10 @@ export default {
span: {//栅格数
type: Number,
default: 24
},
//table控件children子数据控制功能
rowKey: {
type: [String, Number]
},
gutter:{//间距
type:Number,
......
......@@ -32,7 +32,7 @@
@on-selection-change="onSelect"
:batch="true"
:border="false"
:rowKey="id"
rowKey="id"
>
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
......
......@@ -13,4 +13,17 @@ export default {
orderanddispatchinfos(params) {
return Api.get(`${PlanUrl}/orderexecutenew/orderanddispatchinfos`, params);
},
//工单开工
entrystart(params) {
return Api.post(`${PlanUrl}/orderexecute/entrystart`, params);
},
//工单暂停
entrypause(params) {
return Api.post(`${PlanUrl}/orderexecute/entrypause`, params);
},
//工单继续
entrentrycontinuestart(params) {
return Api.post(`${PlanUrl}/orderexecute/entrycontinue`, params);
},
}
\ No newline at end of file
<template>
<div class="order_list">
<div class="card_box">
<Card class="card_order" v-for="(item,index) in listTasks"
@click.native="goPage(item)" :key="index"
:class="item.status==12 ? 'card_border1' : (item.status==14 ? 'card_border2': (item.status==5 ?'card_border3':
<div class="order_list">
<div class="card_box">
<Card
class="card_order"
v-for="(item,index) in listTasks"
:style="order==item.id?'box-shadow: 0px 0px 15px #333;':''"
@click.native="goPage(item)"
:key="index"
:class="item.status==12 ? 'card_border1' : (item.status==14 ? 'card_border2': (item.status==5 ?'card_border3':
(item.status==7?'card_border4':(item.status==-1?'card_border5':''))))"
>
<!-- :class="item.status=='未开工'? 'card_border1' : (item.status=='执行中' ? 'card_border2': (item.status=='暂停中' ?'card_border3':
(item.status=='交检中'?'card_border4':(item.status=='交接中'?'card_border5':''))))" -->
<p slot="title">{{item.mesCode}}
<state
code="taskList.status"
ref="state" class="fr"
:value="item.status"
type="text"
></state>
<!-- <span >{{item.status}}</span> -->
</p>
<p class="order_tit">{{item.productName}}</p>
<p><Icon type="ios-pricetags" />{{item.taskName}}</p>
<p>{{item.beginTime}}~{{item.endTime}}</p>
</Card>
<p>{{listTasks.length}} 个工单</p>
</div>
>
<!-- :class="item.status=='未开工'? 'card_border1' : (item.status=='执行中' ? 'card_border2': (item.status=='暂停中' ?'card_border3':
(item.status=='交检中'?'card_border4':(item.status=='交接中'?'card_border5':''))))"-->
<p slot="title">
{{item.mesCode}}
<state code="taskList.status" ref="state" class="fr" :value="item.status" type="text"></state>
<!-- <span >{{item.status}}</span> -->
</p>
<p class="order_tit">{{item.productName}}</p>
<p>
<Icon type="ios-pricetags" />
{{item.taskName}}
</p>
<p>{{item.beginTime}}~{{item.endTime}}</p>
</Card>
<p>{{listTasks.length}} 个工单</p>
</div>
</div>
</template>
<script>
import Api from "../../api";
export default {
name:'orderlist',
data(){
return{
gnFlag:0,
listTasks:[],
dataLength:0,
}
name: "orderlist",
data() {
return {
gnFlag: 0,
listTasks: [],
dataLength: 0
};
},
props: {
order: {
type: String,
default: '',
}
},
created() {
this.loadTree(-9);
},
methods: {
loadTree(value) {
let parmse = {
status: value,
isAsc: true
};
Api.getCardList(parmse).then(res => {
if (res.success) {
this.listTasks = res.result;
this.dataLength = res.result.length;
}
});
},
created() {
this.loadTree(-9);
gnFunto(number, type) {
this.gnFlag = number;
},
methods: {
loadTree(value){
let parmse = {
status: value,
isAsc: true
}
Api.getCardList(parmse).then(res=>{
if(res.success){
this.listTasks = res.result
this.dataLength = res.result.length
}
})
},
gnFunto(number,type){
this.gnFlag = number
},
goPage(item){
console.log(item)
this.$Message.success("工单查询数据...")
},
},
watch:{
},
}
goPage(item) {
this.$router.push({
path: "/produce/execute",
query: {
id: item.id,
orderId: item.orderId,
executeId: item.executeId,
headid: item.routingHeaderId,
dispatchStatus: item.status
}
});
}
},
watch: {
order(v)
{
//alert(v)
}
}
};
</script>
\ No newline at end of file
......@@ -25,7 +25,7 @@
</div>
</div>
<!-- 列表卡片主内容 -->
<orderlist ref="orderlist" />
<orderlist ref="orderlist" :order="inputId" />
</Drawer>
<!-- 功能区 -->
<Drawer
......@@ -56,8 +56,9 @@ export default {
detail: null,
row:{},
odermodel: -9,
orderId: null,
condition: []
orderId: this.$route.query.id,
condition: [],
inputId: null,
};
},
created() {
......@@ -66,6 +67,7 @@ export default {
row.orderId = this.$route.query.orderId;
row.executeId = this.$route.query.executeId;
this.row=row
this.inputId=this.$route.query.id
this.detail = () => import("./starOrder/index");
},
async fetch({ store, params }) {
......@@ -120,6 +122,14 @@ export default {
} //测试数据
}
},
watch: {}
watch: {
'$route.query.id'(v)
{
this.row.id = v
this.inputId=v
this.detail = () => import("./starOrder/index")
},
}
};
</script>
<template>
<div class>
<div class="star" v-if="!starmodal">
<div class="star" v-if="dispatchStatus==12">
<a class="start" @click="starFun">
<Icon type="md-play" />开工
</a>
</div>
<div class="star" v-else-if="starmodal">
<div class="star" v-else>
<div class="flex fc-b">
<Button class="button" size="large" type="primary">
<Icon type="ios-pause" />暂停
<Button class="button" size="large" type="primary" @click="pauseFun" v-show="btnTextStatus">
<Icon type="ios-pause" />
{{btnText}}
</Button>
<Button class="button" size="large" type="primary">
<Icon type="logo-angular" />交检
<Button class="button" size="large" type="primary" @click="goPage(8,'数据填报')">
<Icon type="logo-angular" />数据填报
</Button>
<Button class="button" size="large" type="primary">
<Icon type="ios-checkmark-circle-outline" />完工
<Button class="button" size="large" type="primary" @click="goPage(7,'质量判定')">
<Icon type="ios-checkmark-circle-outline" />质量判定
</Button>
<Button class="button" size="large" type="primary" @click="transferFn">
<Icon type="md-swap" />转序交接
</Button>
</div>
<div class="star_step">
<div class="star_step" v-if="false">
<div class="step_item" v-for="i of 6" :key="i">
<p class="icon_A" v-if="i>=4">
<Icon type="md-checkmark-circle" />
......@@ -50,7 +51,10 @@
<ul>
<li>产品名称:{{entity.productName}}</li>
<li>图号:{{entity.drawnNumber}}</li>
<li>状态:{{entity.status}}</li>
<li>
状态:
<state code="plan.order.status" ref="state" :value="entity.status" type="text"></state>
</li>
<li>订单编号:{{entity.mesCode}}</li>
<li>批次号:{{entity.batchNumber}}</li>
<li>计划数量:{{entity.quantity}}</li>
......@@ -64,13 +68,14 @@
<li>派工数量:{{entity.dispatchQuantity}}</li>
<li>人员信息:{{entity.userNames}}</li>
<li>准备工时:{{entity.setupTime}}</li>
<li>工单状态: <state code="taskList.status" ref="state1" :value="dispatchStatus" type="text"></state></li>
</ul>
</div>
<div class="img_box fl" style="background:#DDD">
<ViewerImg :images="images" />
</div>
</div>
<Modal v-model="ransferModal" :title="transferTitle" width="800" >
<Modal v-model="ransferModal" :title="transferTitle" width="800">
<!-- <component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" footer-hide/> -->
<p>转序交接</p>
</Modal>
......@@ -90,9 +95,29 @@ export default {
ransferModal: false,
transferTitle: "确认转序",
images: [],
iamges1: [
{
thumbnail: iconImg + "noPic_product.png",
source: iconImg + "noPic_product.png"
}
],
entity: {},
id: Number(this.$route.query.id),
eid: ""
orderId: Number(this.$route.query.orderId),
dispatchStatus: Number(this.$route.query.dispatchStatus),
eid: "",
btnText:
Number(this.$route.query.dispatchStatus) == 14
? "暂停"
: Number(this.$route.query.dispatchStatus) == 5
? "继续"
: "",
btnTextStatus:
Number(this.$route.query.dispatchStatus) == 14
? true
: Number(this.$route.query.dispatchStatus) == 5
? true
: false
};
},
created() {
......@@ -102,7 +127,7 @@ export default {
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() {
this.load(this.id)
this.load(this.id);
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
......@@ -112,12 +137,81 @@ export default {
},
methods: {
starFun() {
this.$Message.success("开工...");
//开工
let params = {
id: this.id,
orderid: this.orderId + ""
};
Api.entrystart(params)
.then(res => {
if (res.success) {
this.$Message.success("开工成功!");
this.dispatchStatus = 14;
this.textBtn();
} else {
this.$Message.error("开工失败!");
}
})
.catch(err => {
this.$Message.error("连接错误");
});
},
transferFn(){
this.ransferModal = true
pauseFun() {
//暂停or继续
let params = {
id: this.id,
orderid: this.orderId + ""
};
if (this.btnText == "暂停") {
Api.entrypause(params)
.then(res => {
if (res.success) {
this.$Message.success("暂停成功!");
this.dispatchStatus = 5;
this.btnText = "继续";
this.textBtn();
} else {
this.$Message.error("暂停失败!");
}
})
.catch(err => {
this.$Message.error("连接错误");
});
} else if (this.btnText == "继续") {
Api.entrentrycontinuestart(params)
.then(res => {
if (res.success) {
this.$Message.success("继续成功!");
this.dispatchStatus = 14;
this.btnText = "暂停";
this.textBtn();
} else {
this.$Message.error("继续失败!");
}
})
.catch(err => {
this.$Message.error("连接错误");
});
}
},
textBtn() {
//控制第一个按钮的text及显示
if (this.dispatchStatus == 14) {
this.btnText = "暂停";
this.btnTextStatus = true;
} else if (this.dispatchStatus == 5) {
this.btnText = "继续";
this.btnTextStatus = true;
} else {
this.btnText = "";
this.btnTextStatus = false;
}
},
transferFn() {
this.ransferModal = true;
},
load(v) {
//加载基础数据
let params = {
id: v
};
......@@ -128,13 +222,13 @@ export default {
if (r.result.productId && r.result.productId > 0) {
ApiTech.get({ id: r.result.productId }).then(res => {
if (res.success && res.result) {
if(res.result.productUrlList&& res.result.productUrlList.length>0)
{
this.eid = res.result.productUrlList;
}
else
{
this.eid=this.$u.guid();
if (
res.result.productUrlList &&
res.result.productUrlList.length > 0
) {
this.eid = res.result.productUrlList;
} else {
this.eid = this.$u.guid();
}
//查询上传到文件服务器上的文件
let parms = {
......@@ -143,18 +237,24 @@ export default {
name: "",
field: ""
};
this.$http.sysUser.getFile(parms).then(res1 => {
if (res1.data != [] && res1.data.length > 0) {
this.images = [];
res1.data.forEach(datas => {
let objImag = {};
objImag.thumbnail=this.downUrl+datas.downloadPath
objImag.source=this.downUrl+datas.downloadPath
this.images.push(objImag)
});
}
});
this.$http.sysUser
.getFile(parms)
.then(res1 => {
if (res1.data != [] && res1.data.length > 0) {
this.images.splice(0);
res1.data.forEach(datas => {
let objImag = {};
objImag.thumbnail = this.downUrl + datas.downloadPath;
objImag.source = this.downUrl + datas.downloadPath;
this.images.push(objImag);
});
} else {
this.images = this.iamges1;
}
})
.catch(err => {
this.images = this.iamges1;
});
}
});
}
......@@ -169,11 +269,36 @@ export default {
},
show() {
this.$viewer.show();
},
goPage(type,title)
{
this.$parent.changeTitle(type,title)
}
},
watch:{
images(v){
this.images=v
watch: {
"$route.query.id"(v1) {
this.images = [];
this.id = v1;
this.load(v1);
},
"$route.query.dispatchStatus"(v2) {
this.dispatchStatus = v2;
if (v2 == 14) {
this.btnText = "暂停";
this.btnTextStatus = true;
} else if (v2 == 5) {
this.btnText = "继续";
this.btnTextStatus = true;
} else {
this.btnText = "";
this.btnTextStatus = false;
}
},
"$route.query.orderId"(v3) {
this.orderId = v3;
},
images(v) {
this.images = v;
}
}
};
......
......@@ -27,7 +27,7 @@
<Button :icon="iconInfo" shape="circle" :title="titleInfo" @click="changeShwo"></Button>
</template>
<template slot="card" slot-scope="{row}">
<div class="body" @click="toExecute(row.id,row.orderId,row.executeId,row.routingHeaderId)">
<div class="body" @click="toExecute(row.id,row.orderId,row.executeId,row.routingHeaderId,row.status)">
<Row class="title-i">
<Col :span="10" class="order-code">{{row.productName}}</Col>
<Col :span="10" class="order-code">{{row.mesCode}}</Col>
......@@ -181,7 +181,8 @@ export default {
params.row.id,
params.row.orderId,
params.row.executeId,
params.row.routingHeaderId
params.row.routingHeaderId,
params.row.status
)
}
},
......@@ -211,11 +212,11 @@ export default {
search() {
this.$refs.grid.reload(this.easySearch);
},
toExecute(id, orderId, executeId,headid) {
toExecute(id, orderId, executeId,headid,status) {
//跳转到对应操作页面 获取id:this.$route.query.id
this.$router.push({
path: "/produce/execute",
query: { id: id, orderId: orderId, executeId: executeId,headid:headid }
query: { id: id, orderId: orderId, executeId: executeId,headid:headid,dispatchStatus:status }
});
},
tdStyle(val) {
......@@ -349,8 +350,8 @@ export default {
}
.box {
color: white;
width: 70px;
height: 20px;
width: 80px;
height: 30px;
overflow: hidden;
/* Rotate div */
transform: rotate(33deg);
......
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