|
|
@@ -12,13 +12,28 @@
|
|
|
>派工单查询</Button
|
|
|
>
|
|
|
<Button
|
|
|
- @click="handleDispatchAllOpen"
|
|
|
+ @click="handleDispatchConfirm"
|
|
|
type="primary"
|
|
|
style="margin-right:10px;"
|
|
|
- >全部派工</Button
|
|
|
+ >确认派工</Button
|
|
|
>
|
|
|
</Toptitle>
|
|
|
- <div class="body">
|
|
|
+ <div class="main">
|
|
|
+ <Form style='display:flex;margin:15px 0' :label-width='100'>
|
|
|
+ <FormItem label='订单编号:' >
|
|
|
+ <Select style="width:200px" v-model="searchData.order_no">
|
|
|
+ <Option value="1">1</Option>
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label='图号:'>
|
|
|
+ <Select style="width:200px" v-model="searchData.url_number">
|
|
|
+ <Option value="2">1</Option>
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem>
|
|
|
+ <Button type="primary">搜索</Button>
|
|
|
+ </FormItem>
|
|
|
+ </Form>
|
|
|
<div class="header">
|
|
|
<Tabs v-model="currencyTag" @on-click="handleProcedureChange">
|
|
|
<TabPane
|
|
|
@@ -27,7 +42,13 @@
|
|
|
:label="item.title"
|
|
|
:name="item.id + ''"
|
|
|
/>
|
|
|
+ <div slot="extra" style="width:250px;line-height:40px;font-size:12px">
|
|
|
+ <label style="width:130px">批量设置班组:</label>
|
|
|
+ <Select v-model="group" size='small' style="z-index:99;position: fixed;width:150px;margin-top: 6px;margin-left:10px" @on-change='change_NK'> <Option :value="_item.id" :label="_item.nickname" v-for="_item in groupList" :key="_item.id">
|
|
|
+ </Option> </Select>
|
|
|
+ </div>
|
|
|
</Tabs>
|
|
|
+
|
|
|
</div>
|
|
|
<div class="content">
|
|
|
<Table
|
|
|
@@ -35,7 +56,9 @@
|
|
|
border
|
|
|
max-height="700"
|
|
|
@on-selection-change="handleSelectionChange"
|
|
|
+ @on-select='changeSelect'
|
|
|
:data="tableData"
|
|
|
+ ref="y_table"
|
|
|
>
|
|
|
<template slot="slotGroup" slot-scope="{ row, index }">
|
|
|
<Select
|
|
|
@@ -64,12 +87,15 @@
|
|
|
</template>
|
|
|
<template slot="slotSet" slot-scope="{ row, index }">
|
|
|
<a style="margin:0 5px" @click="handleSet(row, index)">详情</a>
|
|
|
- <a style="margin:0 5px" @click="handleDispatchConfirm(row, index)"
|
|
|
+ <!-- <a style="margin:0 5px" @click="handleDispatchConfirm(row, index)"
|
|
|
>派工</a
|
|
|
- >
|
|
|
+ > -->
|
|
|
</template>
|
|
|
</Table>
|
|
|
- <!-- <div class="pageSlotStyle">
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="pageSlotStyle">
|
|
|
<Page :page-size-opts="[10, 20, 30, 40,100,1000]"
|
|
|
@on-page-size-change='changeSize'
|
|
|
@on-change='changePage'
|
|
|
@@ -78,9 +104,7 @@
|
|
|
:total="total"
|
|
|
show-sizer
|
|
|
:page-size='page_size' />
|
|
|
- </div> -->
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
<Modal v-model="showModal" title="确认派工">
|
|
|
<Form :label-width="85" ref="forms" :model="dispatchInfo">
|
|
|
<FormItem label="选择时间">
|
|
|
@@ -168,7 +192,7 @@ export default {
|
|
|
// 这里存放数据
|
|
|
return {
|
|
|
tableColumns: [
|
|
|
- // { title: '全选', type: 'selection', align: 'center', minWidth: 60 },
|
|
|
+ { title: '全选', type: 'selection', align: 'center', minWidth: 60 },
|
|
|
{ title: "工序", align: "center", key: "title", minWidth: 150 },
|
|
|
{ title: "部件总数", align: "center", key: "num", minWidth: 150 },
|
|
|
{
|
|
|
@@ -202,11 +226,26 @@ export default {
|
|
|
page_index: 1,
|
|
|
page_size: 10,
|
|
|
total: 0,
|
|
|
+ group:'',
|
|
|
basicsProcedureList: [],
|
|
|
groupList: [],
|
|
|
currencyTag: "1",
|
|
|
dispatchTime: [],
|
|
|
+ wood_select:[],
|
|
|
+ wood_group:'',
|
|
|
+ paint_select:[],
|
|
|
+ paint_group:'',
|
|
|
+ packing_select:[],
|
|
|
+ packing_group:'',
|
|
|
+ transit_select:[],
|
|
|
+ transit_group:'',
|
|
|
+ install_select:[],
|
|
|
+ install_group:'',
|
|
|
selected: [],
|
|
|
+ searchData:{
|
|
|
+ order_no:'',
|
|
|
+ url_number:''
|
|
|
+ },
|
|
|
showModal: false,
|
|
|
showModalAll: false,
|
|
|
options: {
|
|
|
@@ -230,7 +269,7 @@ export default {
|
|
|
})
|
|
|
.catch((err) => {});
|
|
|
//获取班组列表
|
|
|
- this.axios("/api/employee_list", { params: { type: 3 } }).then(
|
|
|
+ this.axios("/api/employee_list").then(
|
|
|
(res) => (this.groupList = res.data)
|
|
|
);
|
|
|
},
|
|
|
@@ -239,6 +278,90 @@ export default {
|
|
|
this.initData();
|
|
|
},
|
|
|
methods: {
|
|
|
+ changeSelect(row){
|
|
|
+
|
|
|
+ },
|
|
|
+ change_NK(row){
|
|
|
+ if(row == null){
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ if(this.currencyTag == 1){
|
|
|
+ if(this.wood_select.length == 0){
|
|
|
+ this.$Message.warning('请先选择工序!')
|
|
|
+ }else{
|
|
|
+ this.tableData.forEach(item=>{
|
|
|
+ this.wood_select.forEach(_item=>{
|
|
|
+ if(_item.id == item.id){
|
|
|
+ item.employee_id = row;
|
|
|
+ item._checked = true;
|
|
|
+ _item.employee_id = row;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.currencyTag == 2){
|
|
|
+ if(this.paint_select.length == 0){
|
|
|
+ this.$Message.warning('请先选择工序!')
|
|
|
+ }else{
|
|
|
+ this.tableData.forEach(item=>{
|
|
|
+ this.paint_select.forEach(_item=>{
|
|
|
+ if(_item.id == item.id){
|
|
|
+ item.employee_id = row;
|
|
|
+ item._checked = true;
|
|
|
+ _item.employee_id = row;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.currencyTag == 3){
|
|
|
+ if(this.packing_select.length == 0){
|
|
|
+ this.$Message.warning('请先选择工序!')
|
|
|
+ }else{
|
|
|
+ this.tableData.forEach(item=>{
|
|
|
+ this.packing_select.forEach(_item=>{
|
|
|
+ if(_item.id == item.id){
|
|
|
+ item.employee_id = row;
|
|
|
+ item._checked = true;
|
|
|
+ _item.employee_id = row;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.currencyTag == 4){
|
|
|
+ if(this.transit_select.length == 0){
|
|
|
+ this.$Message.warning('请先选择工序!')
|
|
|
+ }else{
|
|
|
+ this.tableData.forEach(item=>{
|
|
|
+ this.transit_select.forEach(_item=>{
|
|
|
+ if(_item.id == item.id){
|
|
|
+ item.employee_id = row;
|
|
|
+ item._checked = true;
|
|
|
+ _item.employee_id = row;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.currencyTag == 5){
|
|
|
+ if(this.install_select.length == 0){
|
|
|
+ this.$Message.warning('请先选择工序!')
|
|
|
+ }else{
|
|
|
+ this.tableData.forEach(item=>{
|
|
|
+ this.install_select.forEach(_item=>{
|
|
|
+ if(_item.id == item.id){
|
|
|
+ item.employee_id = row;
|
|
|
+ item._checked = true;
|
|
|
+ _item.employee_id = row;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
initData() {
|
|
|
this.axios({
|
|
|
method: "get",
|
|
|
@@ -246,13 +369,68 @@ export default {
|
|
|
params: {
|
|
|
basics_procedure_id:
|
|
|
localStorage.getItem("dispatchTag") || this.currencyTag,
|
|
|
+ page_index:this.page_index,
|
|
|
+ page_size:this.page_size,
|
|
|
},
|
|
|
})
|
|
|
.then((res) => {
|
|
|
- this.tableData = res.data;
|
|
|
+ this.group = '';
|
|
|
+ this.total = res.data.total;
|
|
|
+ this.tableData = res.data.data;
|
|
|
this.tableData.forEach((element) => {
|
|
|
element.produce_id = element.id;
|
|
|
element.employee_id ? "" : (element.employee_id = "");
|
|
|
+ if(this.currencyTag == 1 ){
|
|
|
+ this.wood_select.forEach(_item=>{
|
|
|
+ if(_item.id == element.id){
|
|
|
+ element._checked = true;
|
|
|
+ element.employee_id = _item.employee_id;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if(this.currencyTag == 2 ){
|
|
|
+ this.paint_select.forEach(_item=>{
|
|
|
+ if(_item.id == element.id){
|
|
|
+ element._checked = true;
|
|
|
+ element.employee_id = _item.employee_id;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(this.currencyTag == 3 ){
|
|
|
+ this.packing_select.forEach(_item=>{
|
|
|
+ if(_item.id == element.id){
|
|
|
+ element._checked = true;
|
|
|
+ element.employee_id = _item.employee_id;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(this.currencyTag == 4 ){
|
|
|
+ this.transit_select.forEach(_item=>{
|
|
|
+ if(_item.id == element.id){
|
|
|
+ element._checked = true;
|
|
|
+ element.employee_id = _item.employee_id;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(this.currencyTag == 5 ){
|
|
|
+ this.install_select.forEach(_item=>{
|
|
|
+ if(_item.id == element.id){
|
|
|
+ element._checked = true;
|
|
|
+ element.employee_id = _item.employee_id;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
});
|
|
|
this.$forceUpdate();
|
|
|
})
|
|
|
@@ -272,11 +450,21 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
- handleDispatchConfirm(row, index) {
|
|
|
- if (row.employee_id) {
|
|
|
- this.selected = [row];
|
|
|
+ // handleDispatchConfirm(row, index) {
|
|
|
+ // if (row.employee_id) {
|
|
|
+ // this.selected = [row];
|
|
|
+ // this.showModal = true;
|
|
|
+ // this.subArr = JSON.parse(JSON.stringify(this.selected));
|
|
|
+ // this.subUrl = "/api/order_produce_pull_all";
|
|
|
+ // } else {
|
|
|
+ // this.$Message.warning("请选择班组");
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+
|
|
|
+ handleDispatchConfirm() {
|
|
|
+ if (this.wood_select.length!=0||this.paint_select.length!=0||this.packing_select.length!=0||this.transit_select.length!=0||this.install_select.length!=0) {
|
|
|
this.showModal = true;
|
|
|
- this.subArr = JSON.parse(JSON.stringify(this.selected));
|
|
|
+ this.subArr =[...this.wood_select,...this.paint_select,...this.packing_select,...this.transit_select,...this.install_select]
|
|
|
this.subUrl = "/api/order_produce_pull_all";
|
|
|
} else {
|
|
|
this.$Message.warning("请选择班组");
|
|
|
@@ -298,6 +486,7 @@ export default {
|
|
|
element.work_type = this.dispatchInfo.work_type;
|
|
|
element.user_salary = this.dispatchInfo.user_salary || "";
|
|
|
});
|
|
|
+ console.log(target);
|
|
|
this.axios({
|
|
|
method: "post",
|
|
|
url,
|
|
|
@@ -333,8 +522,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
handleDispatchAllOpen() {
|
|
|
- console.log(localStorage.getItem("dispatchTag"));
|
|
|
- console.log("this.currencyTag :>> ", this.currencyTag);
|
|
|
this.axios
|
|
|
.get("/api/get_all_order_produce", {
|
|
|
params: {
|
|
|
@@ -364,10 +551,60 @@ export default {
|
|
|
this.selected = [];
|
|
|
this.currencyTag = val;
|
|
|
localStorage.setItem("dispatchTag", val);
|
|
|
- this.initData();
|
|
|
+ this.initData();
|
|
|
+ this.page_index = 1;
|
|
|
+ this.page_size = 10;
|
|
|
},
|
|
|
handleSelectionChange(selection) {
|
|
|
- this.selected = selection;
|
|
|
+ try{
|
|
|
+ if(this.currencyTag == 1){
|
|
|
+ this.wood_select = selection;
|
|
|
+ this.wood_select.forEach((item,index)=>{
|
|
|
+ if(this.wood_select[index].id!=this.tableData[index].id){
|
|
|
+ this.$Message.error('请按流程选择工序!');
|
|
|
+ throw new Error();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.currencyTag == 2){
|
|
|
+ this.paint_select =selection;
|
|
|
+ this.paint_select.forEach((item,index)=>{
|
|
|
+ if(this.paint_select[index].id!=this.tableData[index].id){
|
|
|
+ this.$Message.error('请按流程选择工序!');
|
|
|
+ throw new Error();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.currencyTag == 3){
|
|
|
+ this.packing_select =selection;
|
|
|
+ this.packing_select.forEach((item,index)=>{
|
|
|
+ if(this.packing_select[index].id!=this.tableData[index].id){
|
|
|
+ this.$Message.error('请按流程选择工序!');
|
|
|
+ throw new Error();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.currencyTag == 4){
|
|
|
+ this.transit_select = selection;
|
|
|
+ this.transit_select.forEach((item,index)=>{
|
|
|
+ if(this.transit_select[index].id!=this.tableData[index].id){
|
|
|
+ this.$Message.error('请按流程选择工序!');
|
|
|
+ throw new Error();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.currencyTag == 5){
|
|
|
+ this.install_select = selection;
|
|
|
+ this.install_select.forEach((item,index)=>{
|
|
|
+ if(this.install_select[index].id!=this.tableData[index].id){
|
|
|
+ this.$Message.error('请按流程选择工序!');
|
|
|
+ throw new Error();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }catch(e){
|
|
|
+
|
|
|
+ }
|
|
|
},
|
|
|
handleGroupSelect(e, row, index, value) {
|
|
|
// if (this.selected.length > 0) {
|
|
|
@@ -378,6 +615,56 @@ export default {
|
|
|
// });
|
|
|
// }
|
|
|
row.employee_id = e;
|
|
|
+ if(this.currencyTag == 1){
|
|
|
+ this.tableData.forEach(item=>{
|
|
|
+ this.wood_select.forEach(_item=>{
|
|
|
+ if(item.id == _item.id){
|
|
|
+ item._checked = true;
|
|
|
+ _item.employee_id = item.employee_id;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.currencyTag == 2){
|
|
|
+ this.tableData.forEach(item=>{
|
|
|
+ this.paint_select.forEach(_item=>{
|
|
|
+ if(item.id == _item.id){
|
|
|
+ item._checked = true;
|
|
|
+ _item.employee_id = item.employee_id;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.currencyTag == 3){
|
|
|
+ this.tableData.forEach(item=>{
|
|
|
+ this.packing_select.forEach(_item=>{
|
|
|
+ if(item.id == _item.id){
|
|
|
+ item._checked = true;
|
|
|
+ _item.employee_id = item.employee_id;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.currencyTag == 4){
|
|
|
+ this.tableData.forEach(item=>{
|
|
|
+ this.transit_select.forEach(_item=>{
|
|
|
+ if(item.id == _item.id){
|
|
|
+ item._checked = true;
|
|
|
+ _item.employee_id = item.employee_id;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.currencyTag == 5){
|
|
|
+ this.tableData.forEach(item=>{
|
|
|
+ this.install_select.forEach(_item=>{
|
|
|
+ if(item.id == _item.id){
|
|
|
+ item._checked = true;
|
|
|
+ _item.employee_id = item.employee_id;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
// 监听属性 类似于data概念
|
|
|
@@ -398,9 +685,13 @@ export default {
|
|
|
.pageSlotStyle {
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
- margin-top: 40px;
|
|
|
+ margin-top: 50px;
|
|
|
}
|
|
|
/deep/ .ivu-table-wrapper {
|
|
|
overflow: visible;
|
|
|
}
|
|
|
+.main{
|
|
|
+ height:600px;
|
|
|
+
|
|
|
+}
|
|
|
</style>
|