Commit ad50350b authored by renjintao's avatar renjintao

工单执行 data

parent 1c4d984b
...@@ -1664,7 +1664,7 @@ export default { ...@@ -1664,7 +1664,7 @@ export default {
nameMaterial: '物料名称', nameMaterial: '物料名称',
materialNumber: '物料编号', materialNumber: '物料编号',
needCount: '需要数量', needCount: '需要数量',
totalCount: '需数量', totalCount: '需数量',
outStockNumber: '出库数量', outStockNumber: '出库数量',
orderId: '', orderId: '',
remark: '备注', remark: '备注',
......
...@@ -56,6 +56,10 @@ export default { ...@@ -56,6 +56,10 @@ export default {
matchdetaillist(params){//配套审核单列表 matchdetaillist(params){//配套审核单列表
return Api.get(`${technologyUrl}materiallist/matchdetaillist`, params); return Api.get(`${technologyUrl}materiallist/matchdetaillist`, params);
}, },
//物料领用
materialreceiveCreate(params){//配套审核单列表
return Api.post(`${technologyUrl}materialreceive/create`, params);
},
} }
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</Table> </Table>
</div> </div>
<FooterToolbar v-show="footerToolbar"> <FooterToolbar v-show="footerToolbar">
<Button type="primary" class="mr10 ">物料领用</Button> <Button type="primary" class="mr10" @click="materialCreate">物料领用</Button>
</FooterToolbar> </FooterToolbar>
</div> </div>
</template> </template>
...@@ -41,6 +41,7 @@ export default { ...@@ -41,6 +41,7 @@ export default {
key: "routingDetailNo", key: "routingDetailNo",
title: this.l("routingDetailNo"), title: this.l("routingDetailNo"),
align: "left", align: "left",
width: 100
}, },
{ {
key: "routingDetailName", key: "routingDetailName",
...@@ -61,6 +62,7 @@ export default { ...@@ -61,6 +62,7 @@ export default {
key: "totalCount", key: "totalCount",
title: this.l("totalCount"), title: this.l("totalCount"),
align: "left", align: "left",
width: 150,
}, },
{ {
key: "applicationNumber", key: "applicationNumber",
...@@ -85,7 +87,7 @@ export default { ...@@ -85,7 +87,7 @@ export default {
key: "count4", key: "count4",
title: this.l("count4"), title: this.l("count4"),
align: "center", align: "center",
width: 120, width: 150,
slot: "counts4", slot: "counts4",
}, },
{ {
...@@ -181,6 +183,49 @@ export default { ...@@ -181,6 +183,49 @@ export default {
//输入数量 //输入数量
this.$set(this.datas[i].suport, index, row); this.$set(this.datas[i].suport, index, row);
}, },
//物料领用
materialCreate() {
let temDataOld = this.$u.clone(this.datas)
let temData = []
temDataOld.forEach(ele => {
temData = temData.concat(ele.suport)
})
// alert(JSON.stringify(temData))
let datas = []
temData.forEach(el => {
if (el.count4 && el.count4 > 0 && el.count4 != "") {
let temObj = {
routingHeaderId: el.routingHeaderId,
routingDeatilId: el.routingDetailId,
routingDetailName: el.routingDetailName,
routingDetailSeq: el.routingDetailNo,
count: el.count4,
materialId: el.materialId,
materialName: el.nameMaterial,
materialNumber: el.materialNumber,
supportMainId: 0,
}
datas.push(temObj)
}
})
if (datas.length > 0) {
let params = {
items: datas,
orderId: this.entity.orderId,
dispatchId: this.entity.id,
creator: this.$store.state.userInfo.userName,
status: 0
}
Api.materialreceiveCreate(params).then(r => {
if (r.success) {
this.$Message.success("物料领用成功");
this.loadInfo();
}
});
} else {
this.$Message.error("请输入领用物料数量!");
}
},
l(key) { l(key) {
let vkey = "support_item" + "." + key; let vkey = "support_item" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
......
<template> <template>
<div class="aps-r"> <div class="aps-r">
<DataGrid <DataGrid :columns="columns" ref="grid" :batch="false" :type="typeInfo" :span="6" :lazy="true" :conditions="easySearch" :action="action" :gutter="40">
:columns="columns" <template slot="easySearch">
ref="grid" <Form ref="formInline" :model="easySearch" inline>
:batch="false" <FormItem prop="keys">
:type="typeInfo" <Input placeholder="请输入订单编号/产品名称/图号" v-model="easySearch.keys.value" v-width="260" clearable />
:span="6" </FormItem>
:lazy="true" <FormItem>
:conditions="easySearch" <Button type="primary" @click="search">查询</Button>
:action="action" </FormItem>
:gutter="40" </Form>
> </template>
<template slot="easySearch"> <template slot="searchForm">
<Form ref="formInline" :model="easySearch" inline> <Search />
<FormItem prop="keys"> </template>
<Input <template slot="buttons">
placeholder="请输入订单编号/产品名称/图号" <Button :icon="iconInfo" shape="circle" :title="titleInfo" @click="changeShwo"></Button>
v-model="easySearch.keys.value" </template>
v-width="260" <template slot="card" slot-scope="{row}">
clearable <div class="body" @click="toExecute(row.id,row.orderId,row.executeId,row.routingHeaderId,row.routingDetailId,row.quantity,row.status,row.mesCode,row.productName,row.drawnNumber)">
/> <Row class="title-i">
</FormItem> <Col :span="10" class="order-code">
<FormItem> <Ellipsis :text="row.productName" :lines="1" tooltip transfer />
<Button type="primary" @click="search">查询</Button> </Col>
</FormItem> <Col :span="10" class="order-code">
</Form> <Ellipsis :text="row.mesCode" :lines="1" tooltip transfer />
</template> </Col>
<template slot="searchForm"> <Col :span="4">
<Search /> <div class="statuBg" :style="tdStyle(row.status)"></div>
</template> <div class="boxTitle">
<template slot="buttons"> <div class="text">
<Button :icon="iconInfo" shape="circle" :title="titleInfo" @click="changeShwo"></Button> <state code="taskList.status" ref="state" :value="row.status" type="text" :color="false"></state>
</template> </div>
<template slot="card" slot-scope="{row}"> </div>
<div </Col>
class="body" </Row>
@click="toExecute(row.id,row.orderId,row.executeId,row.routingHeaderId,row.routingDetailId,row.quantity,row.status)" <div class="panel-text">
> <Row>
<Row class="title-i"> <Col span="8">
<Col :span="10" class="order-code"> <img :src="getUrl(row.productUrl)" width="120" height="120" :title="row.productUrl" style="border:#cacbd0 dashed 1px" onerror="this.src='/imgicon/noPic_product.png';" />
<Ellipsis :text="row.productName" :lines="1" tooltip transfer /> </Col>
</Col> <Col span="16" class="row">
<Col :span="10" class="order-code"> <p>{{l("beginTime")}}{{row.beginTime}}</p>
<Ellipsis :text="row.mesCode" :lines="1" tooltip transfer /> <p>
</Col> <span v-if="getStatus(row.status)">{{l("planEndTime")}}</span>
<Col :span="4"> <span v-else>{{l("endTime")}}</span>
<div class="statuBg" :style="tdStyle(row.status)"></div> {{row.endTime}}
<div class="boxTitle"> </p>
<div class="text"> <p v-if="getStatus(row.status)&&getTimes(row.endTime)>0">
<state 剩余时间:
code="taskList.status" <OutputTime :value="getTimes(row.endTime)" style="display:inline"></OutputTime>
ref="state" </p>
:value="row.status" <p>{{l("quantity")}}{{row.quantity}}</p>
type="text" </Col>
:color="false" </Row>
></state> <Row class="rowBottom">
<Col span="14">{{l("drawnNumber")}}{{row.drawnNumber}}</Col>
<Col span="10" class="tr">
<Icon type="md-alert" size="18" color="#FFA000" v-if="getStatus(row.status)&&getTimes(row.endTime)<86400&&getTimes(row.endTime)>0" />
<span style="color:#FFA000" v-if="getStatus(row.status)&&getTimes(row.endTime)<86400&&getTimes(row.endTime)>0">预警</span>&nbsp;&nbsp;
<Icon type="md-timer" size="18" color="#FE7777" v-if="getStatus(row.status)&&compareTime(row.endTime)" />
<span style="color:#FE7777" v-if="getStatus(row.status)&&compareTime(row.endTime)">超期</span>
</Col>
</Row>
</div> </div>
</div> </div>
</Col> </template>
</Row>
<div class="panel-text">
<Row>
<Col span="8">
<img
:src="getUrl(row.productUrl)"
width="120"
height="120"
:title="row.productUrl"
style="border:#cacbd0 dashed 1px"
onerror="this.src='/imgicon/noPic_product.png';"
/>
</Col>
<Col span="16" class="row">
<p>{{l("beginTime")}}{{row.beginTime}}</p>
<p>
<span v-if="getStatus(row.status)">{{l("planEndTime")}}</span>
<span v-else>{{l("endTime")}}</span>
{{row.endTime}}
</p>
<p v-if="getStatus(row.status)&&getTimes(row.endTime)>0">
剩余时间:
<OutputTime :value="getTimes(row.endTime)" style="display:inline"></OutputTime>
</p>
<p>{{l("quantity")}}{{row.quantity}}</p>
</Col>
</Row>
<Row class="rowBottom">
<Col span="14">{{l("drawnNumber")}}{{row.drawnNumber}}</Col>
<Col span="10" class="tr">
<Icon
type="md-alert"
size="18"
color="#FFA000"
v-if="getStatus(row.status)&&getTimes(row.endTime)<86400&&getTimes(row.endTime)>0"
/>
<span
style="color:#FFA000"
v-if="getStatus(row.status)&&getTimes(row.endTime)<86400&&getTimes(row.endTime)>0"
>预警</span>&nbsp;&nbsp;
<Icon
type="md-timer"
size="18"
color="#FE7777"
v-if="getStatus(row.status)&&compareTime(row.endTime)"
/>
<span
style="color:#FE7777"
v-if="getStatus(row.status)&&compareTime(row.endTime)"
>超期</span>
</Col>
</Row>
</div>
</div>
</template>
</DataGrid> </DataGrid>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import Search from "./search"; import Search from "./search";
export default { export default {
name: "starOrder", name: "starOrder",
components: { components: {
Search Search
}, },
data() { data() {
return { return {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys: { keys: {
op: "mesCode,productName,drawnNumber", op: "mesCode,productName,drawnNumber",
value: null value: null
} }
//status: { op: "Equal", value: 0 } //status: { op: "Equal", value: 0 }
}, },
downUrl: fileUrlDown, downUrl: fileUrlDown,
columns: [ columns: [{
{ title: this.l("mesCode"),
title: this.l("mesCode"), key: "mesCode",
key: "mesCode", width: 240,
width: 240, align: "left"
align: "left" },
{
key: "status",
title: this.l("status"),
align: "center",
high: true,
code: "taskList.status",
width: 120
},
{
key: "productName",
title: this.l("productName"),
align: "left",
high: true
},
{
key: "drawnNumber",
title: this.l("drawnNumber"),
align: "left",
high: true
},
{
key: "quantity",
title: this.l("quantity"),
align: "right",
width: 120,
high: true
},
{
key: "beginTime",
title: this.l("beginTime"),
align: "center",
width: 180,
high: true
},
{
key: "endTime",
title: this.l("endTime"),
align: "center",
width: 180,
high: true
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
return h("div", {
class: "action"
}, [
h(
"op", {
attrs: {
oprate: "edit"
},
on: {
click: () =>
this.toExecute(
params.row.id,
params.row.orderId,
params.row.executeId,
params.row.routingHeaderId,
params.row.routingDetailId,
params.row.quantity,
params.row.status,
params.row.mesCode,
params.row.productName,
params.row.drawnNumber
)
}
},
"查看"
)
]);
}
}
],
typeInfo: "card",
iconInfo: "md-apps",
titleInfo: "卡片模式",
nowTime: new Date().getTime() //页面当前打开时间
};
},
created() {
let oldStr = localStorage.getItem("admin");
let userlist = this.$store.getters.getUser(2);
},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() {
this.search();
},
methods: {
search() {
this.$refs.grid.reload(this.easySearch);
}, },
{ toExecute(
key: "status", id,
title: this.l("status"), orderId,
align: "center", executeId,
high: true, headid,
code: "taskList.status", routingDetailId,
width: 120 quantity,
status,
mesCode,
productName,
drawnNumber
) {
//跳转到对应操作页面 获取id:this.$route.query.id
this.$router.push({
path: "/produce/execute",
query: {
id: id, //工单ID
orderId: orderId, //订单id
executeId: executeId, //订单执行表id
headid: headid, //工艺规程id
routid: routingDetailId, //工序ID
quantity: quantity, //派工数量
dispatchStatus: status,
mesCode: mesCode,
productName: productName,
drawnNumber: drawnNumber
}
});
}, },
{ tdStyle(val) {
key: "productName", //动态根据状态值加载状态值对应的颜色
title: this.l("productName"), let temDic = this.$store.getters.dictionaryByKey("taskList.status");
align: "left", let temColor = "#666";
high: true temDic.forEach(data => {
if (Number(data.code) == val) {
temColor = data.color;
}
});
var style = {};
style["border-top"] = " solid 38px " + temColor;
return style;
}, },
{ changeShwo() {
key: "drawnNumber", //显示模式切换
title: this.l("drawnNumber"), if (this.typeInfo == "card") {
align: "left", this.typeInfo = "table";
high: true this.iconInfo = "md-list";
this.titleInfo = "列表模式";
} else {
this.typeInfo = "card";
this.iconInfo = "md-apps";
this.titleInfo = "卡片模式";
}
}, },
{ compareTime(dateStart) {
key: "quantity", //比较当前时间和计划完成时间
title: this.l("quantity"), let planEndTime = new Date(dateStart).getTime();
align: "right", let res = true;
width: 120, if (this.nowTime - planEndTime > 0) {
high: true res = true;
} else {
res = false;
}
return res;
}, },
{ getTimes(dateStart) {
key: "beginTime", //返回计划完成时间和当前时间的差值
title: this.l("beginTime"), let planEndTime = new Date(dateStart).getTime();
align: "center", let res = 0;
width: 180, if (this.nowTime - planEndTime > 0) {
high: true res = 0;
} else {
res = (this.nowTime - planEndTime) / 1000;
}
return res;
}, },
{ getStatus(status) {
key: "endTime", //根据状态返回未开工、执行中、暂停状态的bool值
title: this.l("endTime"), let res = true;
align: "center", if (status == 12 || status == 14 || status == 5) {
width: 180, res = true;
high: true } else {
res = false;
}
return res;
}, },
{ getUrl(url) {
title: "操作", //返回img需要显示的src值
key: "action", let tempUrl = "";
width: 140, if (url && url.length > 0) {
align: "center", tempUrl = this.downUrl + url;
render: (h, params) => { } else {
return h("div", { class: "action" }, [ tempUrl = iconImg + "noPic_product.png";
h( }
"op", return tempUrl;
{ },
attrs: { oprate: "edit" }, l(key) {
on: { let vkey = "order_list" + "." + key;
click: () => return this.$t(vkey) || key;
this.toExecute(
params.row.id,
params.row.orderId,
params.row.executeId,
params.row.routingHeaderId,
params.row.routingDetailId,
params.row.quantity,
params.row.status
)
}
},
"查看"
)
]);
}
}
],
typeInfo: "card",
iconInfo: "md-apps",
titleInfo: "卡片模式",
nowTime: new Date().getTime() //页面当前打开时间
};
},
created() {
let oldStr = localStorage.getItem("admin");
let userlist = this.$store.getters.getUser(2);
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() {
this.search();
},
methods: {
search() {
this.$refs.grid.reload(this.easySearch);
},
toExecute(
id,
orderId,
executeId,
headid,
routingDetailId,
quantity,
status
) {
//跳转到对应操作页面 获取id:this.$route.query.id
this.$router.push({
path: "/produce/execute",
query: {
id: id, //工单ID
orderId: orderId, //订单id
executeId: executeId, //订单执行表id
headid: headid, //工艺规程id
routid: routingDetailId, //工序ID
quantity: quantity, //派工数量
dispatchStatus: status
}
});
},
tdStyle(val) {
//动态根据状态值加载状态值对应的颜色
let temDic = this.$store.getters.dictionaryByKey("taskList.status");
let temColor = "#666";
temDic.forEach(data => {
if (Number(data.code) == val) {
temColor = data.color;
} }
});
var style = {};
style["border-top"] = " solid 38px " + temColor;
return style;
},
changeShwo() {
//显示模式切换
if (this.typeInfo == "card") {
this.typeInfo = "table";
this.iconInfo = "md-list";
this.titleInfo = "列表模式";
} else {
this.typeInfo = "card";
this.iconInfo = "md-apps";
this.titleInfo = "卡片模式";
}
},
compareTime(dateStart) {
//比较当前时间和计划完成时间
let planEndTime = new Date(dateStart).getTime();
let res = true;
if (this.nowTime - planEndTime > 0) {
res = true;
} else {
res = false;
}
return res;
},
getTimes(dateStart) {
//返回计划完成时间和当前时间的差值
let planEndTime = new Date(dateStart).getTime();
let res = 0;
if (this.nowTime - planEndTime > 0) {
res = 0;
} else {
res = (this.nowTime - planEndTime) / 1000;
}
return res;
},
getStatus(status) {
//根据状态返回未开工、执行中、暂停状态的bool值
let res = true;
if (status == 12 || status == 14 || status == 5) {
res = true;
} else {
res = false;
}
return res;
},
getUrl(url) {
//返回img需要显示的src值
let tempUrl = "";
if (url && url.length > 0) {
tempUrl = this.downUrl + url;
} else {
tempUrl = iconImg + "noPic_product.png";
}
return tempUrl;
},
l(key) {
let vkey = "order_list" + "." + key;
return this.$t(vkey) || key;
} }
}
}; };
</script> </script>
<style lang="less"> <style lang="less">
.aps-r { .aps-r {
// width: 100%; // width: 100%;
// height: 100%; // height: 100%;
// overflow: auto; // overflow: auto;
// padding: 15px 0 15px 15px; // padding: 15px 0 15px 15px;
height: calc(100vh - 110px); height: calc(100vh - 110px);
.body {
background: white; .body {
border-radius: 4px 0 4px 4px; background: white;
border: #cacbd0 solid 1px; border-radius: 4px 0 4px 4px;
margin-bottom: 30px; border: #cacbd0 solid 1px;
.title-i { margin-bottom: 30px;
padding: 0 0 0 8px;
height: 38px; .title-i {
line-height: 38px; padding: 0 0 0 8px;
color: #2680eb; height: 38px;
font-size: 14px; line-height: 38px;
font-weight: bold; color: #2680eb;
border-bottom: #cacbd0 dotted 1px; font-size: 14px;
.btn-click { font-weight: bold;
text-align: right; border-bottom: #cacbd0 dotted 1px;
a {
color: #fff; .btn-click {
text-align: right;
a {
color: #fff;
}
a:hover {
color: #249e91;
}
}
} }
a:hover {
color: #249e91; .panel-text {
padding: 5px 8px;
.row {
color: #666666;
padding-left: 10px;
p {
line-height: 30px;
}
}
} }
}
} }
.panel-text {
padding: 5px 8px; .body:hover {
.row { cursor: pointer;
color: #666666; box-shadow: 0 0 10px #888888;
padding-left: 10px;
p {
line-height: 30px;
}
}
} }
}
.body:hover {
cursor: pointer;
box-shadow: 0 0 10px #888888;
}
} }
.statuBg { .statuBg {
height: 0px; height: 0px;
width: 0; width: 0;
border-left: solid 50px transparent; border-left: solid 50px transparent;
float: right; float: right;
margin-right: -1px; margin-right: -1px;
} }
.boxTitle { .boxTitle {
color: white; color: white;
float: right; float: right;
margin-top: -42px; margin-top: -42px;
/* Rotate div */ /* Rotate div */
transform: rotate(37deg); transform: rotate(37deg);
-ms-transform: rotate(37deg); /* Internet Explorer */ -ms-transform: rotate(37deg);
-moz-transform: rotate(37deg); /* Firefox */ /* Internet Explorer */
-webkit-transform: rotate(37deg); /* Safari 和 Chrome */ -moz-transform: rotate(37deg);
-o-transform: rotate(37deg); /* Opera */ /* Firefox */
.text { -webkit-transform: rotate(37deg);
font-size: 8px; /* Safari 和 Chrome */
font-weight: normal; -o-transform: rotate(37deg);
}
/* Opera */
.text {
font-size: 8px;
font-weight: normal;
}
} }
.rowBottom .ivu-col-span-10 { .rowBottom .ivu-col-span-10 {
height: 24px; height: 24px;
padding-right: 10px; padding-right: 10px;
} }
</style> </style>
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