|
@@ -1,29 +1,50 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <Toptitle title="码单信息">
|
|
|
- <slot name="titleButton">
|
|
|
- <Button style="margin-left:10px" type="primary">导入</Button>
|
|
|
+ <Toptitle :title="$route.query.type==1?'码单编辑':$route.query.type == 2?'码单查看':'码单新增'">
|
|
|
+ <slot name="titleButton" class="btn_set">
|
|
|
+ <div class="btn_set">
|
|
|
+ <Upload
|
|
|
+ :headers="headers"
|
|
|
+ name="your_file"
|
|
|
+ :data="uploadData"
|
|
|
+ :show-upload-list="false"
|
|
|
+ :on-error="uploadError"
|
|
|
+ :on-success="uploadSuccess"
|
|
|
+ :before-upload="handleBeforeUpload"
|
|
|
+ :action="$store.state.ip + '/api/cut_order_import'"
|
|
|
+ style="margin-right: 10px"
|
|
|
+ v-if="$route.query.type != 2"
|
|
|
+ >
|
|
|
+ <Button style="margin-left:10px" type="primary">导入</Button>
|
|
|
+ </Upload>
|
|
|
<Button style="margin-left:10px" @click="$router.go(-1)">返回</Button>
|
|
|
- <Button style="margin-left:10px">保存</Button>
|
|
|
+ <Button style="margin-left:10px" v-if="$route.query.type != 2" @click="saveData">保存</Button>
|
|
|
+ </div>
|
|
|
</slot>
|
|
|
</Toptitle>
|
|
|
<div class="weight_memo_info_content">
|
|
|
<div class="form_content">
|
|
|
<Form :label-width="85" :model="formData">
|
|
|
<FormItem label="项目编码:">
|
|
|
- <Input />
|
|
|
+ <span v-if="this.$route.query.type == 2">{{formData.project_number}}</span>
|
|
|
+ <Input size='small' v-model="formData.project_number" v-else />
|
|
|
</FormItem>
|
|
|
<FormItem label="项目名称:">
|
|
|
- <Input />
|
|
|
+ <span v-if="this.$route.query.type == 2">{{formData.product_name}}</span>
|
|
|
+ <Input v-else size='small' v-model='formData.product_name'/>
|
|
|
</FormItem>
|
|
|
<FormItem label="项目简称:">
|
|
|
- <Input />
|
|
|
+ <span v-if="this.$route.query.type == 2">{{formData.project_abbreviation}}</span>
|
|
|
+ <Input v-else size='small' v-model="formData.project_abbreviation"/>
|
|
|
</FormItem>
|
|
|
<FormItem label="下单日期:">
|
|
|
+ <span v-if="this.$route.query.type == 2">{{formData.start_time}}</span>
|
|
|
<DatePicker
|
|
|
type="date"
|
|
|
v-model="formData.start_time"
|
|
|
placeholder="年/月/日"
|
|
|
+ v-else
|
|
|
+ size='small'
|
|
|
></DatePicker>
|
|
|
</FormItem>
|
|
|
</Form>
|
|
@@ -33,21 +54,26 @@
|
|
|
<div class="table_header_left">
|
|
|
<span>图号:{{item.url_number}}</span>
|
|
|
<span>产品名称:{{item.product_title}}</span>
|
|
|
- <span :style="item.state == 1?'color:red;':''">{{item.state == 0?'未匹配':item.state == 1?'匹配完成':'匹配中'}}</span>
|
|
|
+ <span :style="item.state == 1?'':'color:red;'"
|
|
|
+ v-if="$route.query.type != 3"
|
|
|
+ >{{item.state == 0?'未匹配':item.state == 1?'匹配完成':'匹配中'}}</span>
|
|
|
</div>
|
|
|
<div class="table_header_right">
|
|
|
- <Button type="primary" size="small" :disabled="item.state==0?false:true">删除</Button>
|
|
|
+ <Button type="primary" size="small" :disabled="item.state==0?false:true" @click="del(item,index)">删除</Button>
|
|
|
<div @click="show(item,index)" style="cursor: pointer;"><span style="font-size:16px;">{{item.showType?'收缩':'展开'}}</span><Icon type="md-arrow-dropright" ref="ico" class="ico"/></div>
|
|
|
<span>总计{{item.total}}条数据</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-if="item.showType">
|
|
|
<div>
|
|
|
- <Topsearch :list="list" @searchData="initData" />
|
|
|
+ <Topsearch :list="list" @searchData="search_data" />
|
|
|
</div>
|
|
|
<div v-for="(_item,_index) in tableData" :key="_index">
|
|
|
- <div class="mate_info"><div>匹配信息:{{_item.match_info}}</div><span>总计{{_item.total}}条数据</span></div>
|
|
|
- <Table :columns="tableColumns" border :data="_item.data">
|
|
|
+ <div class="mate_info"><div>匹配信息:{{_item.value}} {{_item.number}}组</div><span>总计{{_item.children.length}}条数据</span></div>
|
|
|
+ <Table :columns="tableColumns" border :data="_item.children">
|
|
|
+ <template slot="state" slot-scope="{row}">
|
|
|
+ <span>{{row.state ==0?'未匹配':row.state ==2?'匹配完成':'匹配中'}}</span>
|
|
|
+ </template>
|
|
|
</Table>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -60,27 +86,14 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
formData: {
|
|
|
- start_time: "",
|
|
|
- },
|
|
|
- tableData:[{
|
|
|
- match_info:'w1=300 w2=550 w3==900 2组',
|
|
|
- total:3,
|
|
|
- data:[
|
|
|
- {part_title:'饰面1',line_number:2,veneer_one:'橡木',material:'12cm多层板',veneer_two:'橡木',wollens_size:'315*565*150', material_num:'121',vacuum_size:'300*550*150',part_num:'111',treatment_area:'8.88',vacuum_area:'300*200*150',technological_requirements:'按图七口',match_state:'1'},
|
|
|
- {part_title:'饰面2',line_number:3,veneer_one:'橡木',material:'12cm多层板',veneer_two:'橡木',wollens_size:'315*565*150', material_num:'3',vacuum_size:'300*550*150',part_num:'5',treatment_area:'8.88',vacuum_area:'300*200*150',technological_requirements:'按图七口',match_state:'0'},
|
|
|
- {part_title:'饰面3',line_number:3,veneer_one:'橡木',material:'12cm多层板',veneer_two:'橡木',wollens_size:'315*565*150', material_num:'2',vacuum_size:'300*550*150',part_num:'7',treatment_area:'8.88',vacuum_area:'300*200*150',technological_requirements:'按图七口',match_state:'1'},
|
|
|
- ]
|
|
|
+ start_time: null,
|
|
|
+ project_number:'',
|
|
|
+ project_abbreviation:'',
|
|
|
+ product_name:'',
|
|
|
+ id:''
|
|
|
},
|
|
|
- {
|
|
|
- match_info:'w1=300 w2=550 w3==900 3组',
|
|
|
- total:3,
|
|
|
- data:[
|
|
|
- {part_title:'饰面1',line_number:2,veneer_one:'橡木',material:'12cm多层板',veneer_two:'橡木',wollens_size:'315*565*150', material_num:'121',vacuum_size:'300*550*150',part_num:'111',treatment_area:'8.88',vacuum_area:'300*200*150',technological_requirements:'按图七口',match_state:'1'},
|
|
|
- {part_title:'饰面2',line_number:3,veneer_one:'橡木',material:'12cm多层板',veneer_two:'橡木',wollens_size:'315*565*150', material_num:'3',vacuum_size:'300*550*150',part_num:'5',treatment_area:'8.88',vacuum_area:'300*200*150',technological_requirements:'按图七口',match_state:'0'},
|
|
|
- {part_title:'饰面3',line_number:3,veneer_one:'橡木',material:'12cm多层板',veneer_two:'橡木',wollens_size:'315*565*150', material_num:'2',vacuum_size:'300*550*150',part_num:'7',treatment_area:'8.88',vacuum_area:'300*200*150',technological_requirements:'按图七口',match_state:'1'},
|
|
|
- ]
|
|
|
- }
|
|
|
- ],
|
|
|
+ tableData:[],
|
|
|
+ del_id:[],
|
|
|
searchData: {},
|
|
|
tableColumns:[
|
|
|
{ title: "序号", type:'index', align: "center", minWidth: 140 },
|
|
@@ -96,43 +109,46 @@ export default {
|
|
|
{ title: "贴皮面积", key: "treatment_area", align: "center", minWidth: 140 },
|
|
|
{ title: "精裁面积", key: "vacuum_area", align: "center", minWidth: 140 },
|
|
|
{ title: "工艺要求", key: "technological_requirements", align: "center", minWidth: 140 },
|
|
|
- { title: "匹配状态", key: "match_state", align: "center", minWidth: 140 },
|
|
|
+ { title: "匹配状态", key: "match_state", align: "center", minWidth: 140,slot:'state' },
|
|
|
],
|
|
|
- showType: false,
|
|
|
+ headers: { Authorization: localStorage.getItem("token") },//请求头
|
|
|
//进入页面需要获取的数值
|
|
|
- infoNumber:[
|
|
|
- {url_number:'001',product_title:'木饰面',state:0,total:6,showType:false},
|
|
|
- {url_number:'004',product_title:'木饰面',state:1,total:6,showType:false},
|
|
|
- {url_number:'007',product_title:'台盆柜',state:2,total:6,showType:false},
|
|
|
- ],
|
|
|
- icoState:'md-arrow-dropright',
|
|
|
+ infoNumber:[],
|
|
|
+ part_title:[],
|
|
|
+ cut_size:[],
|
|
|
+ cut_order_id:'',
|
|
|
+ cut_order_product_id:''
|
|
|
};
|
|
|
},
|
|
|
+ created(){
|
|
|
+ if(this.$route.query.type == 1||this.$route.query.type == 2){
|
|
|
+ this.axios.get('/api/cut_order_detail',{params:{cut_order_id:this.$route.query.cut_order_id,order_type:1}}).then(res=>{
|
|
|
+ this.formData.project_number = res.data.project_number;
|
|
|
+ this.formData.product_name = res.data.project_name;
|
|
|
+ this.formData.project_abbreviation = res.data.abbreviation;
|
|
|
+ this.formData.start_time = this.func.replaceDate(res.data.crt_time);
|
|
|
+ this.infoNumber = [...res.data.children];
|
|
|
+ console.log(this.infoNumber)
|
|
|
+ this.cut_order_id = res.data.cut_order_id
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
mounted(){
|
|
|
-
|
|
|
},
|
|
|
computed: {
|
|
|
list() {
|
|
|
- return [{
|
|
|
- title: "特殊尺寸",
|
|
|
- name: "Select",
|
|
|
- value: "",
|
|
|
- placeholder: "请选择",
|
|
|
- serverName: "type_id",
|
|
|
- option: [
|
|
|
- { label: "已匹配", value: 1 },
|
|
|
- { label: "未匹配", value: 0 },
|
|
|
- ]
|
|
|
- },
|
|
|
+ return [
|
|
|
{
|
|
|
title: "部件名称",
|
|
|
name: "Select",
|
|
|
value: "",
|
|
|
+ multiple: true,
|
|
|
placeholder: "请选择",
|
|
|
- serverName: "type_id",
|
|
|
+ serverName: "part_title",
|
|
|
+ optionName:'part_title',
|
|
|
+ optionValue:'part_title',
|
|
|
option: [
|
|
|
- { label: "已匹配", value: 1 },
|
|
|
- { label: "未匹配", value: 0 },
|
|
|
+ ...this.part_title
|
|
|
]
|
|
|
},
|
|
|
{
|
|
@@ -140,10 +156,11 @@ export default {
|
|
|
name: "Select",
|
|
|
value: "",
|
|
|
placeholder: "请选择",
|
|
|
- serverName: "type_id",
|
|
|
+ serverName: "cut_size",
|
|
|
+ optionName:'cut_size',
|
|
|
+ optionValue:'cut_size',
|
|
|
option: [
|
|
|
- { label: "已匹配", value: 1 },
|
|
|
- { label: "未匹配", value: 0 },
|
|
|
+ ...this.cut_size
|
|
|
]
|
|
|
},
|
|
|
{
|
|
@@ -151,32 +168,125 @@ export default {
|
|
|
name: "Select",
|
|
|
value: "",
|
|
|
placeholder: "请选择",
|
|
|
- serverName: "type_id",
|
|
|
+ serverName: "state",
|
|
|
option: [
|
|
|
- { label: "已匹配", value: 1 },
|
|
|
+ { label: "匹配中", value: 1 },
|
|
|
{ label: "未匹配", value: 0 },
|
|
|
+ { label: "匹配完成", value: 2 },
|
|
|
]
|
|
|
}
|
|
|
];
|
|
|
},
|
|
|
+ uploadData(){
|
|
|
+ return {type:this.infoNumber.length==0?this.$route.query.type:4,
|
|
|
+ project_number:this.formData.project_number
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
- initData() {},
|
|
|
+ saveData(){
|
|
|
+ let date = new Date();
|
|
|
+ if(!this.formData.start_time){
|
|
|
+ this.formData.start_time = date
|
|
|
+ }
|
|
|
+ this.axios.get('/api/cut_order_save',{params:{
|
|
|
+ project_name:this.formData.product_name,
|
|
|
+ project_number:this.formData.project_number,
|
|
|
+ abbreviation:this.formData.project_abbreviation,
|
|
|
+ crt_time:this.formData.start_time,
|
|
|
+ id:this.cut_order_id,
|
|
|
+ }}).then(res=>{
|
|
|
+ if(res.code ==200){
|
|
|
+ this.$Message.success(res.msg)
|
|
|
+ this.axios.post('/api/cut_order_del',{cut_order_product_id:this.del_id,order_type:1,cut_order_id:this.cut_order_id})
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ search_data(row){
|
|
|
+ this.axios.post('/api/cut_order_open',{
|
|
|
+ cut_order_product_id:this.cut_order_product_id,
|
|
|
+ cut_order_id:this.cut_order_id,
|
|
|
+ order_type:1,
|
|
|
+ ...row
|
|
|
+ }).then(res=>{
|
|
|
+ this.tableData=res.data.data;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ search(item){
|
|
|
+ this.axios.post('/api/cut_order_open',{
|
|
|
+ cut_order_product_id:item.cut_order_product_id,
|
|
|
+ cut_order_id:this.cut_order_id,
|
|
|
+ order_type:1
|
|
|
+ }).then(res=>{
|
|
|
+ this.tableData=res.data.data;
|
|
|
+ this.part_title = res.data.part_title;
|
|
|
+ this.cut_size = res.data.cut_size;
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ del(item,index){
|
|
|
+ this.confirmDelete({
|
|
|
+ content:'是否删除?',
|
|
|
+ title:'码单删除',
|
|
|
+ type:'primary',
|
|
|
+ then:()=>{
|
|
|
+ this.infoNumber.splice(index,1)
|
|
|
+ this.del_id.push(item.cut_order_product_id)
|
|
|
+ },
|
|
|
+ cancel:()=>{}
|
|
|
+ })
|
|
|
+ },
|
|
|
+ initData() {
|
|
|
+
|
|
|
+ },
|
|
|
+ handleBeforeUpload() {},
|
|
|
+ uploadError(err) {
|
|
|
+ this.$Message.error(err.msg || "导入失败");
|
|
|
+ },
|
|
|
+ uploadSuccess(res) {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$Message.success("导入成功");
|
|
|
+ this.cut_order_id = res.data.cut_order_id;
|
|
|
+ this.formData.project_number = res.data.project_number;
|
|
|
+ this.formData.product_name = res.data.project_name;
|
|
|
+ this.formData.id = res.data.cut_order_id;
|
|
|
+ this.formData.start_time =this.func.replaceDate(res.data.crt_time);
|
|
|
+ console.log(this.formData.start_time)
|
|
|
+ if(this.infoNumber.length == 0){
|
|
|
+ this.infoNumber.push(res.data.children)
|
|
|
+ this.infoNumber[0].showType = false
|
|
|
+ }else{
|
|
|
+ this.infoNumber.push(res.data.children);
|
|
|
+ this.infoNumber.forEach((item,index)=>{
|
|
|
+ if(item.cut_order_product_id == res.data.children.cut_order_product_id){
|
|
|
+ this.infoNumber.pop();
|
|
|
+ this.infoNumber.splice(index,1,res.data.children)
|
|
|
+ }
|
|
|
+ })}
|
|
|
+ } else {
|
|
|
+ this.$Message.warning(res.msg || "导入失败");
|
|
|
+ }
|
|
|
+ },
|
|
|
show(item,index) {
|
|
|
- item.showType = !item.showType
|
|
|
+
|
|
|
+ // item.showType = !item.showType
|
|
|
+ this.infoNumber[index].showType = !this.infoNumber[index].showType
|
|
|
if(item.showType){ //全部未展开
|
|
|
this.infoNumber.forEach(_item=>{
|
|
|
_item.showType = false;
|
|
|
})
|
|
|
document.getElementsByClassName('ico')[index].style.transform = 'rotate(90deg)'
|
|
|
item.showType = true
|
|
|
+ this.$forceUpdate();
|
|
|
+ this.cut_order_product_id = item.cut_order_product_id;
|
|
|
+ this.search(item)
|
|
|
}else{ //展开其中一项
|
|
|
this.infoNumber.forEach(_item=>{
|
|
|
_item.showType = false;
|
|
|
})
|
|
|
document.getElementsByClassName('ico')[index].style.transform = 'rotate(0deg)'
|
|
|
+ this.$forceUpdate();
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
},
|
|
|
};
|
|
@@ -227,4 +337,7 @@ export default {
|
|
|
margin: 15px 0;
|
|
|
background: rgb(236, 236, 236);
|
|
|
}
|
|
|
+.btn_set{
|
|
|
+ display: flex;
|
|
|
+}
|
|
|
</style>
|