|
@@ -87,148 +87,136 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
- export default {
|
|
|
|
- data () {
|
|
|
|
- return {
|
|
|
|
- tableData: [],
|
|
|
|
- key_tableData: {},
|
|
|
|
- send_goods_out: {},
|
|
|
|
- data: {},
|
|
|
|
- send_goods_out_product: {},
|
|
|
|
- is_show: true,
|
|
|
|
- is_use: false,
|
|
|
|
- total_num: 0,
|
|
|
|
- scan_num: 0,
|
|
|
|
- saveData: 0,
|
|
|
|
- transport_total: 0,
|
|
|
|
- scan_data: [],
|
|
|
|
- is_box_data: [],
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- mounted () {
|
|
|
|
- // if (localStorage.getItem('fyy_target')) {
|
|
|
|
- // data.target = JSON.parse(localStorage.getItem('fyy_target'))
|
|
|
|
- // }
|
|
|
|
- this.tableData = []
|
|
|
|
- const data = {
|
|
|
|
- url: 'http://121.36.142.167:7774/jbl/api/module-data/send_goods_out/send_goods_out/474061443708694528/479522916090908672',
|
|
|
|
- // post: {"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[{"field":"dispatch_orders.dispatch_no","option":"LIKE_ANYWHERE","values":[v]},{"field":"product_no","option":"LIKE_ANYWHERE","values":["BC030101000001"]}],"size":15,"specialConditions":[],"workflowSearchBean":{},"dynamicFormCode":"dispatch_orders","dynamicFormTable":null,"ignoreField":true,"developmentSystemId":null,"debugFlag":true},
|
|
|
|
- header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOLFJPTEVfSU5URVJGQUNFIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0Njc0MTE0fQ.L3Di3K_cpF0rWSgvzbcLufLm8bkCxd3Y-xudfKzSm4F-qdpDr0hYWWQP5K5BYTNuZnu4tWpGmSW2KRHU0pjt-A', 'Content-Type:application/json']
|
|
|
|
- }
|
|
|
|
- // console.log(data);
|
|
|
|
- this.initData(data)
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- // console.log(data);
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- //原始数据获取
|
|
|
|
- initData (row) {
|
|
|
|
- this.axios.post('/api/testdwyget', { ...row }).then(res => {
|
|
|
|
- this.tableData.push(...res.data.data.send_goods_out_product);
|
|
|
|
- res.data.data.send_goods_out_product.forEach((element, index) => {
|
|
|
|
- this.data = res.data;
|
|
|
|
- this.total_num = this.total_num + element.this_delivery_qty
|
|
|
|
- this.transport_total = this.transport_total + element.out_qty
|
|
|
|
- this.key_tableData[element.bus_item_id] = element;
|
|
|
|
- if(element.box_orders_show){
|
|
|
|
- this.is_box_data.push(this.deelUniqueKey(element));
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+export default {
|
|
|
|
+ data () {
|
|
|
|
+ return {
|
|
|
|
+ tableData: [],
|
|
|
|
+ key_tableData: {},
|
|
|
|
+ send_goods_out: {},
|
|
|
|
+ data: {},
|
|
|
|
+ send_goods_out_product: {},
|
|
|
|
+ is_show: true,
|
|
|
|
+ is_use: false,
|
|
|
|
+ total_num: 0,
|
|
|
|
+ scan_num: 0,
|
|
|
|
+ saveData: 0,
|
|
|
|
+ transport_total: 0,
|
|
|
|
+ scan_data: [],
|
|
|
|
+ is_box_data: [],
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ mounted () {
|
|
|
|
+ // if (localStorage.getItem('fyy_target')) {
|
|
|
|
+ // data.target = JSON.parse(localStorage.getItem('fyy_target'))
|
|
|
|
+ // }
|
|
|
|
+ this.tableData = []
|
|
|
|
+ const id = this.$route.query.id
|
|
|
|
+ const data = {
|
|
|
|
+ url: `http://121.36.142.167:7774/jbl/api/module-data/send_goods_out/send_goods_out/474061443708694528/${id}`
|
|
|
|
+ // post: {"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[{"field":"dispatch_orders.dispatch_no","option":"LIKE_ANYWHERE","values":[v]},{"field":"product_no","option":"LIKE_ANYWHERE","values":["BC030101000001"]}],"size":15,"specialConditions":[],"workflowSearchBean":{},"dynamicFormCode":"dispatch_orders","dynamicFormTable":null,"ignoreField":true,"developmentSystemId":null,"debugFlag":true},
|
|
|
|
+ }
|
|
|
|
+ // console.log(data);
|
|
|
|
+ this.initData(data)
|
|
|
|
+ // console.log(data);
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ // 原始数据获取
|
|
|
|
+ initData (row) {
|
|
|
|
+ this.axios.post('/api/testdwyget', { ...row }).then(res => {
|
|
|
|
+ this.tableData.push(...res.data.data.send_goods_out_product);
|
|
|
|
+ res.data.data.send_goods_out_product.forEach((element, index) => {
|
|
|
|
+ this.data = res.data
|
|
|
|
+ this.total_num = this.total_num + element.this_delivery_qty
|
|
|
|
+ this.transport_total = this.transport_total + element.out_qty
|
|
|
|
+ this.key_tableData[element.bus_item_id] = element;
|
|
|
|
+ if (element.box_orders_show) {
|
|
|
|
+ this.is_box_data.push(this.deelUniqueKey(element));
|
|
|
|
+ }
|
|
|
|
+ })
|
|
const dataBox = {
|
|
const dataBox = {
|
|
url: 'http://121.36.142.167:7774/jbl/api/module-data/box_orders/box_orders/diy/defective_order_no_list',
|
|
url: 'http://121.36.142.167:7774/jbl/api/module-data/box_orders/box_orders/diy/defective_order_no_list',
|
|
- post: { "defective_order_no_list":["BZ00025"]},
|
|
|
|
- header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOLFJPTEVfSU5URVJGQUNFIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0Njc0MTE0fQ.L3Di3K_cpF0rWSgvzbcLufLm8bkCxd3Y-xudfKzSm4F-qdpDr0hYWWQP5K5BYTNuZnu4tWpGmSW2KRHU0pjt-A', 'Content-Type:application/json']
|
|
|
|
|
|
+ post: { "defective_order_no_list":["BZ00025"]}
|
|
}
|
|
}
|
|
- this.initDataBox(dataBox)
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- //扫描数据获取
|
|
|
|
- initDataBox (row) {
|
|
|
|
- this.axios.post('/api/testdwy', { ...row }).then(res => {
|
|
|
|
- let scan_data = [];
|
|
|
|
-
|
|
|
|
- res.data.data.forEach((element, index) => {
|
|
|
|
- let object = {"order_item_id":element.order_item_id,"order_no":element.order_no,"box_num":element.box_num,"product_no":element.product_no,"box_no":element.box_orders.defective_order_no,"box_id":element.box_orders.id};
|
|
|
|
- this.scan_data.push(object);
|
|
|
|
|
|
+ this.initDataBox(dataBox)})
|
|
|
|
+ },
|
|
|
|
+ // 扫描数据获取
|
|
|
|
+ initDataBox (row) {
|
|
|
|
+ this.axios.post('/api/testdwy', { ...row }).then(res => {
|
|
|
|
+ res.data.data.forEach((element, index) => {
|
|
|
|
+ let object = {"order_item_id":element.order_item_id,"order_no":element.order_no,"box_num":element.box_num,"product_no":element.product_no,"box_no":element.box_orders.defective_order_no,"box_id":element.box_orders.id};
|
|
|
|
+ this.scan_data.push(object)
|
|
})
|
|
})
|
|
this.deelTableData();
|
|
this.deelTableData();
|
|
})
|
|
})
|
|
- },
|
|
|
|
- deelUniqueKey(element){
|
|
|
|
- let key = element.box_orders_show
|
|
|
|
- return key;
|
|
|
|
- },
|
|
|
|
- //将原始数据处理拼接成提交的数据
|
|
|
|
- deelTableData(){
|
|
|
|
- let new_table_data = [];
|
|
|
|
- this.scan_data.forEach((element, index) => {
|
|
|
|
- if(this.is_box_data.indexOf(element.box_no) == -1&&Object.keys(this.key_tableData).indexOf(element.order_item_id) != -1&&(this.key_tableData[element.order_item_id].this_delivery_qty-element.box_num)>0){
|
|
|
|
-
|
|
|
|
- let table_data_detail = JSON.parse(JSON.stringify(this.key_tableData[element.order_item_id]));
|
|
|
|
- table_data_detail.box_orders = element.box_id;
|
|
|
|
- table_data_detail.box_orders_show = element.box_no;
|
|
|
|
- table_data_detail.out_qty = element.box_num;
|
|
|
|
- table_data_detail.this_delivery_qty = element.box_num;
|
|
|
|
- table_data_detail.id = null;
|
|
|
|
- this.key_tableData[element.order_item_id].this_delivery_qty -= element.box_num;
|
|
|
|
- new_table_data.push(table_data_detail)
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ deelUniqueKey(element){
|
|
|
|
+ let key = element.box_orders_show
|
|
|
|
+ return key;
|
|
|
|
+ },
|
|
|
|
+ // 将原始数据处理拼接成提交的数据
|
|
|
|
+ deelTableData () {
|
|
|
|
+ let new_table_data = [];
|
|
|
|
+ this.scan_data.forEach((element, index) => {
|
|
|
|
+ if (this.is_box_data.indexOf(element.box_no) === -1 && Object.keys(this.key_tableData).indexOf(element.order_item_id) !== -1 && (this.key_tableData[element.order_item_id].this_delivery_qty-element.box_num)>0){
|
|
|
|
+ let table_data_detail = JSON.parse(JSON.stringify(this.key_tableData[element.order_item_id]))
|
|
|
|
+ table_data_detail.box_orders = element.box_id;
|
|
|
|
+ table_data_detail.box_orders_show = element.box_no;
|
|
|
|
+ table_data_detail.out_qty = element.box_num;
|
|
|
|
+ table_data_detail.this_delivery_qty = element.box_num;
|
|
|
|
+ table_data_detail.id = null;
|
|
|
|
+ this.key_tableData[element.order_item_id].this_delivery_qty -= element.box_num;
|
|
|
|
+ new_table_data.push(table_data_detail)
|
|
|
|
+ }
|
|
})
|
|
})
|
|
-
|
|
|
|
- this.tableData.forEach((element, index) => {
|
|
|
|
- if(element.this_delivery_qty > 0 ){
|
|
|
|
|
|
+ this.tableData.forEach((element, index) => {
|
|
|
|
+ if (element.this_delivery_qty > 0 ){
|
|
new_table_data.push(element)
|
|
new_table_data.push(element)
|
|
}
|
|
}
|
|
- })
|
|
|
|
- this.tableData = new_table_data;
|
|
|
|
-
|
|
|
|
|
|
+ })
|
|
|
|
+ this.tableData = new_table_data;
|
|
},
|
|
},
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- //end
|
|
|
|
- handelGoSure (qcode) {
|
|
|
|
- console.log( this.tableData );
|
|
|
|
- this.tableData.forEach((element, index) => {
|
|
|
|
- element.item_num = (index+1)
|
|
|
|
- })
|
|
|
|
- this.data.data.send_goods_out_product =this.tableData
|
|
|
|
-
|
|
|
|
- console.log(JSON.stringify(this.data));
|
|
|
|
- },
|
|
|
|
- handleReturn () {
|
|
|
|
- localStorage.removeItem('fyy_target')
|
|
|
|
- this.$router.push('/cms/finish')
|
|
|
|
- },
|
|
|
|
- handleChoose (item, index) {
|
|
|
|
- item.is_choose = !item.is_choose
|
|
|
|
- this.tableData.splice(index, 1, item)
|
|
|
|
- },
|
|
|
|
- handleShow () {
|
|
|
|
- this.is_show = !this.is_show
|
|
|
|
- console.log(document.getElementsByClassName('header'))
|
|
|
|
- if (this.is_show) {
|
|
|
|
- document.getElementsByClassName('header')[0].style = 'height:7rem;overflow:hidden;transition:all .4s;'
|
|
|
|
- setTimeout(() => {
|
|
|
|
- document.getElementsByClassName('header')[0].style = 'overflow:none;'
|
|
|
|
|
|
+ handelGoSure () {
|
|
|
|
+ console.log(this.tableData)
|
|
|
|
+ this.tableData.forEach((element, index) => {
|
|
|
|
+ element.item_num = (index + 1)
|
|
|
|
+ })
|
|
|
|
+ this.data.data.send_goods_out_product = this.tableData
|
|
|
|
+ let data = {
|
|
|
|
+ url:'http://121.36.142.167:7774/jbl/api/module-data/send_goods_out/send_goods_out',
|
|
|
|
+ post: this.data
|
|
|
|
+ }
|
|
|
|
+ this.axios.post('/api/testdwy', data).then(res => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$Message.success(res.msg)
|
|
|
|
+ this.$router.go(-1)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ // console.log(JSON.stringify(this.data))
|
|
|
|
+ },
|
|
|
|
+ handleReturn () {
|
|
|
|
+ localStorage.removeItem('fyy_target')
|
|
|
|
+ this.$router.push('/cms/finish')
|
|
|
|
+ },
|
|
|
|
+ handleChoose (item, index) {
|
|
|
|
+ item.is_choose = !item.is_choose
|
|
|
|
+ this.tableData.splice(index, 1, item)
|
|
|
|
+ },
|
|
|
|
+ handleShow () {
|
|
|
|
+ this.is_show = !this.is_show
|
|
|
|
+ console.log(document.getElementsByClassName('header'))
|
|
|
|
+ if (this.is_show) {
|
|
|
|
+ document.getElementsByClassName('header')[0].style = 'height:7rem;overflow:hidden;transition:all .4s;'
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ document.getElementsByClassName('header')[0].style = 'overflow:none;'
|
|
this.is_use = false
|
|
this.is_use = false
|
|
}, 400)
|
|
}, 400)
|
|
- } else {
|
|
|
|
- this.is_use = true
|
|
|
|
- document.getElementsByClassName('header')[0].style = 'height:2.7rem;overflow:hidden;transition:all .4s;'
|
|
|
|
- }
|
|
|
|
|
|
+ } else {
|
|
|
|
+ this.is_use = true
|
|
|
|
+ document.getElementsByClassName('header')[0].style = 'height:2.7rem;overflow:hidden;transition:all .4s;'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
.header {
|
|
.header {
|