|
@@ -193,19 +193,17 @@
|
|
|
>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <span>未完成数量</span>
|
|
|
+ <span>生产数量</span>
|
|
|
<span>
|
|
|
- {{ choose.un_complete }}(总数:{{
|
|
|
+ {{
|
|
|
choose.on_complete + choose.un_complete
|
|
|
- }})
|
|
|
+ }}
|
|
|
</span>
|
|
|
</div>
|
|
|
<div>
|
|
|
<span>未打印数量</span>
|
|
|
<span
|
|
|
- >{{ choose.un_print }}(总数:{{
|
|
|
- choose.on_print + choose.un_print
|
|
|
- }})</span
|
|
|
+ >{{ choose.un_print }}</span
|
|
|
>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -445,7 +443,7 @@
|
|
|
<div>
|
|
|
<span>数量:</span>
|
|
|
<InputNumber
|
|
|
- :max="selectedObj.un_print"
|
|
|
+ :max="selectedObj.un_print==0?selectedObj.on_print:selectedObj.un_print"
|
|
|
:min="0"
|
|
|
size="large"
|
|
|
@on-focus="handlePrintInput"
|
|
@@ -548,6 +546,7 @@
|
|
|
<Modal
|
|
|
class="selection-modal"
|
|
|
v-model="roomModal"
|
|
|
+ @on-cancel ='handleRoomCancel'
|
|
|
title="选择房间号"
|
|
|
width="80%"
|
|
|
>
|
|
@@ -591,7 +590,7 @@
|
|
|
<Modal
|
|
|
class=""
|
|
|
v-model="finishWork"
|
|
|
-
|
|
|
+ @on-cancel ='handleCancel'
|
|
|
width="80%"
|
|
|
>
|
|
|
<div slot="header" style="text-align:center;font-weight:bold"><h1>完 工</h1></div>
|
|
@@ -600,38 +599,38 @@
|
|
|
<div style="display:flex">
|
|
|
<span style="width:2rem;font-size: 0.4rem;margin: 0.6em;">工序</span>
|
|
|
<div style="display:flex;flex-wrap: wrap;">
|
|
|
- <span v-for="item in produceList" :key="item.id" @click="changeChooseProduceList(item)" :style="item.isChoosed?{border: '2px solid #83b2e3',fontSize: '0.4rem',padding: '0.1em 0.2rem',borderRadius: '5px',margin: '0.6em',color:'#ffffff',backgroundColor:'#83b2e3',cursor: 'pointer'}:{border: '2px solid #83b2e3',fontSize: '0.4rem',padding: '0.1em 0.2rem',borderRadius: '5px',margin: '0.6em',color:'#83b2e3',cursor: 'pointer'}">
|
|
|
+ <span v-for="item in produceList" :key="item.id" @click="changeChooseProduceList(item)" :style="item.isChoosed?{border: '2px solid #2D8CF0',fontSize: '0.4rem',padding: '0.1em 0.2rem',borderRadius: '5px',margin: '0.6em',color:'#ffffff',backgroundColor:'#2D8CF0',cursor: 'pointer'}:{border: '2px solid #2D8CF0',fontSize: '0.4rem',padding: '0.1em 0.2rem',borderRadius: '5px',margin: '0.6em',color:'#2D8CF0',cursor: 'pointer'}">
|
|
|
{{item.title}}
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="display:flex">
|
|
|
- <span style="width:3rem;font-size: 0.4rem;margin: 0.6em;">班组</span>
|
|
|
+ <span style="width:3.4rem;font-size: 0.4rem;margin: 0.6em;">班组</span>
|
|
|
<div style="display:flex;flex-wrap:wrap">
|
|
|
- <span v-for="_item in employeeList" :key="_item.id" @click="changeChooseEmployeeList(_item)" :style="_item.isChoosed?{border: '2px solid #83b2e3',fontSize: '0.4rem',padding: '0.1em 0.2rem',borderRadius: '5px',margin: '0.6em',color:'#ffffff',backgroundColor:'#83b2e3',cursor: 'pointer'}:{border: '2px solid #83b2e3',fontSize: '0.4rem',padding: '0.1em 0.2rem',borderRadius: '5px',margin: '0.6em',color:'#83b2e3',cursor: 'pointer'}" >
|
|
|
+ <span v-for="_item in employeeList" :key="_item.id" @click="changeChooseEmployeeList(_item)" :style="_item.isChoosed?{border: '2px solid #2D8CF0',fontSize: '0.4rem',padding: '0.1em 0.2rem',borderRadius: '5px',margin: '0.6em',color:'#ffffff',backgroundColor:'#2D8CF0',cursor: 'pointer'}:{border: '2px solid #2D8CF0',fontSize: '0.4rem',padding: '0.1em 0.2rem',borderRadius: '5px',margin: '0.6em',color:'#2D8CF0',cursor: 'pointer'}" >
|
|
|
{{_item.nickname}}
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="width:40%;overflow:auto;">
|
|
|
-
|
|
|
- <div v-for="item in rownoList" :key="item.id" style="display:flex;justify-content: space-between;align-items: center;width: 100%;font-size:0.4rem;margin-bottom:0.5rem">
|
|
|
- <van-number-keyboard
|
|
|
+ <van-number-keyboard
|
|
|
:show="show5"
|
|
|
@blur="show5 = false"
|
|
|
- @input="numChange($event,item)"
|
|
|
- @delete="delChange(item)"
|
|
|
+ @input="numChange"
|
|
|
+ @delete="delChange"
|
|
|
z-index="99999"
|
|
|
/>
|
|
|
- <span style="margin-left:1rem">行号:{{item.sort}}</span><span style="width: 40%;">数量:<Input style='width:50%' size="large" v-model="item.num" @on-focus="show5 = true" clearable /></span>
|
|
|
+ <div v-for="(item,index) in rownoList" :key="item.id" style="display:flex;justify-content: space-between;align-items: center;width: 100%;font-size:0.4rem;margin-bottom:0.5rem">
|
|
|
+
|
|
|
+ <span style="margin-left:1rem">行号:{{item.sort}}</span><span style="width: 40%;">数量:<Input style='width:50%' size="large" v-model="item.num" @on-focus="focusChange(index)" clearable /></span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div slot="footer" style="text-align:center;">
|
|
|
<div style="margin-bottom:0.3rem"><h1>是否确认完工?</h1></div>
|
|
|
<Button
|
|
|
- @click="handleRoomCancel"
|
|
|
+ @click="handleCancel"
|
|
|
type="primary"
|
|
|
style="margin-right: 0.5rem;width:15%;height:1rem;font-size:0.4rem"
|
|
|
>
|
|
@@ -680,7 +679,9 @@ export default {
|
|
|
okModal: false,
|
|
|
roomModal: false,
|
|
|
contentData: [],
|
|
|
- selectedObj: {},
|
|
|
+ selectedObj: {
|
|
|
+ state:0,
|
|
|
+ },
|
|
|
ordernoObj: {
|
|
|
title: "订单编号/项目名称选择",
|
|
|
currentSearchValue: "",
|
|
@@ -728,6 +729,8 @@ export default {
|
|
|
modalRoomList: [],
|
|
|
modalRoomListSelected: [],
|
|
|
isWideScreen: localStorage.getItem("isWideScreen") || false,
|
|
|
+ focusIndex:'',
|
|
|
+ max:'',
|
|
|
};
|
|
|
},
|
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
@@ -742,25 +745,46 @@ export default {
|
|
|
},
|
|
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {
|
|
|
- this.axios.post('/api/station_get_type').then(res=>{
|
|
|
- if(res.code == 200){
|
|
|
- this.employeeList = res.data.employee_list;
|
|
|
- this.employeeList.map(item=>{
|
|
|
- item.isChoosed = false;
|
|
|
- })
|
|
|
- this.produceList = res.data.produce_list;
|
|
|
- this.produceList.map(item=>{
|
|
|
- item.isChoosed = false;
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ // this.axios.post('/api/station_get_type').then(res=>{
|
|
|
+ // if(res.code == 200){
|
|
|
+ // this.employeeList = res.data.employee_list;
|
|
|
+ // this.employeeList.map(item=>{
|
|
|
+ // item.isChoosed = false;
|
|
|
+ // })
|
|
|
+ // this.produceList = res.data.produce_list;
|
|
|
+ // this.produceList.map(item=>{
|
|
|
+ // item.isChoosed = false;
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
},
|
|
|
methods: {
|
|
|
- delChange(item){
|
|
|
- item.num = item.num.toString().substring(0,item.num.length-1)
|
|
|
+ focusChange(index){
|
|
|
+ this.focusIndex = index;
|
|
|
+ this.max = this.rownoList[index].num;
|
|
|
+ this.show5=true;
|
|
|
+ },
|
|
|
+ delChange(){
|
|
|
+ // item.num = item.num.toString().substring(0,item.num.length-1)
|
|
|
+ this.rownoList[this.focusIndex].num = this.rownoList[this.focusIndex].num.toString().substring(0,this.rownoList[this.focusIndex].num.toString().length-1);
|
|
|
+ // console.log(this.rownoList[this.focusIndex].num)
|
|
|
},
|
|
|
- numChange(e,item){
|
|
|
- item.num = item.num+''+e;
|
|
|
+ numChange(e){
|
|
|
+ // console.log(index);
|
|
|
+ // item.num = item.num+''+e;
|
|
|
+ this.rownoList[this.focusIndex].num =this.rownoList[this.focusIndex].num==='0'?'':this.rownoList[this.focusIndex].num+''+e;
|
|
|
+ console.log(this.rownoList)
|
|
|
+ if(Number(this.rownoList[this.focusIndex].num)>this.rownoList[this.focusIndex].val){
|
|
|
+ this.rownoList[this.focusIndex].num = this.rownoList[this.focusIndex].val.toString();
|
|
|
+ }
|
|
|
+ // if(this.this.rownoList[this.focusIndex].num>max){
|
|
|
+ // this.rownoList[this.focusIndex].num=max
|
|
|
+ // }
|
|
|
+ // if(Number(this.rownoList[this.focusIndex].num)>Number(max==''?'0':max)){
|
|
|
+
|
|
|
+ // this.rownoList[this.focusIndex].num =JSON.parse(JSON.stringify(max));
|
|
|
+ // console.log(this.rownoList[this.focusIndex].num)
|
|
|
+ // }
|
|
|
},
|
|
|
changeChooseEmployeeList(item){
|
|
|
this.employeeList.map(m=>{
|
|
@@ -772,6 +796,8 @@ export default {
|
|
|
})
|
|
|
if(item.isChoosed){
|
|
|
this.employeeID =item.id
|
|
|
+ }else{
|
|
|
+ this.employeeID =null;
|
|
|
}
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
@@ -795,17 +821,22 @@ export default {
|
|
|
this.axios.post('/api/station_get_order_produce',{id,produce}).then(res=>{
|
|
|
if(res.code==200){
|
|
|
this.rownoList = res.data;
|
|
|
- this.produceID = item.id
|
|
|
+ this.produceID = item.id;
|
|
|
+ this.rownoList.map(v=>{
|
|
|
+ v.val = v.num;
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
this.rownoList= [];
|
|
|
+ this.produceID = null;
|
|
|
}
|
|
|
},
|
|
|
back() {
|
|
|
this.$router.go(-1);
|
|
|
},
|
|
|
handleSelection(obj, type) {
|
|
|
+ this.saveData = [];
|
|
|
if (type == 2 && this.selectedInfo.order_no == "") {
|
|
|
return this.$Message.warning("请先选择项目");
|
|
|
}
|
|
@@ -831,6 +862,7 @@ export default {
|
|
|
this.selectionRownolModal = true;
|
|
|
},
|
|
|
handleCancelSelected(v, type) {
|
|
|
+ this.saveData = [];
|
|
|
if (type) {
|
|
|
this.selectedInfo.rows.splice(v, 1);
|
|
|
} else if (v == "product_id") {
|
|
@@ -863,11 +895,22 @@ export default {
|
|
|
row.isChoosed = true;
|
|
|
this.saveData.push(row)
|
|
|
}
|
|
|
- console.log(this.saveData)
|
|
|
+ // console.log(this.saveData)
|
|
|
if (row.un_print == 0) {
|
|
|
row.isFinished = true;
|
|
|
}
|
|
|
- this.selectedObj = row;
|
|
|
+ if(this.saveData.length == 1){
|
|
|
+ this.selectedObj = this.saveData[0];
|
|
|
+ }else{
|
|
|
+ if(this.saveData.length>1){
|
|
|
+ this.selectedObj = {};
|
|
|
+ }else{
|
|
|
+ this.selectedObj = {state:0};
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ console.log(this.selectedObj)
|
|
|
+ // this.selectedObj = row;
|
|
|
},
|
|
|
goCheckPage() {
|
|
|
localStorage.setItem("printInfo", JSON.stringify(this.selectedInfo));
|
|
@@ -1048,9 +1091,28 @@ export default {
|
|
|
// this.selectedInfo.order_no;
|
|
|
// 1 项目选择 2图号选择
|
|
|
if (row.type == 1) {
|
|
|
+ let order_no ='';
|
|
|
+ this.saveData = [];
|
|
|
this.selectedInfo.order_no = this.chooseOrderNo.order_no;
|
|
|
this.selectedInfo.residential_name = this.chooseOrderNo.residential_name;
|
|
|
this.selectionModal = false;
|
|
|
+ row.list.map(v=>{
|
|
|
+ if(v.isCurrent){
|
|
|
+ order_no = v.order_no;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.axios.post('/api/station_get_type',{order_no}).then(res=>{
|
|
|
+ if(res.code == 200){
|
|
|
+ this.employeeList = res.data.employee_list;
|
|
|
+ this.employeeList.map(item=>{
|
|
|
+ item.isChoosed = false;
|
|
|
+ })
|
|
|
+ this.produceList = res.data.produce_list;
|
|
|
+ this.produceList.map(item=>{
|
|
|
+ item.isChoosed = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
} else if (row.type == 2) {
|
|
|
this.selectedInfo.url_number = this.chooseUrlNo.url_number;
|
|
|
this.selectedInfo.product_id = this.chooseUrlNo.product_id;
|
|
@@ -1091,9 +1153,12 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
handlePrint() {
|
|
|
- if (!this.selectedObj.isChoosed) {
|
|
|
+ if(this.selectedObj.state == 0){
|
|
|
return this.$Message.warning("请选择数据");
|
|
|
}
|
|
|
+ if (!this.selectedObj.isChoosed) {
|
|
|
+ return this.$Message.warning("打印只能单选");
|
|
|
+ }
|
|
|
if (this.selectedObj.type != 1) {
|
|
|
return this.$Message.warning("该部件不含芯片,无需打印");
|
|
|
}
|
|
@@ -1149,12 +1214,25 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+ // this.selectedObj.un_print = this.selectedObj.un_print - this.selectedObj.print_num;
|
|
|
+ // if(this.selectedObj.un_print == 0){
|
|
|
+ // this.selectedObj.isFinished == true;
|
|
|
+ // this.selectedObj.print_num == this.selectedObj.on_print;
|
|
|
+ // }
|
|
|
+ this.modalRoomList.map((v) => {
|
|
|
+ v.isCurrent = false;
|
|
|
+ });
|
|
|
+ this.modalRoomListSelected = [];
|
|
|
+ this.saveData = [];
|
|
|
this.printModal = false;
|
|
|
this.roomModal = false;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
handleThen(){
|
|
|
+ if(!this.produceID||!this.employeeID){
|
|
|
+ return this.$Message.warning('请确认信息')
|
|
|
+ }
|
|
|
this.axios.post('/api/station_order_produce_complete',{produce_id:this.produceID,employee_id:this.employeeID,sort_list:this.rownoList}).then(res=>{
|
|
|
if(res.code==200){
|
|
|
this.$Message.success(res.msg);
|
|
@@ -1184,7 +1262,14 @@ export default {
|
|
|
// }
|
|
|
this.finishWork = true;
|
|
|
},
|
|
|
- handleRoomCancel() {
|
|
|
+ handleRoomCancel() {
|
|
|
+ this.modalRoomList.map((v) => {
|
|
|
+ v.isCurrent = false;
|
|
|
+ });
|
|
|
+ this.modalRoomListSelected = [];
|
|
|
+ this.roomModal = false;
|
|
|
+ },
|
|
|
+ handleCancel() {
|
|
|
this.produceList.map((v) => {
|
|
|
v.isChoosed = false;
|
|
|
});
|