Commit ac95e889 authored by 康振飞's avatar 康振飞

订单分组--派工

parent ad07d409
...@@ -25,10 +25,53 @@ ...@@ -25,10 +25,53 @@
</RadioGroup> </RadioGroup>
</span> </span>
</p> </p>
<div class="dispatch_part_body" :style="{height:byheight}"> <div class="dispatch_part_body" v-if="listShow == '订单'" :style="{height:byheight}">
<!-- {{ids}} --> <!-- {{ids}} -->
<Collapse simple>
<Panel v-for="(item,index) in listOrder" :key="index" :name="item.mesCode">
<b>订单号:{{item[0].mesCode}} <Tag>{{item.length}}</Tag></b>
<!-- 订单号:{{item[0].mesCode}} {{item.length}} -->
<p slot="content">
<Row :gutter="15" class="card_body01">
<Col span="8" class="dispatch_card" v-for="(li,index) in item" :key="li.id">
<Card>
<p slot="title" class="card_top">
<Checkbox v-model="li.checked" :disabled="li.status!=-1" >
<Icon type="ios-pricetags" />工序{{li.process_seq}}{{li.process_name}}
</Checkbox>
</p>
<div class="h60">
<p class="g_title">{{li.productName}}--{{li.equipCode}}</p>
<p>
产品数量:{{li.quantity}}
<op
title="拆分"
type="icon"
icon="md-cut"
v-if="li.quantity > 1 && li.pid == 0 && li.status==-1"
@click="setChai(li,index)"
></op>
<op
title="删除"
type="icon"
icon="md-close-circle"
v-else-if="li.pid != 0"
@click="removeDetail(li,index)"
></op>
</p>
<p>{{li.beginTime}}--{{li.endTime}}</p>
<p>人员 :{{li.userNames}}</p>
<!-- <p>设备 :{{item.equipCode}}</p> -->
</div>
</Card>
</Col>
</Row>
</p>
</Panel>
</Collapse>
</div>
<div class="dispatch_part_body" v-else-if="listShow == '工单'" :style="{height:byheight}">
<Row :gutter="15" class="card_body01"> <Row :gutter="15" class="card_body01">
<!-- <p>订单号:{{item.mesCode}}</p> v-for="(item,index) in listTask" :key="index" -->
<Col span="8" class="dispatch_card" v-for="(item,index) in listTask" :key="index"> <Col span="8" class="dispatch_card" v-for="(item,index) in listTask" :key="index">
<Card> <Card>
<p slot="title" class="card_top"> <p slot="title" class="card_top">
...@@ -276,6 +319,7 @@ export default { ...@@ -276,6 +319,7 @@ export default {
listSheBei: [], //设备列表 listSheBei: [], //设备列表
listMan: [], //人员列表 listMan: [], //人员列表
listTask: [], //工单列表数据 listTask: [], //工单列表数据
listTitle: [],//订单号列表
newList: [], //选中数据 newList: [], //选中数据
chaiModal: false, //拆分弹框 chaiModal: false, //拆分弹框
chaiNum: 1, //拆分数量 chaiNum: 1, //拆分数量
...@@ -363,7 +407,7 @@ export default { ...@@ -363,7 +407,7 @@ export default {
this.shebeiId = id this.shebeiId = id
this.footerToolbar = true this.footerToolbar = true
}, },
// 获取查询人员 listTask // 获取查询人员
getselectuser(id) { getselectuser(id) {
let parme = { departmentId: id, type: '2' } let parme = { departmentId: id, type: '2' }
Api.getUser(parme).then((res) => { Api.getUser(parme).then((res) => {
...@@ -388,7 +432,13 @@ export default { ...@@ -388,7 +432,13 @@ export default {
let parme = { departmentId: id, DispatchStatus: this.status } let parme = { departmentId: id, DispatchStatus: this.status }
Api.getEntryList(parme).then((res) => { Api.getEntryList(parme).then((res) => {
var savedUl = [] var savedUl = []
var pid
res.result.map((u) => { res.result.map((u) => {
if(u.pid){
pid = u.pid
}else{
pid = 0
}
let detailnew = { let detailnew = {
beginTime: u.beginTime,//开始时间 beginTime: u.beginTime,//开始时间
dispatchStatus: u.dispatchStatus,// dispatchStatus: u.dispatchStatus,//
...@@ -409,13 +459,26 @@ export default { ...@@ -409,13 +459,26 @@ export default {
status: u.status,// status: u.status,//
userIds: u.userIds,// userIds: u.userIds,//
userNames: u.userNames, userNames: u.userNames,
pid: 0, //拆分项id pid: pid, //拆分项id
} }
savedUl.push(detailnew) savedUl.push(detailnew)
}) })
this.listTask = savedUl this.listTask = savedUl
}) })
}, },
// 数组去重
getArray(a) {
const hash = {}
const len = a.length
const result = []
for (let i = 0; i < len; i++) {
if (!hash[a[i]]) {
hash[a[i]] = true
result.push(a[i])
}
}
return result
},
// 时间改变方法 // 时间改变方法
handleChange(daterange) { handleChange(daterange) {
this.newList.map((u) => { this.newList.map((u) => {
...@@ -534,6 +597,7 @@ export default { ...@@ -534,6 +597,7 @@ export default {
detail.pid = this.$u.guid() detail.pid = this.$u.guid()
detail.quantity = this.chaiNum detail.quantity = this.chaiNum
this.listTask.splice(this.rowIndex + 1, 0, detail) this.listTask.splice(this.rowIndex + 1, 0, detail)
console.log("拆分后数据",this.listTask)
this.saveFameData() this.saveFameData()
}, },
// 拆分保存 // 拆分保存
...@@ -585,6 +649,14 @@ export default { ...@@ -585,6 +649,14 @@ export default {
} }
return ids return ids
}, },
listOrder(){
let orders= this.$u.group(this.listTask,u=>{
return u.mesCode
})
console.warn("listOrder",orders)
return orders;
},
peploeId() { peploeId() {
let peploeId = [] let peploeId = []
this.listMan.map((u) => { this.listMan.map((u) => {
......
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