|
@@ -2,11 +2,9 @@
|
|
|
<div>
|
|
|
<div class="content">
|
|
|
<div v-for="(item, index) in list" :key="index" class="item">
|
|
|
- <div class="add" @click="handleAdd(item, index)">+</div>
|
|
|
- <div class="delete" @click="handleDelete(index)">x</div>
|
|
|
<div class="unit" style="display: flex">
|
|
|
<label style="width: 40%">派工单号:</label>
|
|
|
- <div style="width: 60%">{{ item.dispatch_no }}</div>
|
|
|
+ <div style="width: 60%;word-break: break-all">{{ formData.dispatch_no }}</div>
|
|
|
</div>
|
|
|
<div style="display: flex" class="unit">
|
|
|
<label style="width: 40%">产品名称:</label>
|
|
@@ -18,14 +16,14 @@
|
|
|
size="small"
|
|
|
placeholder="请输入"
|
|
|
style="width: 70%; padding: 0 0 0 0.2rem"
|
|
|
- v-model="item.quantity"
|
|
|
+ v-model="item['dispatch_num']"
|
|
|
type="number"
|
|
|
/>
|
|
|
</div>
|
|
|
<div class="unit">
|
|
|
<label>班组:</label>
|
|
|
<b-form-select
|
|
|
- v-model="item.team_id"
|
|
|
+ v-model="formData.team_id"
|
|
|
:options="teamList"
|
|
|
style="
|
|
|
height: 1.4rem;
|
|
@@ -34,6 +32,7 @@
|
|
|
border-radius: 0.6rem;
|
|
|
background: #fff;
|
|
|
"
|
|
|
+ @change="handleChooseTeam"
|
|
|
>
|
|
|
<template v-slot:first>
|
|
|
<b-form-select-option value="" disabled
|
|
@@ -44,23 +43,19 @@
|
|
|
</div>
|
|
|
<div class="unit">
|
|
|
<label>人员:</label>
|
|
|
- <b-form-select
|
|
|
- v-model="item.employee_id"
|
|
|
- :options="employeeList"
|
|
|
- style="
|
|
|
- height: 1.4rem;
|
|
|
+ <Select
|
|
|
+ v-model="formData.employee_id"
|
|
|
+ style="
|
|
|
width: 70%;
|
|
|
- border: 0.1rem solid;
|
|
|
- border-radius: 0.6rem;
|
|
|
background: #fff;
|
|
|
"
|
|
|
+ size='small'
|
|
|
+ transfer
|
|
|
+ multiple
|
|
|
+ :disabled="!formData.team_id"
|
|
|
>
|
|
|
- <template v-slot:first>
|
|
|
- <b-form-select-option value="" disabled
|
|
|
- >请选择人员</b-form-select-option
|
|
|
- >
|
|
|
- </template></b-form-select
|
|
|
- >
|
|
|
+ <Option v-for="item in employeeList" :key="item.id" :label="item.text" :value="item.value"/>
|
|
|
+ </Select>
|
|
|
</div>
|
|
|
|
|
|
<div class="unit">
|
|
@@ -123,8 +118,7 @@
|
|
|
+
|
|
|
</div>
|
|
|
<div class="boo" @click="handleBreakCancel(_index, item, index)">
|
|
|
- -
|
|
|
- </div>
|
|
|
+ -</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -176,100 +170,140 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
export default {
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
list: [],
|
|
|
- email: "",
|
|
|
- name: "",
|
|
|
- food: null,
|
|
|
- checked: [],
|
|
|
- form: {},
|
|
|
+ name: '',
|
|
|
+ formData: {},
|
|
|
teamList: [],
|
|
|
employeeList: [],
|
|
|
equipmentList: [],
|
|
|
state: true,
|
|
|
- breakList: [
|
|
|
- { value: 1, text: '碳化' },
|
|
|
- { value: 2, text: '起泡' },
|
|
|
- ],
|
|
|
+ breakList: []
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
- this.axios.post('/api/finishedOrderDetailsList', { id: this.$route.query.id.split(',') }).then(res => {
|
|
|
- this.list = res.data.list;
|
|
|
- this.list.forEach(v => {
|
|
|
- v.break = [
|
|
|
- { break_id: '', break_num: 0 }
|
|
|
- ];
|
|
|
- })
|
|
|
- })
|
|
|
- //获取班组
|
|
|
- this.axios.post('/api/teamList').then(res => {
|
|
|
- this.teamList = res.data.data;
|
|
|
- this.teamList.forEach(v => {
|
|
|
- v.value = v.id;
|
|
|
- v.text = v.title;
|
|
|
- })
|
|
|
- })
|
|
|
- //获取人员
|
|
|
- this.axios.post('/api/employeeList').then(res => {
|
|
|
- this.employeeList = res.data.data;
|
|
|
- this.employeeList.forEach(v => {
|
|
|
- v.value = v.id;
|
|
|
- v.text = v.emp_name
|
|
|
+ created () {
|
|
|
+ // 获取不良品原因
|
|
|
+ const data2 = {
|
|
|
+ url: 'http://121.36.142.167:7774/jbl/api/module-data/defective_list/page',
|
|
|
+ post: {"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[],"size":15,"specialConditions":[],"dynamicFormCode":"defective","developmentSystemId":null,"debugFlag":true},
|
|
|
+ header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MjM3NzIyfQ.aO1_RGWVxXygefwuUg_au3ys71zc2KuIbxZNWgTBeLRK9JVEqQZeza4X1gtoA8_BxoKZUuaPnTP9gUrEGgF3UQ', 'Content-Sign: 5fb0ea21d28dc57425577987fbeaf1dc', 'Content-Type:application/json']
|
|
|
+ }
|
|
|
+ this.axios.post('/api/testdwy', { ...data2 }).then(res => {
|
|
|
+ this.breakList = res.data.content.filter(v => v.status)
|
|
|
+ this.breakList.forEach(v => {
|
|
|
+ v.value = v.defective_code
|
|
|
+ v.text = v.title
|
|
|
})
|
|
|
})
|
|
|
- //获取设备
|
|
|
- this.axios.post('/api/equipmentList').then(res => {
|
|
|
- this.equipmentList = res.data.data;
|
|
|
+ // 获取设备
|
|
|
+ const data1 = {
|
|
|
+ url: 'http://121.36.142.167:7774/jbl/api/module-data/device_list/page',
|
|
|
+ post: {"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[],"size":15,"specialConditions":[],"dynamicFormCode":"device","developmentSystemId":null,"debugFlag":true},
|
|
|
+ header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MjM3NzIyfQ.aO1_RGWVxXygefwuUg_au3ys71zc2KuIbxZNWgTBeLRK9JVEqQZeza4X1gtoA8_BxoKZUuaPnTP9gUrEGgF3UQ', 'Content-Sign: 27a0ae807d9437f5fdad7449cdf52e08', 'Content-Type:application/json']
|
|
|
+ }
|
|
|
+ this.axios.post('/api/testdwy', { ...data1 }).then(res => {
|
|
|
+ this.equipmentList = res.data.content.filter(v => v.status)
|
|
|
this.equipmentList.forEach(v => {
|
|
|
- v.value = v.id;
|
|
|
- v.text = v.title;
|
|
|
+ v.value = v.device_code
|
|
|
+ v.text = v.title
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ mounted () {
|
|
|
+ this.list = []
|
|
|
+ const id = this.$route.query.id.split(',')
|
|
|
+ this.initData(id)
|
|
|
+ },
|
|
|
methods: {
|
|
|
- handleBreakAdd(_index, item, index) {
|
|
|
+ async initData (id) {
|
|
|
+ // 获取班组
|
|
|
+ const data1 = {
|
|
|
+ url: 'http://121.36.142.167:7774/jbl/api/module-data/team_list/page',
|
|
|
+ post: {"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[],"size":15,"specialConditions":[],"dynamicFormCode":"team","developmentSystemId":null,"debugFlag":true},
|
|
|
+ header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MjM3NzIyfQ.aO1_RGWVxXygefwuUg_au3ys71zc2KuIbxZNWgTBeLRK9JVEqQZeza4X1gtoA8_BxoKZUuaPnTP9gUrEGgF3UQ', 'Content-Sign: 88cb27fd67215452422c18f3ed71028e', 'Content-Type:application/json']
|
|
|
+ }
|
|
|
+ await this.axios.post('/api/testdwy', { ...data1 }).then(res => {
|
|
|
+ this.teamList = res.data.content.filter(v => v.status)
|
|
|
+ this.teamList.forEach(v => {
|
|
|
+ v.value = v.team_code
|
|
|
+ v.text = v.title
|
|
|
+ })
|
|
|
+ })
|
|
|
+ for(const v in id){
|
|
|
+ const data = {
|
|
|
+ url: `http://121.36.142.167:7774/jbl/api/module-data/dispatch_orders/dispatch_orders/474048895554891776/${id[v]}`,
|
|
|
+ header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MjM3NzIyfQ.aO1_RGWVxXygefwuUg_au3ys71zc2KuIbxZNWgTBeLRK9JVEqQZeza4X1gtoA8_BxoKZUuaPnTP9gUrEGgF3UQ', 'Content-Type:application/json']
|
|
|
+ }
|
|
|
+ await this.axios.post('/api/testdwyget', { ...data }).then(res => {
|
|
|
+ this.list.push(...res.data.data['dispatch_orders_dtl'])
|
|
|
+ this.formData = res.data.data['dispatch_orders']
|
|
|
+ this.formData.employee_id = []
|
|
|
+ if (this.formData.team_id) {
|
|
|
+ // 获取班组下的人员
|
|
|
+ console.log((this.teamList))
|
|
|
+ const id = this.teamList.find(v => v.team_code === this.formData.team_id).dynamic_form_value_id
|
|
|
+ const data = {
|
|
|
+ url: `http://121.36.142.167:7774/jbl/api/module-data/team/team/472629516238663680/${id}`,
|
|
|
+ header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MjM3NzIyfQ.aO1_RGWVxXygefwuUg_au3ys71zc2KuIbxZNWgTBeLRK9JVEqQZeza4X1gtoA8_BxoKZUuaPnTP9gUrEGgF3UQ', 'Content-Type:application/json']
|
|
|
+ }
|
|
|
+ this.axios.post('/api/testdwyget', { ...data }).then(res => {
|
|
|
+ this.employeeList = res.data.data.employee
|
|
|
+ this.employeeList.forEach(v => {
|
|
|
+ v.value = v.team_code
|
|
|
+ v.text = v.team_code_show
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.list.forEach(v => {
|
|
|
+ v.team_id = this.formData.team_id
|
|
|
+ v.break = [
|
|
|
+ { break_id: '', break_num: 0 }
|
|
|
+ ]
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleBreakAdd (_index, item, index) {
|
|
|
item.break.splice(_index + 1, 0, {
|
|
|
break_id: '',
|
|
|
break_num: 0
|
|
|
})
|
|
|
- this.list.splice(index, 1, item);
|
|
|
+ this.list.splice(index, 1, item)
|
|
|
},
|
|
|
- handleBreakCancel(_index, item, index) {
|
|
|
- if (_index == 0) {
|
|
|
+ handleBreakCancel (_index, item, index) {
|
|
|
+ if (_index === 0) {
|
|
|
item.break = [{ break_id: '', break_num: 0 }]
|
|
|
} else {
|
|
|
- item.break.splice(_index, 1);
|
|
|
+ item.break.splice(_index, 1)
|
|
|
}
|
|
|
- this.list.splice(index, 1, item);
|
|
|
- },
|
|
|
- handleReturn() {
|
|
|
- this.$router.go(-1);
|
|
|
+ this.list.splice(index, 1, item)
|
|
|
},
|
|
|
- handleDelete(index) {
|
|
|
- if (this.list.length == 1) {
|
|
|
- return
|
|
|
- } else {
|
|
|
- this.list.splice(index, 1);
|
|
|
- }
|
|
|
+ handleReturn () {
|
|
|
+ this.$router.go(-1)
|
|
|
},
|
|
|
- handleAdd(item, index) {
|
|
|
- if (!item.quantity) {
|
|
|
- return
|
|
|
+ handleChooseTeam (e) {
|
|
|
+ if (e) {
|
|
|
+ this.formData.team_id = e
|
|
|
+ // 获取班组下的人员
|
|
|
+ const id = this.teamList.find(v => v.team_code === this.formData.team_id).dynamic_form_value_id
|
|
|
+ const data = {
|
|
|
+ url: `http://121.36.142.167:7774/jbl/api/module-data/team/team/472629516238663680/${id}`,
|
|
|
+ header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MjM3NzIyfQ.aO1_RGWVxXygefwuUg_au3ys71zc2KuIbxZNWgTBeLRK9JVEqQZeza4X1gtoA8_BxoKZUuaPnTP9gUrEGgF3UQ', 'Content-Type:application/json']
|
|
|
+ }
|
|
|
+ this.axios.post('/api/testdwyget', { ...data }).then(res => {
|
|
|
+ this.employeeList = res.data.data.employee
|
|
|
+ this.employeeList.forEach(v => {
|
|
|
+ v.value = v.team_code
|
|
|
+ v.text = v.team_code_show
|
|
|
+ })
|
|
|
+ this.formData.employee_id = []
|
|
|
+ })
|
|
|
} else {
|
|
|
- let copy = JSON.parse(JSON.stringify(item));
|
|
|
- copy.quantity = Math.floor(item.quantity / 2) + item.quantity % 2;
|
|
|
- copy.break = [{
|
|
|
- break_id: '', break_num: 0
|
|
|
- }]
|
|
|
- item.quantity = Math.floor(item.quantity / 2);
|
|
|
- this.list.splice(index, 1, item);
|
|
|
- this.list.splice(index + 1, 0, copy);
|
|
|
+ this.formData.employee_id = []
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
- handleSure() {
|
|
|
+ handleSure () {
|
|
|
let data = [];
|
|
|
this.list.forEach(v => {
|
|
|
let obj = {};
|
|
@@ -285,14 +319,13 @@ export default {
|
|
|
} else {
|
|
|
this.state = false;
|
|
|
this.axios.post('/api/mobileFinishedOrderAdd', { ...data }).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
+ if (res.code === 200) {
|
|
|
this.state = true
|
|
|
this.$Message.success(res.msg);
|
|
|
this.handleReturn()
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -352,31 +385,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-// .footer {
|
|
|
-// position: absolute;
|
|
|
-// bottom: 7rem;
|
|
|
-// height: 3rem;
|
|
|
-
|
|
|
-// width: 100%;
|
|
|
-// border-top: 0.2rem solid #8a8888;
|
|
|
-// }
|
|
|
-// .footer_content {
|
|
|
-// display: flex;
|
|
|
-// flex-wrap: wrap;
|
|
|
-// font-size: 0.8rem;
|
|
|
-// > div {
|
|
|
-// width: 50%;
|
|
|
-// display: flex;
|
|
|
-// label {
|
|
|
-// width: 45%;
|
|
|
-// text-align: center;
|
|
|
-// }
|
|
|
-// div {
|
|
|
-// width: 60%;
|
|
|
-// text-align: center;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
.footer_btn {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
@@ -393,4 +401,7 @@ export default {
|
|
|
margin: 0.5rem;
|
|
|
border: 0.1rem solid;
|
|
|
}
|
|
|
-</style>
|
|
|
+::v-deep ul.ivu-select-dropdown-list{
|
|
|
+ padding: 0 !important;
|
|
|
+}
|
|
|
+</style>
|