mushencc 4 éve
szülő
commit
796abb228b

BIN
dist (2).zip


+ 3 - 1
src/components/selects/reference/index.js

@@ -3,12 +3,14 @@ import Reference from './index.vue';
 
 const ReferenceCollner = Vue.extend(Reference);
 
-const Content = ({ title, type, refer_type, then, cancel }) => {
+const Content = ({ title, type, refer_type,supply_title,arrival_no, then, cancel }) => {
   const instance = new ReferenceCollner({
     data: {
       title: title,
       type: type,
       refer_type,
+      arrival_no,
+      supply_title:supply_title
     },
   });
   instance.vm = instance.$mount();

+ 339 - 62
src/components/selects/reference/index.vue

@@ -3,7 +3,7 @@
     <Modal fullscreen
            :title="title"
            v-model="show"
-           @on-ok="then">
+           >
       <Topsearch ref="topsearch"
                  :list="set_list"
                  @init="init"
@@ -14,8 +14,13 @@
              :max-height="maxHeight"
              stripe
              border
+             ref="projectTable"
              :columns="project_tableColumns"
-             :data="project_tableData"></Table>
+             :data="project_tableData">
+             <template slot="select" slot-scope="{row,index}">
+               <Checkbox  type="checkbox" v-model='project_tableData[index].isChoose' @on-change='selectTableProjectRow($event,row,index)' :disabled="(row.supply_title != supply_title&&supply_title!='')||row.disabled_type "/>
+             </template>
+             </Table>
       <div ref="footercenter"
            class="footer-center">
         <Page :total="total"
@@ -41,8 +46,14 @@
              v-show="type!=14"
              :columns="parts_tableColumns"
              :data="parts_tableData">
-             <template slot="purchases_num" slot-scope="{index}">
-               <Input v-model="parts_tableData[index].purchases_num" ></Input>
+             <template slot="purchases_num" slot-scope="{row,index}">
+               <Input v-model="parts_tableData[index].purchases_num" type='number' @on-change='changePurchasesNum($event,row,index)' @on-focus='InputFocus(row,index)'></Input>
+             </template>
+              <template slot="arrive_num" slot-scope="{row,index}">
+               <Input v-model="parts_tableData[index].arrive_num" type='number' @on-change='changePurchasesNum($event,row,index)' @on-focus='InputFocus(row,index)'></Input>
+             </template>
+              <template slot="return_num" slot-scope="{row,index}">
+               <Input v-model="parts_tableData[index].return_num" type='number' @on-change='changePurchasesNum($event,row,index)' @on-focus='InputFocus(row,index)'></Input>
              </template>
              </Table>
       <vxe-table resizable
@@ -115,15 +126,30 @@
                           title="备注"
                           min-width="80"></vxe-table-column>
       </vxe-table>
+      <div slot="footer">
+        <Button
+          @click="show = false"
+          type="primary"
+          style="margin-right: 10px"
+        >
+          返回
+        </Button>
+         <Button @click="then" type="primary">
+          确认
+        </Button>
+      </div>
     </Modal>
   </div>
 </template>
 
 <script>
+
 export default {
   data () {
     return {
+      choose:{},
       show: false,
+      checkAll:false,
       list: [],
       childrenList: [],
       stockGoodsList: [],
@@ -155,6 +181,9 @@ export default {
       project_title:[],
       supply:[],
       plan_no:[],
+      purchase_order_no_list:[],
+      purchase_order_no:[],
+     arrival_no_list:[]
     }
   },
   computed: {
@@ -162,8 +191,8 @@ export default {
       switch (this.type) {
         case 1:
           return [//参照采购计划
-            { title: '计划单号', name: 'Select', value: '', placeholder: '请选择计划单号', serverName: 'plan_no',option:this.plan_no_list },
-            { title: '采购计划类型', name: 'Select', value: '', placeholder: '请选择采购计划类型', serverName: 'plan_type', option: this.purchaseTypeList },
+            { title: '计划单号', name: 'Select', value: '', placeholder: '请选择计划单号', serverName: 'plan_no',option:this.plan_no_list ,filterable:true},
+            { title: '采购计划类型', name: 'Select', value: '', placeholder: '请选择采购计划类型', serverName: 'plan_type', option: this.purchaseTypeList,filterable:true },
            
             { title: '单据日期', start_server: 'start_time', end_server: 'end_time', name: 'Input', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期', }
           ]
@@ -171,11 +200,11 @@ export default {
         case 3:
         case 5:
           return [//参照采购单
-            { title: '订单号', name: 'Input', value: '', placeholder: '请输入订单号', serverName: 'purchase_order_no' },
-            { title: '采购类型', name: 'Select', value: '', placeholder: '请选择采购类型', serverName: 'type_id', option: this.purchaseTypeList },
-            { title: '项目名称', name: 'Input', value: '', placeholder: '请输入项目名称', serverName: 'client_name', },
+            { title: '订单号', name: 'Input', value: '', placeholder: '请输入订单号', serverName: 'order_no' },
+            { title: '采购计划类型', name: 'Select', value: '', placeholder: '请选择采购类型', serverName: 'basics_purchase_id', option: this.purchaseTypeList,filterable:true },
+          
             { title: '供应商名称', name: 'Input', value: '', placeholder: '请输入供应商名称', serverName: 'supply_title', },
-            { title: '单时间', start_server: 'start_time', end_server: 'end_time', name: 'Input', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期', },
+            { title: '单时间', start_server: 'start_time', end_server: 'end_time', name: 'Input', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期', }
           ]
         case 4:
         case 6:
@@ -183,9 +212,9 @@ export default {
         case 8:
         case 9:
           return [//参照质检单
-            { title: '订单号', name: 'Input', value: '', placeholder: '请输入订单号', serverName: 'purchase_order_quality_no' },
-            { title: '项目名称', name: 'Input', value: '', placeholder: '请输入项目名称', serverName: 'type_title', },
-            { title: '制单时间', start_server: 'start_time', end_server: 'end_time', name: 'Input', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期', },
+            { title: '到货单号', name: 'Select', value: '', placeholder: '请输入订单号', serverName: 'arrival_no',option:this.arrival_no_list,filterable:true },
+             { title: '供应商名称', name: 'Select', value: '', placeholder: '请选择供应商', serverName: 'supply_id',option:this.supplierList,filterable:true },
+            { title: '单据日期', start_server: 'start_time', end_server: 'end_time', name: 'Input', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期', }
           ]
       }
     },
@@ -193,32 +222,32 @@ export default {
       switch (this.type) {
         case 1:
           return [//采购参照请购单
-            { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'material_type_id', option: this.materialTypeList },
-             {title: '物料名称',name:'Select',value:'',placeholder:'请输入物料名称',serverName:'material_title',option:this.material},
-            {title: '项目编码',name:'Select',value:'',placeholder:'请选择项目编码',serverName:'project_code',option:this.project_code},
-            {title: '项目名称',name:'Select',value:'',placeholder:'请选择项目编码',serverName:'project_title',option:this.project_title},
-            {title: '建议供应商',name:'Select',value:'',placeholder:'请选择项目编码',serverName:'supply_id',option:this.supply},
+            { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'material_type_id', option: this.materialTypeList ,filterable:true},
+             {title: '物料名称',name:'Select',value:'',placeholder:'请输入物料名称',serverName:'material_title',option:this.material,filterable:true},
+            {title: '项目编码',name:'Select',value:'',placeholder:'请选择项目编码',serverName:'project_code',option:this.project_code,filterable:true},
+            {title: '项目名称',name:'Select',value:'',placeholder:'请选择项目编码',serverName:'project_title',option:this.project_title,filterable:true},
+            {title: '建议供应商',name:'Select',value:'',placeholder:'请选择项目编码',serverName:'supply_id',option:this.supply,filterable:true},
              { title: '预计到货时间', start_server: 'arrive_start_time', end_server: 'arrive_end_time', name: 'Input', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期', }
           ]
         case 2:
         case 3:
         case 5:
           return [//到货参照采购单
-            { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'type_id', option: this.materialTypeList },
-            { title: '物料名称', name: 'Input', value: '', placeholder: '请输入物料名称', serverName: 'title' },
+            { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'material_type_id', option: this.materialTypeList,filterable:true },
+            { title: '物料名称', name: 'Input', value: '', placeholder: '请输入物料名称', serverName: 'material_title' },
           ]
         case 4:
         case 6:
           return [//质检参照到货单
-            { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'type_id', option: this.materialTypeList },
-            { title: '物料名称', name: 'Input', value: '', placeholder: '请输入物料名称', serverName: 'title' },
+            { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'material_type_id', option: this.materialTypeList,filterable:true },
+            { title: '物料名称', name: 'Input', value: '', placeholder: '请输入物料名称', serverName: 'material_title' },
           ]
         case 7:
         case 8:
         case 9:
           return [//参照质检单
-            { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'type_id', option: this.materialTypeList },
-            { title: '物料名称', name: 'Input', value: '', placeholder: '请输入物料名称', serverName: 'title' },
+            { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'material_type_id', option: this.materialTypeList,filterable:true },
+            { title: '物料名称', name: 'Input', value: '', placeholder: '请输入物料名称', serverName: 'material_title' },
           ]
       }
     }
@@ -236,12 +265,21 @@ export default {
       });
 
     }).catch((err) => { });
+     // 获取供应商列表
+    this.axios({ method: 'get', url: '/api/supply_list', }).then((res) => { 
+      this.supplierList = res.data.data;
+      this.supplierList.forEach(v=>{
+        v.label = v.title;
+        v.value = v.id;
+      })
+      }).catch((err) => { });
     switch (this.type) {
       case 1: //采购订单参照采购计划
         this.project_tableColumns = [
           { title: '选择', align: 'center', minWidth: 100, type: 'selection' },
           // { title: '订单号', align: 'center', key: 'purchase_order_apply_no', minWidth: 200, },
           { title: '计划单号', align: 'center', key: 'plan_no', minWidth: 200, },
+          
           { title: '采购计划类型', align: 'center', key: 'plan_type_title', minWidth: 150, },
          
           {
@@ -266,11 +304,13 @@ export default {
           { title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
           { title: '项目编码', key: 'project_code', align: 'center', minWidth: 150 },
            { title: '项目名称', key: 'project_title', align: 'center', minWidth: 150 },
-          { title: '计划数量', key: 'num', align: 'center', minWidth: 150,
-          render:(h,params)=>{
-            const {row} = params;
-            return h("span",{},row.num-row.reference_num)
-          } },
+          { title: '计划数量', key: 'num', align: 'center', minWidth: 150,},
+           { title: '未参照数量', key: 'num', align: 'center', minWidth: 150 ,
+           render:(h,params)=>{
+              const { row } = params
+              let text = row.num-row.reference_num
+                return h('span', {}, text)
+           }},
            { title: '采购数量', key: 'purchases_num', align: 'center', minWidth: 150,slot:'purchases_num'
           //  render:(h,params,index)=>{
           //    console.log(index)
@@ -293,18 +333,64 @@ export default {
         break
       case 2: //到货单参照采购单
         this.project_tableColumns = [
-          { title: '选择', align: 'center', minWidth: 100, type: 'selection' },
-          { title: '订单号', align: 'center', key: 'purchase_order_no', minWidth: 200, },
-          { title: '采购类型', align: 'center', key: 'type_title', minWidth: 100, },
-          { title: '项目名称', align: 'center', key: 'residential_name', minWidth: 150 },
-          { title: '供应商名称', align: 'center', key: 'supply_title', minWidth: 150 },
+          {  align: 'center', Width: 100,slot:'select',renderHeader:(h,{colum,index})=>{
+             return h('Checkbox',{props:{},on:{'on-change':(val)=>{
+               if(val){
+                  this.checkAll = true;
+                  this.project_tableData.map(v=>{
+                    v.isChoose = true;
+                  })
+               }else{
+                  this.checkAll = false;
+                  this.project_tableData.map(v=>{
+                    v.isChoose = false;
+                  })
+               }
+             }}},'全选')
+          }},
+          { title: '订单号', align: 'center', key: 'order_no', minWidth: 200 },
+            
+          { title: '采购订单类型', align: 'center', key: 'basics_purchase_title', minWidth: 100, },
+         
+          { title: '供应商名称', align: 'center', key: 'supply_title', minWidth: 150 ,
+          renderHeader: (h, {colum,index}) => {
+    return h('div', [
+        h('Tooltip', {
+                props: {
+                    placement: 'top',
+                    transfer:true
+                }        
+            }, [
+                h('div',[
+                    h('span','供应商名称'),
+                    h('Icon', {
+                        attrs: {
+                            // 图片需放在static文件夹下
+                            type: "ios-help-circle-outline" 
+                        },
+                        style: {
+                            marginBottom: '3px'
+                        }
+                    })
+                ]), // 表格列显示文字和图片
+                h('div', {
+                        slot: 'content',
+                        style: {
+                            whiteSpace: 'normal',
+                        }
+                    }, '只能选择一种供应商,相同供应商可以多选' // 气泡内的文字
+                )
+            ])
+    ]);
+}
+          },
           {
-            title: '预计到货', align: 'center', key: 'arrive_time', minWidth: 200,
+            title: '预计到货日期', align: 'center', key: 'arrive_time', minWidth: 200,
             render: (h, params) =>
-              h('span', this.func.replaceDate(params.row.arrive_time * 1)),
+              h('span', params.row.arrive_time?this.func.replaceDate(params.row.arrive_time * 1).split(' ')[0]:''),
           },
           {
-            title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
+            title: '单日期', align: 'center', key: 'crt_time', minWidth: 200,
             render: (h, params) =>
               h('span', this.func.replaceDate(params.row.crt_time * 1)),
           },
@@ -323,9 +409,17 @@ export default {
           },
           { title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
           { title: '采购数量', key: 'num', align: 'center', minWidth: 150 },
+           { title: '未参照数量', key: 'num', align: 'center', minWidth: 150 ,
+           render:(h,params)=>{
+              const { row } = params
+              let text = row.num-row.reference_num
+                return h('span', {}, text)
+           }},
+           { title: '到货数量', key: 'arrive_num', align: 'center', minWidth: 150,slot:'arrive_num'
+            }
         ]
         this.get_project_url = '/api/purchase_list'
-        this.get_child_url = '/api/purchase_refer'
+        this.get_child_url = '/api/purchase_detail'
         this.childrenParams = {}
         break
       case 3: //质检单参照采购单
@@ -367,14 +461,18 @@ export default {
         break
       case 4: //质检单参照到货单
         this.project_tableColumns = [
-          { title: '选择', align: 'center', minWidth: 100, type: 'selection' },
-          { title: '订单号', align: 'center', key: 'purchase_order_arrive_no', minWidth: 200, },
-          { title: '项目名称', align: 'center', key: 'type_title', minWidth: 150 },
+         {
+            title: "选择",
+            align: "center",
+            minWidth: 100,
+            render: this.renderRadio,
+          },
+          { title: '到货单号', align: 'center', key: 'arrival_no', minWidth: 200, },
           { title: '供应商名称', align: 'center', key: 'supply_title', minWidth: 150 },
           {
-            title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
+            title: '单据日期', align: 'center', key: 'order_time', minWidth: 200,
             render: (h, params) =>
-              h('span', this.func.replaceDate(params.row.crt_time * 1)),
+              h('span', this.func.replaceDate(params.row.order_time * 1)),
           },
         ]
         this.parts_tableColumns = [
@@ -391,9 +489,17 @@ export default {
           },
           { title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
           { title: '到货数量', key: 'num', align: 'center', minWidth: 150 },
+            { title: '未参照数量', key: 'num', align: 'center', minWidth: 150 ,
+           render:(h,params)=>{
+              const { row } = params
+              let text = row.num-row.reference_num
+                return h('span', {}, text)
+           }},
+           { title: '退货数量', key: 'return_num', align: 'center', minWidth: 150,slot:'return_num'
+            }
         ]
         this.get_project_url = '/api/purchase_arrive_list'
-        this.get_child_url = '/api/quality_refer'
+        this.get_child_url = '/api/purchase_arrive_detail'
         this.childrenParams = { type: this.refer_type }
         break
       case 5: //入库单参照采购单
@@ -571,6 +677,9 @@ export default {
   mounted () {
     let type_id = '';
     if(this.type ==1){
+      type_id = 1
+    }
+    if(this.type == 2){
       type_id = 2
     }
     // 获取采购类型
@@ -590,7 +699,30 @@ export default {
     })
   },
   methods: {
-   
+    InputFocus(row,index){
+      if(this.type==1){
+            this.parts_tableData[index].purchases_num = '';
+      }
+        if(this.type==2){
+            this.parts_tableData[index].arrive_num = '';
+      }
+        if(this.type==4){
+            this.parts_tableData[index].return_num = '';
+      }
+    },
+     changePurchasesNum(e,row,index){
+      
+            if((e.target.value)*1>(row.num-row.reference_num)*1){
+                if(this.type ==1){
+                this.parts_tableData[index].purchases_num = (row.num-row.reference_num)*1;}
+                if(this.type ==2){
+                this.parts_tableData[index].arrive_num = (row.num-row.reference_num)*1;}
+                if(this.type ==4){
+                this.parts_tableData[index].return_num = (row.num-row.reference_num)*1;}
+                return this.$Message.error('数量不能超过未参照数量')
+            }
+          
+     },
     selectChangeEvent ({ records }) {
       this.tableResult = JSON.parse(JSON.stringify(records))
     },
@@ -599,7 +731,46 @@ export default {
       return row.single * row.number
     },
     then () {
-      this.$emit('then')
+      let state = true;
+      if(this.tableResult.length==0){
+        return this.$Message.warning('请选择物料')
+      }
+      if(this.type==1){
+        this.tableResult.forEach(v=>{
+          if(!v.purchases_num){
+              return state =false
+          }
+          if(v.purchases_num>(v.num-v.reference_num)){
+           return state = false
+          }
+        })
+      }
+       if(this.type==2){
+        this.tableResult.forEach(v=>{
+          if(!v.arrive_num){
+              return state =false
+          }
+           if(v.arrive_num>(v.num-v.reference_num)){
+           return state = false
+          }
+        })
+      }
+      if(this.type ==4){
+         this.tableResult.forEach(v=>{
+           if(!v.return_num){
+            return state = false
+           }
+            if(v.return_num>(v.num-v.reference_num)){
+           return state = false
+          }
+      })
+      }
+     if(!state){
+       return this.$Message.warning('数量不能为空')
+     }else{
+       this.$emit('then')
+     }
+      
     },
     init (row) {
       row.page_index = 1
@@ -624,7 +795,7 @@ export default {
           row.arrive_start_time= parseInt(new Date(row.arrive_start_time).getTime() / 1000) || ''
           break;
         case 2:
-          row.purchase_order_no = this.currencyOrder
+          row.order_no = this.currencyOrder
           break;
         case 3:
         case 4:
@@ -633,7 +804,7 @@ export default {
         case 7:
         case 8:
         case 9:
-          row.refer_order_no = this.currencyOrder
+          row.arrival_no = this.currencyOrder
           break;
         // case 3:
         //   row.purchase_order_arrive_no = this.currencyOrder
@@ -642,7 +813,8 @@ export default {
         //   row.purchase_order_quality_no = this.currencyOrder
         //   break;
       }
-      this.axios({
+      if(this.type == 1){
+         this.axios({
         method: 'post',
         url: this.get_child_url,
          data:{...row,
@@ -655,6 +827,20 @@ export default {
           this.parts_tableData = res.data.children
         }
       }).catch((err) => { });
+      }else{
+      this.axios({
+        method: 'post',
+        url: this.get_child_url,
+         data:{...row,
+          reference_type: 1
+        }
+     } ).then((res) => {
+        if (res.code == 200) {
+          const deep_obj = JSON.parse(JSON.stringify(res.data))
+          this.projectDetail = deep_obj
+          this.parts_tableData = res.data.list
+        }
+      }).catch((err) => { });}
     },
     getData (params) {
       params.end_time = Date.parse(params.end_time).toString().slice(0,10)
@@ -668,9 +854,11 @@ export default {
       }
       this.axios(this.get_project_url, { params: params }).then((res) => {
         if (res.code == 200) {
+         
           res.data.data.map((v) => (v.check = false))
           this.project_tableData = res.data.data
           this.total = res.data.total
+          if(this.type == 1){
           this.plan_no_list = res.data.plan_no_list;
           let data = [];
           this.plan_no_list.forEach(v=>{
@@ -679,7 +867,20 @@ export default {
             obj.value = v;
             data.push(obj)
           })
-          this.plan_no_list = data;
+          this.plan_no_list = data;}
+       
+          if(this.type == 4){
+          
+            let data = [];
+            this.arrival_no_list = res.data.arrival_no_list
+            this.arrival_no_list.map(v=>{
+             let obj = {};
+              obj.label = v;
+            obj.value = v;
+            data.push(obj)
+            })
+             this.arrival_no_list = data;
+          }
         }
       })
     },
@@ -688,6 +889,7 @@ export default {
       return h('Radio', {
         props: {
           value: row.check,
+          disabled:((row.arrival_no == this.arrival_no&&this.arrival_no)||!this.arrival_no)?false:true
         },
         on: {
           'on-change': (e) => {
@@ -707,7 +909,18 @@ export default {
       })
     },
     changeRadio (row) {
-      console.log('row :>> ', row);
+      this.currencyOrder = row.arrival_no
+          console.log('nana')
+          this.axios({
+            method: 'post',
+            url: this.get_child_url,
+            data: {
+             arrival_no: row.arrival_no,
+              reference_type:1,
+            }
+          }).then((res) => {
+            this.parts_tableData =res.data.list
+          }).catch((err) => { });
     },
     changePage (e) {
       this.pageIndex = e
@@ -745,6 +958,56 @@ export default {
         }
       });
     },
+    selectTableProjectRow(e,row,index){
+       switch(this.type){
+         case 2://到货单参照采购订单,不同的供应商只能单选
+          this.currencyOrder = [row.order_no]
+         if(e){ //如果点击为勾选状态
+            if(Object.keys(this.choose).length === 0){//勾选状态第一次点击
+                 this.choose = row;
+            }
+          this.project_tableData.forEach(v=>{
+               if(v.supply_title!=this.choose.supply_title){
+                v.disabled_type = true;
+              }else{
+                v.disabled_type = false;
+              }
+         })
+         }else{
+           let state = true;//没有数据勾选的状态
+             this.project_tableData.forEach(v=>{
+                 if(v.isChoose){
+                   return state = false //有数据勾选
+                 }
+             })
+            if(state){
+                this.project_tableData.forEach(v=>{
+                  v.disabled_type = false;
+                  this.choose = [];
+                })
+            }
+         }           
+           this.purchase_order_no = [];
+          this.project_tableData.forEach(v=>{
+            if(v.isChoose){
+              this.purchase_order_no.push(v.order_no)
+            }
+          })
+         this.axios({
+            method: 'post',
+            url: this.get_child_url,
+           data: {
+              order_no: this.purchase_order_no,
+              reference_type: 1
+            }
+          }).then((res) => {
+            this.parts_tableData =res.data.list
+            this.parts_tableData.map(v=>{
+              v.arrive_num = 0;
+            })
+          }).catch((err) => { });
+       }
+    },
     selectTableProject (selection) {
       switch (this.type) {
         case 1://采购单参照请购单
@@ -796,16 +1059,29 @@ export default {
           }).catch((err) => { });
           break;
         case 2://到货单参照采购单
-          this.currencyOrder = row.purchase_order_no
-          this.axios({
-            method: 'get',
-            url: this.get_child_url,
-            params: {
-              purchase_order_no: row.purchase_order_no
-            }
-          }).then((res) => {
-            this.parts_tableData = [...this.parts_tableData, ...res.data]
-          }).catch((err) => { });
+        // console.log(selection)
+        //   // this.currencyOrder = selection.order_no
+        //   if(selection.length<this.purchase_order_no_list.length){
+        //      this.purchase_order_no_list =JSON.parse(JSON.stringify(selection));
+        //         selection.forEach(v=>{
+        //            this.purchase_order_no.push(v.order_no)
+        //         })
+        //          }else{
+        //            this.purchase_order_no_list =JSON.parse(JSON.stringify(selection));
+        //             this.purchase_order_no_list.forEach(v=>{
+        //               this.purchase_order_no.push(v.order_no)
+        //             })
+        //          }
+        //          console.log(this.purchase_order_no_list)
+        //   this.axios({
+        //     method: 'get',
+        //     url: this.get_child_url,
+        //     params: {
+        //       purchase_order_no: this.purchase_order_no
+        //     }
+        //   }).then((res) => {
+        //     this.parts_tableData = [...this.parts_tableData, ...res.data]
+        //   }).catch((err) => { });
           break;
         case 3://质检单参照采购单
           this.currencyOrder = row.purchase_order_no
@@ -821,7 +1097,8 @@ export default {
           }).catch((err) => { });
           break;
         case 4://质检单参照到货单
-          this.currencyOrder = row.purchase_order_arrive_no
+          this.currencyOrder = selection.arrival_no
+          console.log('nana')
           this.axios({
             method: 'get',
             url: this.get_child_url,

+ 9 - 0
src/routerMap/index.js

@@ -814,6 +814,15 @@ const routerMap = [
       require(["@/views/BidSystem/DeepeningOrder/infoDetail"], resolve),
   },
   {
+    path: "/cms/BidSystem/DeepeningOrder/deepDetail",
+    name: "BidSystemDeepeningOrderDeepDetail", // 报价系统→深化单/编辑详情
+    meta: {
+      index: 3,
+    },
+    component: (resolve) =>
+      require(["@/views/BidSystem/DeepeningOrder/deepDetail"], resolve),
+  },
+  {
     path: "/cms/BidSystem/ProductDeOrder/detail",
     name: "BidSystemProductDeOrderDetail", // 报价系统→生产拆单→拆单
     meta: {

+ 2 - 1
src/views/BasicSettings/ClassifyDocs/TypeDocs.vue

@@ -179,7 +179,8 @@ export default {
           url: '/api/basic_purchase_edit',
           data: {
             id: this.id,
-            title: this.title
+            basic_type_id:this.modalData.basic_type_id,
+            title: this.modalData.title
           }
         }).then((res) => {
           this.$Message.success(res.msg)

+ 24 - 0
src/views/BasicSettings/PartSettings/detail.vue

@@ -147,6 +147,20 @@
           :max-height="700"
           :data="tableData"
         >
+         <template slot="partDetailProduct" slot-scope="{ index }">
+            <Select
+              v-model="tableData[index].product_id"
+              transfer
+             placeholder="全部"
+            >
+              <Option
+                v-for="item in product"
+                :key="item.id"
+                :label="item.type_name"
+                :value="item.id"
+              ></Option>
+            </Select>
+          </template>
           <template slot="partDetailTitle" slot-scope="{ index }">
             <Select
               v-model="tableData[index].parts_detail_id"
@@ -248,6 +262,12 @@ export default {
       urlSelectList: [],
       tableColumns: [
         {
+          title: "关联产品",
+          align: "center",
+          minWidth: 120,
+          slot: "partDetailProduct",
+        },
+        {
           title: "零部件名称",
           align: "center",
           minWidth: 120,
@@ -294,6 +314,7 @@ export default {
       type_title_list: [],
       process_list: [],
       measure_list: [],
+      product:[],
     };
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
@@ -304,6 +325,9 @@ export default {
     this.axios.get("/api/parts_index").then((res) => {
       this.parts_list = res.data.data;
     });
+    this.axios.get('/api/product').then(res=>{
+      this.product = res.data.data;
+    })
     this.axios.get("/api/basics_measure_index").then((res) => {
       this.measure_list = res.data.data;
     });

+ 12 - 9
src/views/BasicSettings/rootManage.vue

@@ -75,7 +75,7 @@
       <div>
         <span>用户:</span> 
         
-          <Select style="width:50%" v-model="currencyRow.id" filterable clearable v-if="modal_title !== '查看'">
+          <Select style="width:50%" v-model="currencyRow.sub_id" filterable clearable v-if="modal_title !== '查看'">
               <Option v-for="(item,index) in user_list" :key="index" :label="item.nickname" :value="item.id">
               </Option>
           </Select>
@@ -133,7 +133,7 @@ export default {
         modal_title:'',
       title: '工序班组权限表',
       columns: [
-        { title:'ID', key: 'sub_id', align: 'center' },
+        { title:'ID', type:'index', align: 'center' },
         { title: '用户', key: 'user', align: 'center', },
         { title: '工序', key: 'process', align: 'center', ellipsis:'true',tooltip:'true'},
         { title: '班组', key: 'band', align: 'center',ellipsis:'true',tooltip:'true' },
@@ -182,7 +182,9 @@ export default {
     //   this.$forceUpdate();
       this.axios.post('/api/ext_user_permission_list', 
          {
-          title: this.search_title
+          title: this.search_title,
+          page_size:this.pageSize,
+          page_index:this.pageIndex
         }
       ).then(res => {
         if (res.code == 200) { 
@@ -204,7 +206,7 @@ export default {
             this.modal_title = '新增';
             
             this.currencyRow = {
-        id:'',
+        sub_id:'',
         produce_ids :[],
         employee_ids:[]
       }
@@ -227,7 +229,7 @@ export default {
                 method: 'post',
                 url: '/api/ext_user_permission_del',
                 data: {
-                  id: row.sub_id
+                  id: row.id
                 }
               }).then((res) => {
                 this.$Message.success(res.msg)
@@ -239,9 +241,9 @@ export default {
           break;
           case 4:
             this.modal_title = '编辑';
-           
-           this.currencyRow.id = row.sub_id;
-
+           console.log(row)
+           this.currencyRow.id = row.id;
+           this.currencyRow.sub_id =row.sub_id;
            this.currencyRow.produce_ids = row.json.produce_ids;
             this.currencyRow.employee_ids = row.json.employee_ids;
              this.showModal = true;
@@ -259,9 +261,10 @@ export default {
           ...this.currencyRow
         }
       }).then((res) => {
+        if(res.code == 200){
         this.$Message.success(res.msg)
         this.showModal = false
-        this.init()
+        this.init()}
       }).catch((err) => { });
     },
     handleSave () {

+ 1188 - 0
src/views/BidSystem/DeepeningOrder/deepDetail.vue

@@ -0,0 +1,1188 @@
+<template>
+  <div class="changeDetail">
+    <Toptitle :title="type == 3 ? '深化单详情' :type==10?'深化单新增':'深化单编辑'">
+      <slot name="titleButton">
+        <!-- <Button type="primary" style="margin-right: 10px" v-if="type == 6||type ==10"
+          >开启拆单</Button
+        > -->
+        <Button type="primary" style="margin-right: 10px" v-if="type == 3"
+          >批量下生产</Button
+        >
+        <Button
+          @click="goback()"
+          type="primary"
+          ghost
+          style="margin-right: 10px"
+          >返回</Button
+        >
+        <Button
+          type="primary"
+          style="margin-right: 10px"
+          v-if="type == 2||type == 10"
+          @click="save"
+          >保存</Button
+        >
+      </slot>
+    </Toptitle>
+    <div class="content">
+      <div class="form">
+        <Form class="form_content" :label-width="100">
+          <FormItem label="项目编号:">
+            <Input
+              v-if="type == 2||type == 10"
+              v-model="formData.order_no"
+              placeholder="项目编码"
+            />
+            <span style="width: 120px" v-else>{{ formData.order_no }}</span>
+          </FormItem>
+          <FormItem label="项目名称:">
+            <Input
+              v-if="type == 2||type == 10"
+              v-model="formData.residential_name"
+              placeholder="请输入项目名称"
+            />
+            <span v-else>{{ formData.residential_name }}</span>
+          </FormItem>
+          <FormItem label="项目简称:">
+            <Input
+              v-if="type == 2||type == 10"
+              v-model="formData.abbreviation"
+              placeholder="请输入项目简称"
+            />
+            <span v-else>{{ formData.abbreviation }}</span>
+          </FormItem>
+          <FormItem label="客户名称:">
+            <Select
+              filterable
+              clearable
+              v-model="formData.custom_id"
+              @on-change="handleCustomSelect"
+              v-if="type == 2||type == 10"
+            >
+              <Option
+                v-for="(item, index) in custom_title_list"
+                :key="index"
+                :label="item.title"
+                :value="item.id"
+              ></Option>
+            </Select>
+            <span v-else>{{ formData.custom_title }}</span>
+          </FormItem>
+          <FormItem label="紧急程度:">
+            <Select clearable v-model="formData.warning_state" v-if="type == 2||type == 10">
+              <Option
+                v-for="(item, index) in warning_state_list"
+                :key="index"
+                :label="item.title"
+                :value="item.id"
+              ></Option>
+            </Select>
+            <span v-else>{{ formData.warning_state }}</span>
+          </FormItem>
+          <FormItem label="项目定金:">
+            <Input
+              v-if="type == 2||type == 10"
+              v-model="formData.front_money"
+              placeholder="请输入项目定金"
+            />
+            <span v-else>{{ formData.front_money }}</span>
+          </FormItem>
+          <FormItem label="详细地址:">
+              <Input
+              v-if="type == 2||type == 10"
+              v-model="formData.address"
+              placeholder="请输入详细地址"
+            />
+            <span v-else>{{ formData.address }}</span>
+          </FormItem>
+          <FormItem label="手机号:">
+           <Input
+              v-if="type == 2||type == 10"
+              v-model="formData.mobile"
+              placeholder="请输入手机号"
+            />
+            <!-- <span v-else>{{ formData.mobile }}</span> -->
+            <span v-else>{{
+              clientDetailList_mobile.filter(
+                (v) => v.mobile == saveData.custom_detail_mobile
+              ).length > 0
+                ? clientDetailList_mobile.filter(
+                    (v) => v.mobile == saveData.custom_detail_mobile
+                  )[0].mobile
+                : formData.mobile
+            }}</span>
+          </FormItem>
+          <FormItem label="开始日期:">
+            <DatePicker
+              type="date"
+              v-model="formData.start_time"
+              placeholder="年/月/日"
+              style="width: 150px"
+              v-if="type == 2||type == 10"
+            ></DatePicker>
+            <span v-else>{{ this.func.replaceDateNoHMS(formData.start_time) }}</span>
+          </FormItem>
+          <FormItem label="交付日期:">
+            <DatePicker
+              type="date"
+              v-model="formData.end_time"
+              placeholder="年/月/日"
+              style="width: 150px"
+              v-if="type == 2||type == 10"
+            ></DatePicker>
+            <span v-else>{{ this.func.replaceDateNoHMS(formData.end_time) }}</span>
+          </FormItem>
+          <FormItem label="业务员:">
+            <Select
+              filterable
+              clearable
+              v-model="formData.nickname_id"
+              v-if="type == 2||type == 10"
+            >
+              <Option
+                v-for="(item, index) in nickname_list"
+                :key="index"
+                :label="item.nickname"
+                :value="item.id"
+              ></Option>
+            </Select>
+            <span v-else>{{ formData.nickname }}</span>
+          </FormItem>
+          <FormItem label="备注:">
+            <Input
+              v-if="type == 2||type == 10"
+              v-model="formData.remark"
+              type="textarea"
+              placeholder="请输入备注"
+            />
+            <span v-else>{{ formData.remark }}</span>
+          </FormItem>
+        </Form>
+      </div>
+      <Card style="width: 100%" class="card">
+        <div class="form_middle">
+          <Form class="form_middle_content" :label-width="100">
+            <FormItem label="区域编码:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.area_code"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in area_code"
+                  :key="index"
+                  :label="item.area_code"
+                  :value="item.area_code"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="区域名称:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.area_title"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in area_title"
+                  :key="index"
+                  :label="item.area_title"
+                  :value="item.area_title"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="户型:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.house_type"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in house_type"
+                  :key="index"
+                  :label="item.house_type"
+                  :value="item.house_type"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="楼栋:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.house"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in house"
+                  :key="index"
+                  :label="item.house"
+                  :value="item.house"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="单元:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.unit"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in unit"
+                  :key="index"
+                  :label="item.unit"
+                  :value="item.unit"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="楼层:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.layer"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in layer"
+                  :key="index"
+                  :label="item.layer"
+                  :value="item.layer"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="房号:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.number"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in number"
+                  :key="index"
+                  :label="item.number"
+                  :value="item.number"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="位置:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.position"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in position"
+                  :key="index"
+                  :label="item.position"
+                  :value="item.position"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="产品分类:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.product_type"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in product_type"
+                  :key="index"
+                  :label="item.product_type"
+                  :value="item.product_type"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="图号:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.url_number"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in url_number"
+                  :key="index"
+                  :label="item.url_number"
+                  :value="item.url_number"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="产品名称:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.product_title"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in product_title"
+                  :key="index"
+                  :label="item.product_title"
+                  :value="item.product_title"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="材质:">
+              <Select
+                filterable
+                clearable
+                v-model="searchData.material"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in material"
+                  :key="index"
+                  :label="item"
+                  :value="item"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="颜色:">
+              <Select
+                filterable
+                clearable
+                v-model="searchData.color"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in color"
+                  :key="index"
+                  :label="item"
+                  :value="item"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="工艺:">
+              <Select
+                filterable
+                clearable
+                v-model="searchData.work"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in work"
+                  :key="index"
+                  :label="item"
+                  :value="item"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="左右式:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.fashion"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in fashion"
+                  :key="index"
+                  :label="
+                    item.fashion === 0
+                      ? '无'
+                      : item.fashion === 1
+                      ? '左式'
+                      : '右式'
+                  "
+                  :value="item.fashion"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="拆单状态:">
+              <Select
+                filterable
+                clearable
+                v-model="searchData.state"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in state"
+                  :key="index"
+                  :label="item.state === 0 ? '未拆单' : '已拆单'"
+                  :value="item.state"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem>
+              <Button
+                @click="search"
+                style="margin-right: 10px"
+                type="primary"
+                ghost
+                >搜索</Button
+              >
+            </FormItem>
+          </Form>
+        </div>
+        <Tabs type="card" @on-click="getData">
+          <TabPane
+            v-for="tab in tabs"
+            :key="tab"
+            :label="tab == 1 ? '汇总' : '明细'"
+            style="margin: 0 auto"
+          >
+            <div v-show="tab === 1">
+              <Table :columns="totalColumns" :data="totalData" border>
+                <template slot="setSlot" slot-scope="{ row }">
+                  <a @click="handleGoPage(row)">详情</a>
+                </template>
+                <template slot="urlSet" slot-scope="{ row,index }">
+                   <div class="items">
+                <img 
+                @click="looks(totalData[index].url)"
+                :src='$store.state.ip + row.url[0]' alt=""/>
+                </div>
+                  <!-- v-show="totalData[index].url.length !== 0 ? true : false"-->
+                    <!-- <img
+                      @click="looks(totalData[index].url)"
+                     
+                      :key="idx"
+                      :src="$store.state.ip + el"
+                      alt=""
+                    /> -->
+                 
+                </template>
+              </Table>
+              <Page
+                :page-size-opts="[10, 20, 30, 40, 100, 1000]"
+                @on-page-size-change="changeTotalSize"
+                @on-change="changeTotalPage"
+                :current="page_index"
+                show-total
+                :total="total"
+                show-sizer
+                :page-size="page_size"
+                style="text-align: center; margin-top: 10px"
+              />
+            </div>
+            <div v-show="tab === 2">
+              <Table :columns="detailColumns" :data="detailData" border>
+                <template slot="setSlot" slot-scope="{ row }">
+                  <a @click="handleDel(row)">删除</a>
+                </template>
+                <template slot="urlSet" slot-scope="{ row,index }">
+                  <div
+                    class="items"
+                    v-show="detailData[index].url.length != 0 ? true : false">
+                    <img
+                      @click="looks(detailData[index].url)"
+                      :src="$store.state.ip + row.url[0]"
+                      alt=""
+                    />
+                  </div>
+                </template>
+              </Table>
+              <Page
+                :page-size-opts="[10, 20, 30, 40, 100, 1000]"
+                @on-page-size-change="changeDetailSize"
+                @on-change="changeDetailPage"
+                :current="page_index"
+                show-total
+                :total="total"
+                show-sizer
+                :page-size="page_size"
+                style="text-align: center; margin-top: 10px"
+              />
+            </div>
+          </TabPane>
+          <div slot="extra" class="upload">
+            <Button
+              @click="handleTabsAdd"
+              size="small"
+              style="margin-right: 10px"
+              type="primary"
+              ghost
+              v-if="false"
+              >新增</Button
+            >
+             <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/deep_img_import'"
+              style="margin-right: 10px"
+            >
+              <Button size="small" type="primary" >图纸导入</Button>
+            </Upload>
+            <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/deep_import_new'"
+              style="margin-right: 10px"
+            >
+              <Button size="small" type="primary" ghost>导入</Button>
+            </Upload>
+          </div>
+        </Tabs>
+      </Card>
+    </div>
+  </div>
+</template>
+<script>
+export default {
+  data() {
+    return {
+      ruleValidate: {
+        name: [
+          {
+            required: true,
+            message: "The name cannot be empty",
+            trigger: "blur",
+          },
+        ],
+      },
+      totalColumns: [
+        // { type: "selection", align: "center", width: 60 },
+        { title: "序号", align: "center", type: "index", minWidth: 200 },
+        {
+          title: "楼号",
+          align: "center",
+          key: "house",
+          minWidth: 200,
+        },
+        {
+          title: "产品名称",
+          align: "center",
+          key: "product_title",
+          minWidth: 200,
+        },
+        { title: "图号", align: "center", key: "url_number", minWidth: 200 },
+        { title: "规格", align: "center", key: "model", minWidth: 200,
+        render:(h,params)=>{
+            const {row} = params;
+            const text = `${row.long}*${row.wide}*${row.high}`
+            return h('span',{},text)
+        } },
+        // { title: "型号", align: "center", key: "model", minWidth: 200 },
+      
+        // { title: "长", align: "center", key: "long", minWidth: 200 },
+        // { title: "宽", align: "center", key: "wide", minWidth: 200 },
+        // { title: "高", align: "center", key: "high", minWidth: 200 },
+        // { title: "材质", align: "center", key: "material", minWidth: 200 },
+        { title: "饰面", align: "center", key: "process_property", minWidth: 200 },
+          { title: "数量", align: "center", key: "num", minWidth: 200 },
+        // { title: "工艺", align: "center", key: "work", minWidth: 200 },
+        {
+          title: "图纸",
+          align: "center",
+          key: "url",
+          minWidth: 200,
+          slot: "urlSet",
+        },
+       
+        // { title: "备注", align: "center", key: "remark", minWidth: 200 },
+        // {
+        //   title: "拆单状态",
+        //   align: "center",
+        //   key: "state",
+        //   minWidth: 200,
+        //   render: (h, params) => {
+        //     const { row } = params;
+        //     return h("span", {}, row.state == 0 ? "未拆单" : "已拆单");
+        //   },
+        // },
+        // { title: "操作", align: "center", minWidth: 200, slot: "setSlot" },
+      ],
+      totalData: [],
+      headers: { Authorization: localStorage.getItem("token") },
+      detailColumns: [
+        // { type: "selection", align: "center", width: 60 },
+        { title: "序号", align: "center", type: "index", minWidth: 200 },
+        // { title: "区域编码", align: "center", key: "area_code", minWidth: 200 },
+        // {
+        //   title: "区域名称",
+        //   align: "center",
+        //   key: "area_title",
+        //   minWidth: 200,
+        // },
+       
+        { title: "楼号", align: "center", key: "house", minWidth: 200 },
+        { title: "单元", align: "center", key: "unit", minWidth: 200 },
+        { title: "楼层", align: "center", key: "layer", minWidth: 200 },
+        { title: "房号", align: "center", key: "number", minWidth: 200 },
+         { title: "房型", align: "center", key: "house_type", minWidth: 200 },
+        // { title: "位置", align: "center", key: "position", minWidth: 200 },
+        // {
+        //   title: "产品分类",
+        //   align: "center",
+        //   key: "product_type",
+        //   minWidth: 200,
+        // },
+        {
+          title: "产品名称",
+          align: "center",
+          key: "product_title",
+          minWidth: 200,
+        },
+         {
+          title: "左右式",
+          align: "center",
+          key: "fashion",
+          minWidth: 200,
+          render: (h, params) => {
+            const { row } = params;
+            return h(
+              "span",
+              {},
+              row.left_right_mode == 1
+                ? "左式"
+                : row.left_right_mode == 2
+                ? "右式"
+                : "无"
+            );
+          },
+        },
+        
+        { title: "图号", align: "center", key: "url_number", minWidth: 200 },
+         {
+          title: "图纸",
+          align: "center",
+          key: "url",
+          minWidth: 200,
+          slot: "urlSet",
+        },
+         { title: "饰面", align: "center", key: "process_property", minWidth: 200 },
+         { title: "规格", align: "center", key: "model", minWidth: 200,
+        render:(h,params)=>{
+            const {row} = params;
+            const text = `${row.long}*${row.wide}*${row.high}`
+            return h('span',{},text)
+        } },
+        { title: "数量", align: "center", key: "num", minWidth: 200 },
+        {
+          title: "单位",
+          align: "center",  
+          key: "product_unit",
+          minWidth: 200,
+        },
+        // { title: "型号", align: "center", key: "model", minWidth: 200 },
+        
+        // { title: "长", align: "center", key: "long", minWidth: 200 },
+        // { title: "宽", align: "center", key: "wide", minWidth: 200 },
+        // { title: "高", align: "center", key: "high", minWidth: 200 },
+        // { title: "材质", align: "center", key: "material", minWidth: 200 },
+       
+        // { title: "工艺", align: "center", key: "work", minWidth: 200 },
+       
+       
+        { title: "备注", align: "center", key: "remark", minWidth: 200 },
+        {
+          title: "拆单状态",
+          align: "center",
+          key: "state",
+          minWidth: 200,
+          render: (h, params) => {
+            const { row } = params;
+            return h("span", {}, row.state == 0 ? "未拆单" : "已拆单");
+          },
+        },
+         { title: "下单日期", align: "center", key: "crt_time", minWidth: 200,
+         render:(h,params)=>{
+             const {row} = params;
+              const text = this.func.replaceDateNoHMS(row.crt_time);
+              h('span',{},text)
+         } },
+          { title: "交货日期", align: "center", key: "arrive_time", minWidth: 200,
+            render:(h,params)=>{
+             const {row} = params;
+              const text = this.func.replaceDateNoHMS(row.arrive_time);
+              h('span',{},text)
+         }
+          },
+           { title: "下单编号", align: "center", key: "order_number", minWidth: 200 },
+            { title: "下单序号", align: "center", key: "order_numbers", minWidth: 200 },
+        { title: "操作", align: "center", minWidth: 200, slot: "setSlot" },
+      ],
+      detailData: [],
+      saveData: {
+        abbreviation: "",
+        address: "",
+        custom_title: "",
+        end_time: "",
+        front_money: "",
+        mobile: "",
+        nickname: "",
+        order_no: "",
+        remark: "",
+        residential_name: "",
+        start_time: "",
+        warning_state: "",
+        custom_detail_mobile: "",
+        custom_detail_id: "",
+      },
+      formData: {
+          mobile:''
+      },
+      custom_title_list: [],
+      warning_state_list: [],
+      nickname_list: [],
+      searchData: {
+        area_code: [],
+        area_title: [],
+        house_type: [],
+        product_type: [],
+        fashion: [],
+        house: [],
+        unit: [],
+        layer: [],
+        number: [],
+        position: [],
+        url_number: [],
+        product_title: [],
+        material: "",
+        color: "",
+        work: "",
+        state: "",
+      },
+      area_code: [],
+      area_title: [],
+      house_type: [],
+      house: [],
+      unit: [],
+      layer: [],
+      number: [],
+      position: [],
+      url_number: [],
+      product_title: [],
+      product_type: [],
+      fashion: [],
+      material: [],
+      color: [],
+      work: [],
+      state: [],
+      search_state: false,
+      copy_form: [],
+      type: this.$route.query.type,
+      tabs: 2,
+      total: 0,
+      page_index: 1,
+      page_size: 10,
+      save_state: false,
+      currency_tag: 0,
+      clientDetailList: [],
+      clientDetailList_respon: [],
+      clientDetailList_mobile: [],
+      clientDetailList_address: [],
+    };
+  },
+  computed: {
+    uploadData() {
+      return { order_no: this.formData.order_no || this.$route.query.order_no };
+    },
+  },
+  created() {
+      if(this.$route.query.type!=10){
+      this.axios
+        .get("/api/order_area_orders", {
+          params: {
+            order_no: this.$route.query.order_no,
+            oa_id: this.$route.query.oa_id,
+          },
+        })
+        .then((res) => {
+          this.formData = res.data;
+          this.handleCustomSelect(res.data.custom_id)
+        });
+      }
+    
+      this.axios.get("/api/custom_list").then((res) => {
+        this.custom_title_list = res.data.data;
+      });
+      this.axios.get("/api/warning_list").then((res) => {
+        this.warning_state_list = res.data.data;
+      });
+      this.axios
+        .get("/api/employee_list", { params: { type: 2 } })
+        .then((res) => {
+          this.nickname_list = res.data;
+        });
+    
+  },
+  mounted(){
+      if(this.$route.query.type!=10){
+           this.getData();
+      }
+    if(this.$route.query.type==3){
+        this.detailColumns.pop();
+    }
+
+  },
+  methods: {
+    looks(arr) {
+      // const array = [{ img_url: img }];
+      const array = arr.map((v) => {
+        return { img_url: v };
+      });
+      this.$previewImg({
+        list: array,
+        baseUrl: this.$store.state.ip,
+        baseImgField: "img_url",
+        baseTitleField: "",
+      });
+    },
+    handleBeforeUpload() {console.log(this.formData)},
+    handleClientDetailChange(val) {
+      val && (this.info.custom_detail_id = val);
+    },
+    handleCustomSelect(id) {
+        console.log(id)
+      id &&
+        this.axios({
+          method: "get",
+          url: "/api/custom_detail",
+          params: { id },
+        }).then((res) => {
+          this.clientDetailList = res.data.list;
+          // 去重负责人
+          this.clientDetailList_respon = this.unique(res.data.list);
+          // 赋值默认负责人
+          this.saveData.custom_detail_name = this.clientDetailList_respon[0].service_name;
+          // 取出手机号码是该负责人的
+          this.clientDetailList_mobile = this.clientDetailList.filter(
+            (item) => item.service_name == this.saveData.custom_detail_name
+          );
+          // 赋值默认手机号码
+          this.formData.mobile = this.clientDetailList_mobile[0].mobile;
+          this.saveData.custom_detail_mobile = this.clientDetailList_mobile[0].mobile;
+          // 去重手机号码
+          this.clientDetailList_mobile = this.unique(
+            this.clientDetailList_mobile
+          );
+          // 取出地址是该负责人的
+          this.clientDetailList_address = this.clientDetailList.filter(
+            (item) => item.service_name == this.saveData.custom_detail_name
+          );
+          // 赋值默认地址
+          console.log(this.clientDetailList_address)
+          this.formData.address = this.clientDetailList_address[0].address;
+          this.formData.custom_detail_id =
+            this.clientDetailList_respon[0].id || 0;
+          this.saveData.service_id = res.data.detail.service_id;
+          // this.$forceUpdate();
+        });
+    },
+    unique(array) {
+      let arr = JSON.parse(JSON.stringify(array));
+      for (var i = 0; i < arr.length; i++) {
+        for (var j = i + 1; j < arr.length; j++) {
+          if (arr[i].service_name == arr[j].service_name) {
+            //第一个等同于第二个,splice方法删除第二个
+            arr.splice(j, 1);
+            j--;
+          }
+        }
+      }
+      return arr;
+    },
+    handleGoPage(row) {
+      this.$router.push({
+        path: "/cms/BidSystem/ProductDeOrder/deorderdetail",
+        query: {
+          type: 3,
+          order_no: this.$route.query.order_no || this.saveData.order_no,
+          oa_id: row.oa_id,
+          orders_area_product_detail_id: row.id,
+        },
+      });
+    },
+  handleDel(row){
+       this.confirmDelete({
+        content: '是否确认?',
+        then: () => {
+            this.axios.get('/api/order_area_details_del',{params:{id:row.id}}).then(res=>{
+            if(res.code == 200){
+                this.$Message.success(res.msg)
+                this.getData(this.currency_tag);
+            }
+        })
+        }
+      })
+      
+  },
+    handleTabsChange(name) {
+      this.currency_tag = name;
+      this.getData(name);
+    },
+    changeTotalSize(e) {
+      this.page_size = e;
+      this.getData(0);
+    },
+    changeTotalPage(e) {
+      this.page_index = e;
+      this.getData(0);
+    },
+    changeDetailSize(e) {
+      this.page_size = e;
+      this.getData(1);
+    },
+    changeDetailPage(e) {
+      this.page_index = e;
+      this.getData(1);
+    },
+    getData(type) {
+        this.currency_tag = type;
+      if (type == 1) {
+        if (this.search_state) {
+            console.log('明细')
+          this.axios
+            .post("/api/order_area_details", {
+              order_no: this.$route.query.order_no || this.formData.order_no,
+              oa_id: this.$route.query.oa_id,
+              page_index: this.page_index,
+              page_size: this.page_size,
+              ...this.searchData,
+            })
+            .then((res) => {
+              console.log(res);
+              this.detailData = res.data.data;
+              this.total = res.data.total;
+            });
+        } else {
+        //   this.$route.query.order_no &&
+        console.log(1)
+            this.axios
+              .post("/api/order_area_details", {
+                order_no: this.$route.query.order_no || this.formData.order_no,
+                oa_id: this.$route.query.oa_id,
+                page_index: this.page_index,
+                page_size: this.page_size,
+                ...this.searchData
+              })
+              .then((res) => {
+                console.log(res);
+                this.detailData = res.data.data;
+                this.total = res.data.total;
+                this.area_code = res.data.area_code;
+                this.area_title = res.data.area_title;
+                this.color = res.data.color;
+                this.fashion = res.data.fashion;
+                this.house = res.data.house;
+                this.house_type = res.data.house_type;
+                this.layer = res.data.layer;
+                this.material = res.data.material;
+                this.number = res.data.number;
+                this.position = res.data.position;
+                this.product_title = res.data.product_title;
+                this.product_type = res.data.product_type;
+                this.state = res.data.state;
+                this.unit = res.data.unit;
+                this.url_number = res.data.url_number;
+                this.work = res.data.work;
+                this.copy_form = this.searchData;
+              });
+        }
+      } else if (type == 0) {
+        console.log("111 :>> ", 111);
+        this.axios
+          .post("/api/order_area_details", {
+            type: 1,
+            order_no: this.$route.query.order_no || this.formData.order_no,
+            page_index: this.page_index,
+            oa_id: this.$route.query.oa_id,
+            page_size: this.page_size,
+            ...this.searchData,
+          })
+          .then((res) => {
+            console.log(res);
+            this.detailData = res.data.data;
+            this.totalData = res.data.data;
+            this.total = res.data.total;
+            this.area_code = res.data.area_code;
+            this.area_title = res.data.area_title;
+            this.color = res.data.color;
+            this.fashion = res.data.fashion;
+            this.house = res.data.house;
+            this.house_type = res.data.house_type;
+            this.layer = res.data.layer;
+            this.material = res.data.material;
+            this.number = res.data.number;
+            this.position = res.data.position;
+            this.product_title = res.data.product_title;
+            this.product_type = res.data.product_type;
+            this.state = res.data.state;
+            this.unit = res.data.unit;
+            this.url_number = res.data.url_number;
+            this.work = res.data.work;
+            this.copy_form = this.searchData;
+          });
+      } else {
+        this.axios
+          .post("/api/order_area_details", {
+            type: this.$route.query.type,
+            oa_id: this.$route.query.oa_id,
+            order_no: this.$route.query.order_no || this.formData.order_no,
+            ...{ page_index: this.page_index, page_size: this.page_size },
+            ...this.searchData,
+          })
+          .then((res) => {
+            console.log(res.msg.house_type, this.house_type);
+
+            this.totalData = res.data.data;
+            this.total = res.data.total;
+            this.area_code = res.data.area_code;
+            this.area_title = res.data.area_title;
+            this.color = res.data.color;
+            this.fashion = res.data.fashion;
+            this.house = res.data.house;
+            this.house_type = res.data.house_type;
+            this.layer = res.data.layer;
+            this.material = res.data.material;
+            this.number = res.data.number;
+            this.position = res.data.position;
+            this.product_title = res.data.product_title;
+            this.product_type = res.data.product_type;
+            this.state = res.data.state;
+            this.unit = res.data.unit;
+            this.url_number = res.data.url_number;
+            this.work = res.data.work;
+            this.copy_form = this.searchData;
+            
+          });
+      }
+    },
+    uploadError(err) {
+      this.$Message.error(err.msg || "导入失败");
+    },
+    uploadSuccess(res) {
+      if (res.code == 200) {
+          console.log(res)
+        this.$Message.success(res.msg);
+        this.search_state = true;
+        this.getData(this.currency_tag);
+      } else {
+        this.$Message.warning(res.msg || "导入失败");
+      }
+      // this.page_index = 1;
+      //   this.page_size = 10;
+      //   this.axios
+      //     .post("/api/order_area_details", {
+      //       ...this.$route.query,
+      //       ...{ page_index: this.page_index, page_size: this.page_size },
+      //       order_no:this.saveData.order_no
+      //     })
+      //     .then((res) => {
+      //         console.log(res)
+      //       this.totalData = res.msg.data;
+      //       this.total = res.msg.total;
+      //       this.area_code = res.msg.area_code;
+      //       this.area_title = res.msg.area_title;
+      //       this.color = res.msg.color;
+      //       this.fashion = res.msg.fashion;
+      //       this.house = res.msg.house;
+      //       this.house_type = res.msg.house_type;
+      //       this.layer = res.msg.layer;
+      //       this.material = res.msg.material;
+      //       this.number = res.msg.number;
+      //       this.position = res.msg.position;
+      //       this.product_title = res.msg.product_title;
+      //       this.product_type = res.msg.product_type;
+      //       this.state = res.msg.state;
+      //       this.unit = res.msg.unit;
+      //       this.url_number = res.msg.url_number;
+      //       this.work = res.msg.work;
+      //       this.copy_form = this.searchData;
+      //     });
+    },
+    save() {
+      if (
+        !this.formData.order_no &&
+        !this.formData.residential_name &&
+        !this.formData.abbreviation &&
+        !this.formData.custom_title &&
+        !this.formData.warning_state
+      ) {
+        this.$message.error("请填写必要信息!");
+      } else {
+          this.formData.service_id = this.formData.nickname_id;
+        this.axios
+          .post("/api/order_area_save", { ...this.formData })
+          .then((res) => {
+            this.$message.success(res.msg);
+            this.save_state = true;
+          });
+      }
+    },
+    goback() {
+      this.$router.go(-1);
+    },
+    handleTabsAdd() {
+      this.tabs++;
+    },
+    search() {
+    //   this.search_state = true;
+    console.log(this.currency_tag,'haha')
+      this.getData(this.currency_tag);
+      
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+.changeDetail {
+  .content {
+    overflow: auto;
+    height: 90%;
+    .form_content {
+      display: flex;
+      flex-wrap: wrap;
+    }
+    .card {
+      .form_middle {
+        .form_middle_content {
+          display: flex;
+          flex-wrap: wrap;
+        }
+      }
+    }
+  }
+}
+.ivu-form-item {
+  width: 250px;
+}
+.upload {
+  display: flex;
+  justify-content: space-around;
+}
+.items {
+  width: auto;
+  height: 50px;
+  margin: auto;
+//   overflow: hidden;
+  border-radius: 5px;
+  position: relative;
+  img {
+    max-width: 50px;
+    max-height: 50px;
+  }
+}
+</style>

+ 16 - 11
src/views/BidSystem/DeepeningOrder/list.vue

@@ -73,10 +73,11 @@
           >
           <a
             style="margin: 0 5px"
-            :disabled="row.deep_status == 2"
+           
             @click="handleSet(row, index, 2)"
             >编辑</a
           >
+           <!-- :disabled="row.deep_status == 2" -->
           <a style="margin: 0 5px" @click="handleSet(row, index, 3)">详情</a>
           <a
             style="margin: 0 5px"
@@ -180,7 +181,7 @@ export default {
         },
         { title: "订单号", align: "center", key: "order_no", minWidth: 150 },
         {
-          title: "项目名称",
+          title: "小区名称",
           align: "center",
           key: "residential_name",
           minWidth: 120,
@@ -230,7 +231,7 @@ export default {
             h("span", {}, this.func.replaceDateNoHMS(params.row.end_time)),
         },
         {
-          title: "深化状态",
+          title: "订单状态",
           align: "center",
           key: "deep_status",
           minWidth: 100,
@@ -355,7 +356,8 @@ export default {
         // 转详情页
         case 2:
           this.$router.push({
-            path: "/cms/BidSystem/DeepeningOrder/detail",
+            path: "/cms/BidSystem/DeepeningOrder/deepDetail",
+            // path: "/cms/BidSystem/DeepeningOrder/detail", 原编辑页
             query: {
               type,
               order_no: row.order_no,
@@ -365,7 +367,8 @@ export default {
           break;
         case 3:
           this.$router.push({
-            path: "/cms/BidSystem/DeepeningOrder/info",
+            path: "/cms/BidSystem/DeepeningOrder/deepDetail",
+            // path: "/cms/BidSystem/DeepeningOrder/info",原详情页
             query: {
               type,
               order_no: row.order_no,
@@ -406,7 +409,8 @@ export default {
     },
      gopage() {
       this.$router.push({
-        path: "/cms/BidSystem/DeepeningOrder/infodetail",
+        path:'/cms/BidSystem/DeepeningOrder/deepDetail',
+        // path: "/cms/BidSystem/DeepeningOrder/infodetail",//之前新增
         query: {
           type: 10,
         },
@@ -483,14 +487,14 @@ export default {
           placeholder: "请输入订单号",
         },
         {
-          title: "项目名称",
+          title: "小区名称",
+          serverName: "order_no",
           name: "Input",
-          placeholder: "请输入",
           value: "",
-          serverName: "residential_name",
+          placeholder: "请输入订单号",
         },
         {
-          title: "客户昵称",
+          title: "客户",
           name: "Input",
           placeholder: "请输入",
           value: "",
@@ -506,7 +510,7 @@ export default {
         {
           title: "深化状态",
           name: "Select",
-          placeholder: "请选择",
+          placeholder: "全部",
           serverName: "deep_status",
           value: 99,
           option: [
@@ -515,6 +519,7 @@ export default {
             { label: "深化完成", value: 2 },
           ],
         },
+         
         {
           title: "紧急程度",
           name: "Select",

+ 3 - 0
src/views/ProductionOrderList/ProductionPlanlist/BST_two.vue

@@ -12,6 +12,7 @@
       :tableData="tableData"
       :showPage="false"
       :page_index="page_index"
+      :loading="loading"
       :total="total"
     >
       <div slot="titleButton">
@@ -124,6 +125,7 @@ import { mapState } from "vuex";
 export default {
   data() {
     return {
+      loading: true,
       url_number_list:[],
         tableModalColumns: [
         {
@@ -703,6 +705,7 @@ export default {
            data.push(obj)
           })
           this.url_number_list = data
+          this.loading = false;
         }
       );
     },

+ 1 - 0
src/views/ProductionOrderList/ProductionsOrder/BST_Decorationlist.vue

@@ -1804,6 +1804,7 @@ export default {
         data.printparams = printparamsJsonArray;
         let sub_data = JSON.parse(JSON.stringify(data));
         sub_data.printparams = JSON.stringify(sub_data.printparams);
+        console.log(sub_data);
         let _this = this;
         $.ajax({
           type: "post",

+ 205 - 71
src/views/PurchasingManage/ArrivalOrder/edit.vue

@@ -2,10 +2,22 @@
   <div>
     <Toptitle :title="$route.query.type==1?'新增到货单':$route.query.type==2?'查看到货单':'编辑到货单'">
       <slot name="titleButton">
-        <Button @click="handleReference(2)"
+         <Button type="primary" ghost style="margin-right: 10px" v-if="$route.query.type==2" @click="examine"
+          >{{searchData.state==0?'审批':'弃审'}}</Button
+        >
+         <Button type="primary" ghost style="margin-right: 10px" v-if="$route.query.type==2" @click="typeChange(1)"
+          >打开</Button
+        >
+         <Button type="primary" ghost style="margin-right: 10px" v-if="$route.query.type==2" @click="typeChange(0)"
+          >关闭</Button
+        >
+         <Button type="primary" ghost style="margin-right: 10px"
+          >栏目设置</Button
+        >
+        <Button @click="handleReference(2,searchData.supply_title)"
                 type="primary"
                 ghost
-                v-show="!isCheck"
+                v-show="!isCheck&&$route.query.type!=3"
                 style="margin-right:10px;">参照采购单</Button>
         <Button @click="goBack"
                 type="primary"
@@ -18,8 +30,9 @@
                 style="margin-right:10px;">确定</Button>
       </slot>
     </Toptitle>
+    <div style="height:90%;overflow:auto">
     <div class="content_topform">
-      <Form :label-width="90"
+      <Form :label-width="100"
             :model="searchData">
         <!-- <FormItem label="项目名称:">
           <Input type="text"
@@ -32,29 +45,31 @@
                 @click="showProjectModal=true">选择</span>
           </Input>
         </FormItem> -->
+          <FormItem label="到货单号:">
+          <Input type="text"
+                 v-show="!isCheck"
+                 size="small"
+                 readonly
+                 v-model="searchData.arrival_no"
+                 disabled
+                 style="width: 200px"
+                 placeholder="自动生成" />
+          <span v-show="isCheck">{{searchData.arrival_no}}</span>
+        </FormItem>
         <FormItem label="供应商名称:">
           <Input type="text"
                  size="small"
                  v-model="searchData.supply_title"
                  v-show="!isCheck"
-                 style="width: 200px;margin-top:6px"
+                 style="width: 200px;"
                  placeholder="供应商名称">
-          <span slot="append"
+          <!-- <span slot="append"
                 style="cursor:pointer;"
-                @click="showSupplierModal=true">选择</span>
+                @click="showSupplierModal=true">选择</span> -->
           </Input>
           <span v-show="isCheck">{{searchData.supply_title}}</span>
         </FormItem>
-        <FormItem label="单据号:">
-          <Input type="text"
-                 v-show="!isCheck"
-                 size="small"
-                 readonly
-                 v-model="searchData.purchase_order_arrive_no"
-                 style="width: 200px"
-                 placeholder="自动生成" />
-          <span v-show="isCheck">{{searchData.purchase_order_arrive_no}}</span>
-        </FormItem>
+      
         <FormItem label="制单人:"
                   v-show="isCheck">
           <!-- <Input type="text"
@@ -62,18 +77,27 @@
                  v-model="searchData.nickname"
                  style="width: 200px"
                  placeholder="制单人" /> -->
-          <span>{{searchData.nickname}}</span>
+          <span>{{searchData.user_name}}</span>
         </FormItem>
-        <FormItem label="单日期:">
+        <FormItem label="单日期:" class="order_time">
           <DatePicker type="date"
                       size="small"
                       v-show="!isCheck"
                       style="width: 200px"
                       placeholder="年/月/日"
-                      v-model="searchData.crt_time"></DatePicker>
-          <span v-show="isCheck">{{func.replaceDateNoHMS(searchData.crt_time)}}</span>
+                      v-model="searchData.order_time"></DatePicker>
+          <span v-show="isCheck">{{func.replaceDateNoHMS(searchData.order_time)}}</span>
+        </FormItem>
+          <FormItem label='审批人:' v-if="$route.query.type==2">
+          <span>{{searchData.check_name?searchData.check_name:''}}</span>
         </FormItem>
-        <FormItem label="预计到货:">
+        <FormItem label='审批状态:' v-if="$route.query.type==2">
+          <span>{{searchData.state==0?'未审批':'已审批'}}</span>
+        </FormItem>
+          <FormItem label='订单创建时间:' v-if="$route.query.type==2" >
+          <span>{{searchData.crt_time?func.replaceDate(searchData.crt_time):''}}</span>
+        </FormItem>
+        <!-- <FormItem label="预计到货:">
           <DatePicker type="date"
                       size="small"
                       v-show="!isCheck"
@@ -81,7 +105,7 @@
                       placeholder="年/月/日"
                       v-model="searchData.arrive_time"></DatePicker>
           <span v-show="isCheck">{{func.replaceDateNoHMS(searchData.arrive_time)}}</span>
-        </FormItem>
+        </FormItem> -->
         <FormItem label="备注:">
           <Input type="textarea"
                  size="small"
@@ -96,8 +120,8 @@
     <div class="content_table">
       <div class="content_table_btn">
         <div>
-          <!-- <span>请购清单</span>
-          <Button @click="showModal=true"
+          <span>到货质检清单</span>
+          <!-- <Button @click="showModal=true"
                   type="primary"
                   size="small"
                   style="margin-left:10px;">选择物料</Button> -->
@@ -109,6 +133,7 @@
              border
              show-summary
              :summary-method="handleSummary"
+            @on-selection-change='selectRow'
              :data="tableData">
             <template slot="numberSet" slot-scope="{row , index }">
                <Tooltip
@@ -122,26 +147,21 @@
                 </div>
               </div>
             </div>
-            <Input
-              type="text"
-              v-show="!isCheck"
-              size="small"
-              v-model="tableData[index].num"
-              placeholder="数量"
-            >
-            </Input>
-            <span v-show="isCheck">{{ tableData[index].num }}</span>
+            <span >{{ tableData[index].num }}</span>
           </Tooltip>
         </template>
+        <template slot="reference_num" slot-scope="{row}">
+         <span>{{row.num-row.reference_num}}</span>
+        </template>
         <template slot="setSlot"
                   slot-scope="{row,index}">
+
           <a style="margin:0 5px"
-             :disabled="row.state==0"
              v-show="!isCheck"
              @click="handleSet(4,row,index)">删除</a>
         </template>
       </Table>
-    </div>
+    </div></div>
     <Modal v-model="showModal"
            title="选择物料"
            width='80'
@@ -160,6 +180,7 @@
             <div><span>物料名称:</span>
               <Input type="text"
                      v-model="modalData.title"
+                     clearable
                      placeholder="请输入物料名称" />
             </div>
             <Button @click="initModal()"
@@ -312,7 +333,8 @@ export default {
     return {
       fax_modify: '',
       searchData: {
-        client_name: ''
+        order_time:new Date().toLocaleString(),
+        supply_title:''
       },
       modalProjectData: {
         title: '',
@@ -369,8 +391,9 @@ export default {
           }
         },
         { title: '计量单位', key: 'unit', align: 'center', minWidth: 100 },
+       
         {
-          title: '到货数量', key: 'num', align: 'center', minWidth: 120,slot:'numberSet'
+          title: '数量', key: 'num', align: 'center', minWidth: 120,slot:'numberSet'
           // render: (h, params) => {
           //   const { row, index } = params
           //   const currentRow = JSON.parse(JSON.stringify(this.tableData[index]))
@@ -416,7 +439,12 @@ export default {
           // }
         },
         {
-          title: '税率(%)', key: 'fax', align: 'center', minWidth: 120,
+          title: '税率(%)', key: 'tax_rate', align: 'center', minWidth: 120,
+          render:(h,params)=>{
+             const { row, index } = params
+             const text = `${row.tax_rate*100}%`
+             return h('span',{},text)
+          }
           // render: (h, params) => {
           //   const { row, index } = params
           //   const currentRow = JSON.parse(JSON.stringify(this.tableData[index]))
@@ -461,7 +489,7 @@ export default {
           // }
         },
         {
-          title: '无税金额', key: 'no_tax_amount', align: 'center', minWidth: 120,
+          title: '无税金额', key: 'no_tax_total_price', align: 'center', minWidth: 120,
           // render: (h, params) => {
           //   const { row, index } = params
           //   const currentRow = JSON.parse(JSON.stringify(this.tableData[index]))
@@ -484,7 +512,7 @@ export default {
           // }
         },
         {
-          title: '税额', key: 'tax_amount', align: 'center', minWidth: 120,
+          title: '税额', key: 'tax_total_price', align: 'center', minWidth: 120,
           // render: (h, params) => {
           //   const { row, index } = params
           //   const currentRow = JSON.parse(JSON.stringify(this.tableData[index]))
@@ -674,6 +702,10 @@ export default {
       ],
       isCheck: false,
       warningList: [],
+      purchase_data:[],
+      purchase_tableData:[],
+      selectChoose:[],
+      del_list:[],
     }
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
@@ -698,11 +730,70 @@ export default {
   },
   // 生命周期 - 挂载完成(可以访问DOM元素)
   mounted () {
-    if (this.$route.query.purchase_order_arrive_no != '') {
-      this.initData(this.$route.query.purchase_order_arrive_no)
+    if (this.$route.query.type != 1) {
+      this.initData(this.$route.query.arrival_no)
+    }
+     if(this.$route.query.type == 2){
+      this.tableColumns.pop();
+      this.tableColumns.splice(5,0,{
+            title:'未参照数量',key:'reference_num',align:'center',minWidth:120,slot:'reference_num'
+        })
+      this.tableColumns.unshift({
+        align:'center',
+        minWidth:80,
+        type:"selection",
+        key:"select"
+      })
+      this.tableColumns.push({
+          title: "状态",
+          key: "lock",
+          align: "center",
+          minWidth: 100,
+          render: (h, params) => {
+            const { row } = params
+            let text = row.lock==1?'打开':'关闭'
+            return h('span', {
+            }, text)
+          },
+        })
     }
   },
   methods: {
+    typeChange(val){ 
+      if(this.selectChoose.length==0){
+        return this.$Message.warning("请先选择物料")
+      }
+      let id=[];
+      this.selectChoose.forEach(v=>{
+        id.push(v.id);
+      })
+      let state = val;
+     this.axios.post('/api/purchase_arrive_switch',{id,state}).then((res)=>{
+           if(res.code==200){
+             this.$Message.success(res.msg);
+             this.initData(this.$route.query.arrival_no);
+           }
+     })
+    },
+    selectRow(e){
+      this.selectChoose = e;
+    },
+     examine(){
+      
+      let state='';
+     
+       if(this.searchData.state == 0){
+            state = 1;
+       }else{
+         state = 0;
+       }
+       this.axios.get('/api/purchase_arrive_check',{params:{state,arrival_no:this.$route.query.arrival_no}}).then((res)=>{
+          if(res.code==200){
+             this.$Message.success(res.msg);
+             this.initData(this.$route.query.arrival_no)
+           }
+       })
+    },
      handleToolShow(index, row) {
       if (this.warehouse) {
         return
@@ -721,40 +812,43 @@ export default {
       // this.warehouse.num = this.warehouseTotal[index].num;
       // this.warehouse.warehouseName = this.warehouseTotal[index].warehouseName
     },
-    initData (purchase_order_arrive_no) {
+    initData (arrival_no) {
       this.axios({
         method: 'get',
         url: '/api/purchase_arrive_detail',
-        params: { purchase_order_arrive_no }
+        params: { arrival_no }
       }).then((res) => {
         this.tableData = res.data.list
-        this.tableData.forEach(element => {
-          element.fax = element.fax * 100
-          element.total_price = (1 * element.price * element.num).toFixed(2)
-          element.no_tax_price = (1 * element.price / (1 + 1 * element.fax / 100)).toFixed(2)
-          element.no_tax_amount = (1 * element.no_tax_price * element.num).toFixed(2)
-          element.tax_amount = (1 * element.total_price - 1 * element.no_tax_amount).toFixed(2)
-        });
+       
         const data = JSON.parse(JSON.stringify(res.data))
         delete data.list
         this.searchData = data
         console.log(this.searchData);
         this.searchData.arrive_time = this.searchData.arrive_time * 1000 ? new Date(this.searchData.arrive_time * 1000).toLocaleString() : ''
-        this.searchData.crt_time = this.searchData.crt_time ? new Date(this.searchData.crt_time * 1000).toLocaleString() : ''
+        this.searchData.order_time = this.func.replaceDate(this.searchData.order_time);
+       this.searchData.crt_time = this.func.replaceDate(this.searchData.crt_time)
       }).catch((err) => { });
     },
     postData () {
+      if(!this.searchData.order_time){
+       return this.$Message.warning('请选择单据日期')
+      };
+       let objData = [];
+        objData =JSON.parse(JSON.stringify(this.tableData)); 
+        if(objData.length == 0){
+         return this.$Message.warning('请选择物料')
+        }
       let obj = JSON.parse(JSON.stringify(this.searchData))
-      obj.crt_time = new Date(obj.crt_time).getTime() / 1000 || ''
+      obj.order_time = new Date(obj.order_time).getTime() / 1000 || ''
       obj.arrive_time = new Date(obj.arrive_time).getTime() / 1000|| ''
-      if (this.$route.query.purchase_order_arrive_no == '') {
+      if (this.$route.query.type == 1) {
         // 新增
         this.axios({
           method: 'post',
-          url: '/api/purchase_arrive_add',
+          url: '/api/purchase_arrive_add ',
           data: {
             ...obj,
-            list: this.tableData
+            children: this.tableData
           }
         }).then((res) => {
           this.$Message.success(res.msg)
@@ -766,9 +860,8 @@ export default {
           method: 'post',
           url: '/api/purchase_arrive_edit',
           data: {
-            purchase_order_arrive_no: this.$route.query.purchase_order_arrive_no,
             ...obj,
-            list: this.tableData
+            del_list: this.del_list
           }
         }).then((res) => {
           this.$Message.success(res.msg)
@@ -776,27 +869,59 @@ export default {
         }).catch((err) => { });
       }
     },
-    handleReference (type) {
+    handleReference (type,supply_title) {
       this.$reference({
         type,
-        title: '参照采购单',
+        supply_title,
+        title: '参照采购订单',
         then: (result, data) => {
           // console.log('result :>> ', result);
           // console.log('data :>> ', data);
-          // todo
-          result.forEach(element => {
-            element.fax = element.fax * 100
-            element.total_price = (1 * element.price * element.num).toFixed(2)
-            element.no_tax_price = (1 * element.price / (1 + 1 * element.fax / 100)).toFixed(2)
-            element.no_tax_amount = (1 * element.no_tax_price * element.num).toFixed(2)
-            element.tax_amount = (1 * element.total_price - 1 * element.no_tax_amount).toFixed(2)
-          });
-          this.tableData = [...this.tableData, ...result]
+        let id = [];
+        this.tableData.forEach(v=>{
+          id.push(v.id)
+        })
+          if(this.tableData.length == 0){
+            this.tableData = result;
+            this.tableData.forEach(v=>{
+              v.num = v.arrive_num*1
+            })
+          }else{
+         let content = [];
+         this.tableData.forEach(v=>{
+          result.forEach(m=>{
+             if(v.id==m.id){
+               console.log(m.arrive_num)
+               v.num = 1*m.arrive_num
+             }
+           })
+         })
+         result.forEach(v=>{
+           if(id.indexOf(v.id)<0){
+             content.push(v)
+           }
+         })
+     
+        this.tableData.push(...content)
+        }
+        let rowTableData = JSON.parse(JSON.stringify(this.tableData));
+        rowTableData.forEach((element,index)=>{
+          this.tableData[index].price = 1*element.price.toFixed(2);
+         this.tableData[index].no_tax_price = (element.price*1/(1+element.tax_rate*1)).toFixed(2);
+        this.tableData[index].no_tax_total_price = ((element.price*1/(1+element.tax_rate*1))*element.num).toFixed(2);
+        this.tableData[index].total_price = (element.price*1*element.num).toFixed(2);
+        this.tableData[index].tax_total_price = (element.price*1*element.num-(element.price*1/(1+element.tax_rate*1))*element.num).toFixed(2);
+        })
+        this.searchData.supply_title = result[0].supply_title||'';
+        this.searchData.supply_id = result[0].supply_id||'';
+        console.log(result)
+        console.log(this.tableData)
         }
       })
     },
     handleSet (type, row, index) {
       this.tableData.splice(index, 1)
+      this.del_list.push(row.id)
     },
     handleSelect () {
       this.modalData.selectedData.forEach(element => {
@@ -946,7 +1071,7 @@ export default {
       const sums = {};
       columns.forEach((column, index) => {
         const key = column.key;
-        if (index === 0) {
+        if (index == 1) {
           sums[key] = {
             key,
             value: '合计'
@@ -954,7 +1079,7 @@ export default {
           return;
         }
         const values = data.map(item => Number(item[key]));
-        if (!values.every(value => isNaN(value))) {
+         if (key == 'num'||key=='no_tax_total_price'||key=='total_price'||key=='tax_total_price') {
           const v = values.reduce((prev, curr) => {
             const value = Number(curr);
             if (!isNaN(value)) {
@@ -1069,4 +1194,13 @@ export default {
 /deep/ .ivu-table-wrapper {
   overflow: visible;
 } //穿透iview
+/deep/.order_time .ivu-form-item-label:before {
+    content: '*';
+    display: inline-block;
+    margin-right: 4px;
+    line-height: 1;
+    font-family: SimSun;
+    font-size: 14px;
+    color: #ed4014;
+}
 </style>

+ 102 - 56
src/views/PurchasingManage/ArrivalOrder/list.vue

@@ -1,36 +1,39 @@
 <template>
   <div class="arrival_order">
-    <Toptitle title="到货列表">
+    <Toptitle title="到货质检">
       <slot name="titleButton">
         <!-- <Button @click="handleCodeRule"
                 type="primary"
                 ghost
                 style="margin-right:10px;">编码规则</Button> -->
-        <Button type="primary"
-                @click="handleGoPage(1,'')"
-                style="margin-right:10px;">新增</Button>
+      
       </slot>
     </Toptitle>
     <div class="arrival_order_search">
       <Form :label-width="90"
             :model="searchData">
-        <FormItem label="订单号:">
+        <FormItem label="到货单号:" style="width:300px">
           <Input type="text"
                  size="small"
                  clearable
-                 v-model="searchData.order_no"
+                 v-model="searchData.arrival_no"
                  style="width: 150px"
                  placeholder="订单号" />
         </FormItem>
-        <!-- <FormItem label="项目名称:">
-          <Input type="text"
-                 size="small"
-                 v-model="searchData.project_title"
-                 style="width: 150px"
-                 placeholder="项目名称" />
-        </FormItem> -->
-        <FormItem label="提交人:">
-          <Select v-model="searchData.user_id"
+       <FormItem label="供应商名称:" style="width:300px">
+          <Select v-model="searchData.supply_id"
+                  size="small"
+                  clearable
+                  style="width: 150px">
+            <Option v-for="(sitem) in suppliersList"
+                    :key="sitem.id"
+                    :label="sitem.title"
+                    :value="sitem.id">
+            </Option>
+          </Select>
+        </FormItem>
+        <FormItem label="制单人:" style="width:300px">
+          <Select v-model="searchData.crt_id"
                   size="small"
                   clearable
                   style="width: 150px">
@@ -52,29 +55,63 @@
                     :value=1 />
           </Select>
         </FormItem> -->
-        <FormItem label="审批状态:">
+        <FormItem label="审批状态:" style="width:300px">
           <Select v-model="searchData.state"
                   size="small"
                   clearable
                   style="width: 150px">
-            <Option label='未提交'
-                    :value=0 />
-            <Option label='审核中'
-                    :value=1 />
-            <Option label='通过'
-                    :value=2 />
-            <Option label='驳回'
-                    :value=3 />
+            <Option label='未审核'
+                    :value='0' />
+            <Option label='已审核'
+                    :value='1' />
+          </Select>
+        </FormItem>
+         <FormItem label="审批人:" style="width:300px">
+          <Select v-model="searchData.check_id"
+                  size="small"
+                  clearable
+                  style="width: 150px">
+            <Option v-for="(sitem) in userList"
+                    :key="sitem.id"
+                    :label="sitem.nickname"
+                    :value="sitem.id">
+            </Option>
           </Select>
         </FormItem>
-        <FormItem label="制单时间:">
+        <FormItem label="订单状态:" style="width:300px">
+          <Select v-model="searchData.lock"
+                  size="small"
+                  clearable
+                  style="width: 150px">
+            <Option label='已关闭'
+                    :value='0' />
+            <Option label='部分关闭'
+                    :value='1' />
+                    <Option label='正常'
+                    :value='2' />
+          </Select>
+        </FormItem>
+        <FormItem label="单据时间:" style="width:450px">
           <DatePicker type="date"
                       size="small"
                       style="width: 150px"
                       placeholder="年/月/日"
                       v-model="searchData.start_time"></DatePicker>
+   
+        ~
+          <DatePicker type="date"
+                      size="small"
+                      style="width: 150px"
+                      placeholder="年/月/日"
+                      v-model="searchData.end_time"></DatePicker>
         </FormItem>
-        <FormItem label="~">
+           <FormItem label="订单创建时间:" style="width:450px" :label-width='100'>
+          <DatePicker type="date"
+                      size="small"
+                      style="width: 150px"
+                      placeholder="年/月/日"
+                      v-model="searchData.start_time"></DatePicker>
+        ~
           <DatePicker type="date"
                       size="small"
                       style="width: 150px"
@@ -82,13 +119,17 @@
                       v-model="searchData.end_time"></DatePicker>
         </FormItem>
         <FormItem>
-          <Button type="primary"
-                  size="small"
+            <Button type="primary"
+                 
                   @click="initData(searchData)"
                   style="margin-right:10px;">搜索</Button>
         </FormItem>
       </Form>
       <div class="content_right_topfrom_btn">
+       
+            <Button type="primary"
+                @click="handleGoPage(1,'')"
+                style="margin-right:10px;">新增</Button>
       </div>
     </div>
     <div class="arrival_order_content">
@@ -102,14 +143,13 @@
             <a style="margin:0 5px"
                @click="handleSet(2,row,index)">详情</a>
             <a style="margin:0 5px"
-               :disabled="row.state==1||row.state==2"
+               v-if="!row.state==1||!row.state==2"
                @click="handleSet(3,row,index)">编辑</a>
             <a style="margin:0 5px"
-               :disabled="row.state==1||row.state==2"
+               v-if="!row.state==1||!row.state==2"
                @click="handleSet(4,row,index)">删除</a>
             <a style="margin:0 5px"
-               :disabled="row.state==1||row.state==2"
-               @click="handleSet(5,row,index)">提交</a>
+               @click="handleSet(5,row,index)">{{row.state==0?'审批':'弃审'}}</a>
           </template>
         </Table>
         <div class="arrival_order_content_page">
@@ -142,46 +182,47 @@ export default {
     // 这里存放数据
     return {
       searchData: {
-        order_no: '',
+        arrival_no: '',
         project_title: '',
         supply_title: '',
-        type_id: '',
-        user_id: '',
+        check_id: '',
+        crt_id: '',
         lock: '',
         state: '',
         start_time: '',
         end_time: '',
       },
       tableColumns: [
-        { title: '订单号', key: 'purchase_order_arrive_no', align: 'center', minWidth: 140 },
+        { title: '到货单号', key: 'arrival_no', align: 'center', minWidth: 140 },
         // { title: '项目名称', key: 'client_name', align: 'center', minWidth: 140 },
         { title: '供应商名称', key: 'supply_title', align: 'center', minWidth: 140 },
         {
           title: '订单状态', key: 'lock', align: 'center', minWidth: 120,
-          render: (h, params) => {
+        render: (h, params) => {
             const { row } = params
-            const text = row.lock == 0 ? '正常' : '已关闭'
+            const text = row.lock == 0 ? '已关闭' :row.lock == 1?'部分关闭':'正常'
             return h('span', {}, text)
           }
         },
-        { title: '提交人', key: 'nickname', align: 'center', minWidth: 100 },
+        { title: '制单人', key: 'user_name', align: 'center', minWidth: 100 },
         {
           title: '审批状态', key: 'state', align: 'center', minWidth: 140,
-          render: (h, params) => {
+         render: (h, params) => {
             const { row } = params
-            const text = row.state == 0 ? '未提交' : row.state == 1 ? '审核中' : row.state == 2 ? '通过' : '驳回'
+            const text = row.state == 0 ? '未审批' : '已审批'
             return h('span', {}, text)
           }
         },
+          { title: '审批人', key: 'check_name', align: 'center', minWidth: 100 },
         {
-          title: '预计到货日期', key: 'arrive_time', align: 'center', minWidth: 140,
+          title: '单据日期', key: 'order_time', align: 'center', minWidth: 140,
           render: (h, params) => {
             const { row } = params
-            return h('span', {}, this.func.replaceDateNoHMS(row.arrive_time))
+            return h('span', {}, this.func.replaceDateNoHMS(row.order_time))
           }
         },
         {
-          title: '制单日期', key: 'crt_time', align: 'center', minWidth: 140,
+          title: '订单创建日期', key: 'crt_time', align: 'center', minWidth: 140,
           render: (h, params) => {
             const { row } = params
             return h('span', {}, this.func.replaceDate(row.crt_time))
@@ -194,12 +235,15 @@ export default {
       pageSize: 10,
       total: 0,
       userList: [],
+      suppliersList:[]
     }
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
   created () {
     // 获取操作员
     this.axios('/api/user').then(res => this.userList = res.data.data)
+     // 获取供应商列表
+    this.axios({ method: 'get', url: '/api/supply_list', }).then((res) => { this.suppliersList = res.data.data }).catch((err) => { });
   },
   // 生命周期 - 挂载完成(可以访问DOM元素)
   mounted () {
@@ -236,7 +280,7 @@ export default {
         case 1:
         case 2:
         case 3:
-          this.handleGoPage(type, row.purchase_order_arrive_no)
+          this.handleGoPage(type, row.arrival_no)
           break;
         case 4:
           this.$Modal.confirm({
@@ -247,7 +291,7 @@ export default {
                 method: 'post',
                 url: '/api/purchase_arrive_del',
                 data: {
-                  purchase_order_arrive_no: row.purchase_order_arrive_no
+                  arrival_no: row.arrival_no
                 }
               }).then((res) => {
                 this.$Message.success(res.msg)
@@ -259,16 +303,14 @@ export default {
           break;
         case 5:
           this.$Modal.confirm({
-            title: '确认提交?',
+            title: '确认审批?',
             onOk: () => {
               this.axios({
-                method: 'post',
-                url: '/api/purchase_arrive_pull',
-                data: {
-                  purchase_order_arrive_no: row.purchase_order_arrive_no,
-                  lock: row.lock,
-                  state: row.state + 1
-                }
+                method: 'get',
+                url: '/api/purchase_arrive_check',
+                  params:{arrival_no: row.arrival_no,
+                   state: row.state==0?1:0,}
+                
               }).then((res) => {
                 this.$Message.success(res.msg)
                 this.initData()
@@ -279,12 +321,12 @@ export default {
           break;
       }
     },
-    handleGoPage (type, purchase_order_arrive_no) {
+    handleGoPage (type, arrival_no) {
       this.$router.push({
         path: '/cms/PurchasingManage/ArrivalOrder/edit',
         query: {
           type,
-          purchase_order_arrive_no
+          arrival_no
         }
       })
     },
@@ -338,4 +380,8 @@ export default {
     padding-top: 20px;
   }
 }
+.content_right_topfrom_btn{
+  display: flex;
+  flex-direction: row-reverse;
+}
 </style>

+ 113 - 17
src/views/PurchasingManage/PurchasingOrder/edit.vue

@@ -16,7 +16,7 @@
         >
         <Button @click="handleReference(1)"
                 type="primary"
-                v-show="!isCheck"
+                v-show="!isCheck||$route.query.type!=3"
                 ghost
                 style="margin-right:10px;"
                >参照采购计划</Button>
@@ -59,20 +59,39 @@
           </Input>
           <span v-show="isCheck">{{searchData.residential_name}}</span>
         </FormItem> -->
-        <FormItem label="供应商名称:">
-          <Input type="text"
+        <FormItem label="供应商名称:" class="order_time">
+          <!-- <Input type="text"
                  size="small"
                  v-show="!isCheck"
                  v-model="searchData.supply_title"
-                 style="width: 300px;margin-top:6px"
+                 style="width: 250px;margin-top:6px"
                  placeholder="供应商名称">
           <span slot="append"
                 style="cursor:pointer;"
                 @click="showSupplierModal=true">选择</span>
-          </Input>
+          </Input> -->
+          <div style="display:flex;margin-top:5px">
+            <Select v-model="searchData.supply_id"
+                  size="small"
+                  v-show="!isCheck"
+                  clearable
+                  filterable
+                  label-in-value
+                  style="width: 200px">
+            <Option v-for="(sitem) in suppliersList"
+                    :key="sitem.id"
+                    :label="sitem.title"
+                    :value="sitem.id">
+            </Option>
+          </Select>
+          <Button type="primary"
+                style="cursor:pointer;"
+                size='small'
+                @click="showSupplierModal=true">选择</Button>
+          </div>
           <span v-show="isCheck">{{searchData.supply_title}}</span>
         </FormItem>
-        <FormItem label="采购订单类型:" :style="$route.query.type!=2?{marginLeft:'150px'}:{}">
+        <FormItem label="采购订单类型:" :style="$route.query.type!=2?{marginLeft:'20px'}:{}">
           <Select v-model="searchData.basics_purchase_id"
                   size="small"
                   v-show="!isCheck"
@@ -115,7 +134,7 @@
           </Select> -->
           <!-- <span>{{searchData.nickname}}</span>
         </FormItem> -->
-        <FormItem label="单据日期:">
+        <FormItem label="单据日期:" class="order_time">
           <DatePicker type="date"
                       v-show="!isCheck"
                       size="small"
@@ -184,6 +203,8 @@
         </div>
       </div>
       <Table :columns="tableColumns"
+             :draggable='true'
+             @on-drag-drop='onDragDrop'
              border
              :data="tableData"
              :max-height='500'
@@ -195,6 +216,9 @@
           <div v-else>
             <span >{{ tableData[index].material_type }}</span></div>
         </template>
+         <template slot="reference_num" slot-scope="{row}">
+         <span>{{row.num-row.reference_num}}</span>
+        </template>
          <template slot="material_title" slot-scope="{ row,index }">
             <span
               
@@ -324,6 +348,7 @@
             <div><span>物料名称:</span>
               <Input type="text"
                      v-model="modalData.title"
+                     clearable
                      placeholder="请输入物料名称" />
             </div>
             <Button @click="initModal()"
@@ -471,13 +496,13 @@
         <Form>
           <FormItem>
             <span>项目编码 : </span>
-        <Select v-model="total_project_info.code" style="width:200px">
+        <Select v-model="total_project_info.code" style="width:200px" filterable>
         <Option v-for="(item,index) in project_number" :value="item" :key="index">{{ item }}</Option>
     </Select>
           </FormItem>
              <FormItem>
           <span>项目名称 : </span>
-        <Select v-model="total_project_info.name" style="width:200px">
+        <Select v-model="total_project_info.name" style="width:200px" filterable>
         <Option v-for="(item,index) in project_name" :value="item" :key="index">{{ item }}</Option>
     </Select>
           </FormItem>
@@ -548,7 +573,8 @@ export default {
       btn_disable:false,
       fax_modify: '',
       searchData: {
-       residential_name: ''
+            order_time:new Date().toLocaleString(),
+            arrive_time:new Date().toLocaleString()
       },
       purchaseTypeList: [],
       modalProjectData: {
@@ -962,6 +988,7 @@ export default {
       purchase_tableData:[],
       plan_no:[],
       order_no:'',
+      suppliersList:[]
     }
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
@@ -1006,6 +1033,9 @@ export default {
     };
      if(this.$route.query.type == 2){
       this.tableColumns.pop();
+       this.tableColumns.splice(5,0,{
+            title:'未参照数量',key:'reference_num',align:'center',minWidth:120,slot:'reference_num'
+        })
       this.tableColumns.push({
           title: "状态",
           key: "lock",
@@ -1021,6 +1051,32 @@ export default {
     }
   },
   methods: {
+   onDragDrop(first,end){
+       if(this.tableData[first].material_title=="选择物料"){
+         return this.$Message.warning('选择物料不可拖动')
+      }
+      // this.tableData.splice(end,1,...this.tableData.splice(first,1,this.tableData[end]));
+    first = parseInt(first);
+    end = parseInt(end);
+    let tmp = this.tableData[first];
+    if(first<end){
+      for(let i=first+1;i<=end;i++){
+        this.tableData.splice(i-1,1,this.tableData[i])
+      }
+      this.tableData.splice(end,1,tmp)
+    }
+    if(first>end){
+      for(let i=first;i>end;i--){
+        this.tableData.splice(i,1,this.tableData[i-1])
+      }
+      this.tableData.splice(end,1,tmp)
+    }
+    this.tableData.forEach((v,index)=>{
+      if(index>=end){
+        v.drag = true;
+      }
+    })
+    },
      examine(){
       
       let state='';
@@ -1215,10 +1271,11 @@ if(this.selectChoose.length == 0){
       // this.warehouse.warehouseName = this.warehouseTotal[index].warehouseName
     },
     initData (order_no) {
+     
       this.axios({
-        method: 'get',
+        method: 'post',
         url: '/api/purchase_detail',
-        params: { order_no }
+        data: { order_no:[order_no] }
       }).then((res) => {
          if(this.$route.query.type==2){
               this.tableData = []
@@ -1257,6 +1314,23 @@ if(this.selectChoose.length == 0){
        if(!this.searchData.order_time){
        return this.$Message.warning('请选择单据日期')
       };
+      if(!this.searchData.supply_title){
+        return this.$Message.warning('请选择供应商')
+      }
+      let state = false;
+     let copy_data =JSON.parse(JSON.stringify(this.tableData));
+       copy_data.pop();
+       if(copy_data.length == 0){
+         return this.$Message.warning('请选择物料')
+       }
+       copy_data.forEach(element => {
+            if(!element.num){
+              return state = true
+            }
+          });
+           if(state){
+            return this.$Message.warning('物料数量不能为0')
+          }
       let obj = JSON.parse(JSON.stringify(this.searchData))
       obj.order_time = parseInt(new Date(obj.order_time).getTime() / 1000) || ''
       obj.arrive_time = parseInt(new Date(obj.arrive_time).getTime() / 1000) || ''
@@ -1293,6 +1367,9 @@ if(this.selectChoose.length == 0){
            this.purchase_data.forEach(m=>{
              if(v.material_detail_id = m[0].material_detail_id){
                   obj.children=[...m]
+                  obj.children.map(v=>{
+                    v.num = v.purchases_num*1
+                  })
              }
            })
            children.push(obj)
@@ -1314,17 +1391,21 @@ if(this.selectChoose.length == 0){
         }).catch((err) => { });
       } else {
           let objData = [];
-        objData =JSON.parse(JSON.stringify(this.tableData)); 
+          
+        objData =JSON.parse(JSON.stringify(this.tableData));
+         
         objData.pop();
+
          let upd_list = [];
          let add_list = [];
          let del_list = this.delData;
-         objData.forEach(v=>{
+         objData.forEach((v,index)=>{
+            v.sort = index+1;
            if(v.edit||v.copy){
               add_list.push(v)
            }
-            if(v.change||v.ad){
-              if(!v.edit||!v.copy){
+            if(v.change||v.ad||v.drag){
+              if(!v.edit&&!v.copy){
                  upd_list.push(v)
               }
             
@@ -1410,7 +1491,7 @@ if(this.selectChoose.length == 0){
                  m.forEach(mm=>{
                    v.forEach(vv=>{
                      if(mm.id == vv.id){
-                       mm.purchases_num = 1*vv.purchases_num+1*mm.purchases_num
+                       mm.purchases_num = 1*vv.purchases_num
                      }
                     if(id.indexOf(vv.id)<0){
                       m_content.push(vv)
@@ -1573,9 +1654,15 @@ if(this.selectChoose.length == 0){
     },
     handleSelection (selection, row) {
       this.modalData.selectedData.push(row)
+     
     },
     handleSelectedDele (row, index) {
       this.modalData.selectedData.splice(index, 1)
+      this.modalData.tableData.forEach((element,indx) => {
+           if(element.material_detail_id == row.material_detail_id){
+                     this.$refs.modelTable.toggleSelect(indx)
+           }
+      });
     },
     goBack () { this.$router.go(-1) },
     handleProjectSelect () {
@@ -1777,4 +1864,13 @@ if(this.selectChoose.length == 0){
 /deep/ .ivu-checkbox-disabled{
   display: none!important;
 }
+/deep/.order_time .ivu-form-item-label:before {
+    content: '*';
+    display: inline-block;
+    margin-right: 4px;
+    line-height: 1;
+    font-family: SimSun;
+    font-size: 14px;
+    color: #ed4014;
+}
 </style>

+ 7 - 6
src/views/PurchasingManage/PurchasingOrder/list.vue

@@ -94,7 +94,7 @@
             </Option>
           </Select>
         </FormItem>
-        <FormItem label="预计到货日期:" style="width:500px">
+        <FormItem label="预计到货日期:" style="width:450px">
           <DatePicker type="date"
                       size="small"
                       style="width: 150px"
@@ -108,7 +108,7 @@
                       placeholder="年/月/日"
                       v-model="searchData.arrive_end_time"></DatePicker>
         </FormItem>
-         <FormItem label="单据日期:" style="width:500px">
+         <FormItem label="单据日期:" style="width:450px">
           <DatePicker type="date"
                       size="small"
                       style="width: 150px"
@@ -122,7 +122,7 @@
                       placeholder="年/月/日"
                       v-model="searchData.order_end_time"></DatePicker>
         </FormItem>
-         <FormItem label="订单创建时间:" style="width:500px">
+         <FormItem label="订单创建时间:" style="width:450px">
           <DatePicker type="date"
                       size="small"
                       style="width: 150px"
@@ -160,10 +160,10 @@
             <a style="margin:0 5px"
                @click="handleSet(2,row,index)">详情</a>
             <a style="margin:0 5px"
-               v-if="row.state==1||row.state==2"
+               v-if="!row.state==1||!row.state==2"
                @click="handleSet(3,row,index)">编辑</a>
             <a style="margin:0 5px"
-               v-if="row.state==1||row.state==2"
+               v-if="!row.state==1||!row.state==2"
                @click="handleSet(4,row,index)">删除</a>
           <a style="margin:0 5px"
                @click="handleSet(5,row,index)">{{row.state==0?'审批':'弃审'}}</a>
@@ -228,7 +228,7 @@ export default {
             return h('span', {}, text)
           }
         },
-        { title: '制单人', key: 'check_name', align: 'center', minWidth: 100 },
+        { title: '制单人', key: 'user_name', align: 'center', minWidth: 100 },
         {
           title: '审批状态', key: 'state', align: 'center', minWidth: 140,
         render: (h, params) => {
@@ -237,6 +237,7 @@ export default {
             return h('span', {}, text)
           }
         },
+         { title: '审批人', key: 'check_name', align: 'center', minWidth: 100 },
         {
           title: '预计到货日期', key: 'arrive_time', align: 'center', minWidth: 140,
           render: (h, params) => {

+ 208 - 49
src/views/PurchasingManage/QualitycontrolOrder/edit.vue

@@ -2,16 +2,23 @@
   <div>
     <Toptitle :title="$route.query.type==1?'新增质检单':$route.query.type==2?'查看质检单':'编辑质检单'">
       <slot name="titleButton">
-        <Button @click="handleReference(3,1)"
+         <Button type="primary" ghost style="margin-right: 10px" v-if="$route.query.type==2" @click="examine"
+          >{{searchData.state==0?'审批':'弃审'}}</Button
+        >
+         <Button type="primary" ghost style="margin-right: 10px" v-if="$route.query.type==2" @click="typeChange(1)"
+          >打开</Button
+        >
+         <Button type="primary" ghost style="margin-right: 10px" v-if="$route.query.type==2" @click="typeChange(0)"
+          >关闭</Button
+        >
+         <Button type="primary" ghost style="margin-right: 10px"
+          >栏目设置</Button
+        >
+        <Button @click="handleReference(4,2,arrival_no)"
                 type="primary"
                 v-show="!isCheck"
                 ghost
-                style="margin-right:10px;">参照采购单</Button>
-        <Button @click="handleReference(4,2)"
-                type="primary"
-                v-show="!isCheck"
-                ghost
-                style="margin-right:10px;">参照到货单</Button>
+                style="margin-right:10px;">参照到货检验</Button>
         <Button @click="goBack"
                 type="primary"
                 ghost
@@ -24,50 +31,56 @@
       </slot>
     </Toptitle>
     <div class="content_topform">
+      
       <Form :label-width="90"
             :model="searchData">
+             <FormItem label="退货单号:">
+          <Input type="text"
+                 size="small"
+                 v-show="!isCheck"
+                disabled
+                 v-model="searchData.return_no"
+                 style="width: 200px"
+                 placeholder="自动生成" />
+          <span v-show="isCheck">{{searchData.return_no}}</span>
+        </FormItem>
         <FormItem label="供应商名称:">
           <Input type="text"
                  size="small"
                  v-show="!isCheck"
                  v-model="searchData.supply_title"
+                 disabled
                  style="width: 200px;margin-top:6px"
                  placeholder="供应商名称">
-          <span slot="append"
-                style="cursor:pointer;"
-                @click="showSupplierModal=true">选择</span>
+          
           </Input>
           <span v-show="isCheck">{{searchData.supply_title}}</span>
         </FormItem>
-        <FormItem label="单据号:">
-          <Input type="text"
-                 size="small"
-                 v-show="!isCheck"
-                 readonly
-                 v-model="searchData.purchase_order_quality_no"
-                 style="width: 200px"
-                 placeholder="自动生成" />
-          <span v-show="isCheck">{{searchData.purchase_order_quality_no}}</span>
-        </FormItem>
+       
         <FormItem label="制单人:"
                   v-show="isCheck">
-          <span v-show="isCheck">{{searchData.nickname}}</span>
+          <span v-show="isCheck">{{searchData.user_name}}</span>
           <!-- <Input type="text"
                  size="small"
                  v-model="searchData.nickname"
                  style="width: 200px"
                  placeholder="制单人" /> -->
         </FormItem>
-        <FormItem label="预计到货:"
-                  v-show="isCheck">
-          <span>{{func.replaceDate(searchData.arrive_time)}}</span>
-        </FormItem>
-        <FormItem label="制单日期:">
+        <FormItem label="单据日期:">
           <DatePicker type="date"
                       v-show="!isCheck"
                       size="small"
                       style="width: 200px"
                       placeholder="年/月/日"
+                      v-model="searchData.order_time"></DatePicker>
+          <span v-show="isCheck">{{func.replaceDate(searchData.order_time)}}</span>
+        </FormItem>
+         <FormItem label="订单创建时间:" :label-width='120'>
+           <DatePicker type="date"
+                      v-show="!isCheck"
+                      size="small"
+                      style="width: 200px"
+                      placeholder="年/月/日"
                       v-model="searchData.crt_time"></DatePicker>
           <span v-show="isCheck">{{func.replaceDate(searchData.crt_time)}}</span>
         </FormItem>
@@ -90,12 +103,16 @@
                   type="primary"
                   size="small"
                   style="margin-left:10px;">选择物料</Button> -->
+            <span>参照到货单号:{{arrival_no}}</span>
         </div>
         <div class="content_table_btn_right">
         </div>
       </div>
       <Table :columns="tableColumns"
              border
+              show-summary 
+              :summary-method="handleSummary"
+              @on-selection-change='selectRow'
              :data="tableData">
     <template slot="numberSet" slot-scope="{row , index }">
                <Tooltip
@@ -109,15 +126,8 @@
                 </div>
               </div>
             </div>
-            <Input
-              type="text"
-              v-show="!isCheck"
-              size="small"
-              v-model="tableData[index].num"
-              placeholder="数量"
-            >
-            </Input>
-            <span v-show="isCheck">{{ tableData[index].num }}</span>
+           
+            <span >{{ tableData[index].num }}</span>
           </Tooltip>
         </template>
         <template slot="setSlot"
@@ -147,6 +157,7 @@
             <div><span>物料名称:</span>
               <Input type="text"
                      v-model="modalData.title"
+                     clearable
                      placeholder="请输入物料名称" />
             </div>
             <Button @click="initModal()"
@@ -304,7 +315,8 @@ export default {
       warehouse:'',
       fax_modify: '',
       searchData: {
-        client_name: ''
+        client_name: '',
+        order_time:new Date().toLocaleString(),
       },
       modalProjectData: {
         title: '',
@@ -362,7 +374,7 @@ export default {
         },
         { title: '计量单位', key: 'unit', align: 'center', minWidth: 100 },
         {
-          title: '质检数量', key: 'num', align: 'center', minWidth: 120,slot:'numberSet'
+          title: '数量', key: 'num', align: 'center', minWidth: 120,slot:'numberSet'
           // render: (h, params) => {
           //   const { row, index } = params
           //   const currentRow = JSON.parse(JSON.stringify(this.tableData[index]))
@@ -383,6 +395,16 @@ export default {
           //   })
           // }
         },
+        { title: '无税单价', key: 'no_tax_price', align: 'center', minWidth: 100 },
+        { title: '税率', key: 'tax_rate', align: 'center', minWidth: 100,
+        render:(h,params)=>{
+          const {row} = params;
+          return h('span',{},`${row.tax_rate*100}%`)
+        } },
+        { title: '含税单价', key: 'price', align: 'center', minWidth: 100 },
+        { title: '无税金额', key: 'no_tax_total_price', align: 'center', minWidth: 100 },
+        { title: '税额', key: 'tax_total_price', align: 'center', minWidth: 100 },
+        { title: '价格合计', key: 'total_price', align: 'center', minWidth: 100 },
         { title: '操作', key: 'code', align: 'center', minWidth: 100, slot: 'setSlot' },
       ],
       tableData: [],
@@ -528,6 +550,8 @@ export default {
       ],
       isCheck: false,
       warningList: [],
+      arrival_no:'',
+      selectChoose:[]
     }
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
@@ -552,11 +576,109 @@ export default {
   },
   // 生命周期 - 挂载完成(可以访问DOM元素)
   mounted () {
-    if (this.$route.query.purchase_order_quality_no != '') {
-      this.initData(this.$route.query.purchase_order_quality_no)
+    if (this.$route.query.type != 1) {
+      this.initData(this.$route.query.return_no)
+    }
+      if(this.$route.query.type == 2){
+      this.tableColumns.pop();
+      this.tableColumns.unshift({
+        align:'center',
+        key:'select',
+        minWidth:80,
+        type:'selection'
+      })
+      this.tableColumns.push({
+          title: "状态",
+          key: "lock",
+          align: "center",
+          minWidth: 100,
+          render: (h, params) => {
+            const { row } = params
+            let text = row.lock==1?'打开':'关闭'
+            return h('span', {
+            }, text)
+          },
+        })
     }
   },
   methods: {
+    examine(){
+      
+      let state='';
+     
+       if(this.searchData.state == 0){
+            state = 1;
+       }else{
+         state = 0;
+       }
+       this.axios.get('/api/purchase_quality_check',{params:{state,return_no:this.$route.query.return_no}}).then((res)=>{
+          if(res.code==200){
+             this.$Message.success(res.msg);
+             this.initData(this.$route.query.return_no)
+           }
+       })
+    },
+    selectRow(e){
+        this.selectChoose = e;
+    },
+     typeChange(val){ 
+      if(this.selectChoose.length==0){
+        return this.$Message.warning("请先选择物料")
+      }
+      let id=[];
+      this.selectChoose.forEach(v=>{
+        id.push(v.id);
+      })
+      let state = val;
+     this.axios.post('/api/purchase_quality_switch',{id,state}).then((res)=>{
+           if(res.code==200){
+             this.$Message.success(res.msg);
+             this.initData(this.$route.query.return_no);
+           }
+     })
+    },
+      handleSummary({ columns, data }){
+  const sums = {};
+                columns.forEach((column, index) => {
+                    const key = column.key;
+                    if (index === 1) {
+                        sums[key] = {
+                            key,
+                            value: '合计'
+                        };
+                        return;
+                    }
+                    const values = data.map(item => Number(item[key]));
+                    if (key == 'num'||key=='no_tax_total_price'||key=='total_price'||key=='tax_total_price') {
+                        let v = values.reduce((prev, curr) => {
+                            const value = Number(curr);
+                            if (!isNaN(value)) {
+                                return prev + curr;
+                            } else {
+                                return prev;
+                            }
+                        }, 0);
+                        //  this.table_total_num = Number(JSON.parse(JSON.stringify(v)));
+                        if(key == 'num'){
+                            sums[key] = {
+                            key,
+                            value:v}
+                        }else{
+                        sums[key] = {
+                            key,
+                            value:v.toFixed(2)
+                        };}
+                    } else {
+                        sums[key] = {
+                            key,
+                            value: ''
+                        };
+                    }
+                });
+
+                return sums;
+            
+    },
       handleToolShow(index, row) {
       if (this.warehouse) {
         return
@@ -575,31 +697,38 @@ export default {
       // this.warehouse.num = this.warehouseTotal[index].num;
       // this.warehouse.warehouseName = this.warehouseTotal[index].warehouseName
     },
-    initData (purchase_order_quality_no) {
+    initData (return_no) {
       this.axios({
         method: 'get',
         url: '/api/purchase_quality_detail',
-        params: { purchase_order_quality_no }
+        params: { return_no }
       }).then((res) => {
         this.tableData = res.data.list
         const data = JSON.parse(JSON.stringify(res.data))
         delete data.list
         this.searchData = data
+        this.searchData.order_time = this.func.replaceDate(this.searchData.order_time)
         this.searchData.crt_time = this.func.replaceDate(this.searchData.crt_time)
-        this.searchData.arrive_time = this.func.replaceDate(this.searchData.arrive_time)
+        let content  = JSON.parse(JSON.stringify(this.tableData));
+        content.forEach((v,index)=>{
+          this.tableData[index].no_tax_price = (v.price*1/(1+v.tax_rate*1)).toFixed(2); 
+           this.tableData[index].no_tax_total_price = (this.tableData[index].no_tax_price*v.num*1).toFixed(2);
+           this.tableData[index].total_price = (v.price*1*v.num).toFixed(2);
+           this.tableData[index].tax_total_price = (this.tableData[index].total_price*1-this.tableData[index].no_tax_total_price*1).toFixed(2)
+        })
       }).catch((err) => { });
     },
     postData () {
       let obj = JSON.parse(JSON.stringify(this.searchData))
-      obj.crt_time = parseInt(new Date(obj.crt_time).getTime() / 1000) || ''
-      if (this.$route.query.purchase_order_quality_no == '') {
+      obj.order_time = parseInt(new Date(obj.order_time).getTime() / 1000) || ''
+      if (this.$route.query.type == 1) {
         // 新增
         this.axios({
           method: 'post',
           url: '/api/purchase_quality_add',
           data: {
             ...obj,
-            list: this.tableData
+            children: this.tableData
           }
         }).then((res) => {
           this.$Message.success(res.msg)
@@ -621,15 +750,45 @@ export default {
         }).catch((err) => { });
       }
     },
-    handleReference (type, refer_type) {
+    handleReference (type, refer_type,arrival_no) {
       this.$reference({
-        type, refer_type,
-        title: refer_type == 1 ? '参照采购单' : '参照到货单',
+        type, refer_type,arrival_no,
+        title:'参照到货质检单',
         then: (result, data) => {
           result.forEach(element => {
             element.type = refer_type
           });
-          this.tableData = [...this.tableData, ...result]
+          if(this.tableData.length == 0){
+                this.tableData = result;
+                this.tableData.map(v=>{
+                  v.num = v.return_num*1
+                })
+          }else{
+          let content =[];
+          let id =[];
+          
+          this.tableData.forEach(v=>{
+            id.push(v.id)
+          })
+          console.log(id)
+          this.tableData.forEach(v=>{
+           result.forEach(m=>{
+              if(v.id == m.id){
+                v.num = m.return_num*1
+              }
+            })
+          })
+          result.forEach(v=>{
+            if(id.indexOf(v.id)<0){
+              content.push(v)
+            }
+          })
+          console.log(content)
+           this.tableData = [...this.tableData, ...content]
+          }
+          this.arrival_no = this.tableData[0].arrival_no;
+         this.searchData.supply_title = this.tableData[0].supply_title||'';
+         this.searchData.supply_id = this.tableData[0].supply_id||''
         }
       })
     },

+ 86 - 33
src/views/PurchasingManage/QualitycontrolOrder/list.vue

@@ -1,10 +1,8 @@
 <template>
   <div class="qualitycontrol_order">
-    <Toptitle title="质检列表">
+    <Toptitle title="采购退货">
       <slot name="titleButton">
-        <Button type="primary"
-                @click="handleGoPage(1,'')"
-                style="margin-right:10px;">新增</Button>
+     
         <!-- <Button @click="handleCodeRule"
                 type="primary"
                 ghost
@@ -14,7 +12,7 @@
     <div class="qualitycontrol_order_search">
       <Form :label-width="90"
             :model="searchData">
-        <FormItem label="单号:">
+        <FormItem label="退货单号:">
           <Input type="text"
                  size="small"
                  clearable
@@ -29,7 +27,7 @@
                  style="width: 150px"
                  placeholder="项目名称" />
         </FormItem> -->
-        <!-- <FormItem label="紧急程度:">
+        <FormItem label="供应商名称:">
           <Select v-model="searchData.warning_state"
                   size="small"
                   clearable
@@ -39,7 +37,7 @@
                     :value="_item.id"
                     :label="_item.title"></Option>
           </Select>
-        </FormItem> -->
+        </FormItem>
         <!-- <FormItem label="业务员:">
           <Select v-model="searchData.man"
                   size="small"
@@ -52,7 +50,7 @@
             </Option>
           </Select>
         </FormItem> -->
-        <FormItem label="提交人:">
+        <FormItem label="制单人:">
           <Select v-model="searchData.user_id"
                   size="small"
                   clearable
@@ -79,20 +77,58 @@
                     :value=3 />
           </Select>
         </FormItem>
-        <FormItem label="制单时间:">
+        <FormItem label="审批人:">
+          <Select v-model="searchData.user_id"
+                  size="small"
+                  clearable
+                  style="width: 150px">
+            <Option v-for="(sitem) in userList"
+                    :key="sitem.id"
+                    :label="sitem.nickname"
+                    :value="sitem.id">
+            </Option>
+          </Select>
+        </FormItem>
+          <FormItem label="订单状态:">
+          <Select v-model="searchData.lock"
+                  size="small"
+                  clearable
+                  style="width: 150px">
+            <Option label='已关闭'
+                    :value='0' />
+            <Option label='部分关闭'
+                    :value='1' />
+              <Option label='正常'
+                    :value='2' />
+          </Select>
+        </FormItem>
+        <FormItem label="单据时间:" style="width:450px">
           <DatePicker type="date"
                       size="small"
                       style="width: 150px"
                       placeholder="年/月/日"
                       v-model="searchData.start_time"></DatePicker>
-        </FormItem>
-        <FormItem label="~">
+        
+       ~
           <DatePicker type="date"
                       size="small"
                       style="width: 150px"
                       placeholder="年/月/日"
                       v-model="searchData.end_time"></DatePicker>
         </FormItem>
+        <FormItem label="订单创建时间:" style="width:450px" :label-width='100'>
+          <DatePicker type="date"
+                      size="small"
+                      style="width: 150px"
+                      placeholder="年/月/日"
+                     ></DatePicker>
+        ~
+          <DatePicker type="date"
+                      size="small"
+                      style="width: 150px"
+                      placeholder="年/月/日"
+                     ></DatePicker>
+        </FormItem>
         <FormItem>
           <Button type="primary"
                   size="small"
@@ -101,7 +137,9 @@
         </FormItem>
       </Form>
       <div class="content_right_topfrom_btn">
-
+      <Button type="primary"
+                @click="handleGoPage(1,'')"
+                style="margin-right:10px;">新增</Button>
       </div>
     </div>
     <div class="qualitycontrol_order_content">
@@ -116,14 +154,13 @@
             <a style="margin:0 5px"
                @click="handleSet(2,row,index)">详情</a>
             <a style="margin:0 5px"
-               :disabled="row.state==1||row.state==2"
+               v-if="!row.state==1||!row.state==2"
                @click="handleSet(3,row,index)">编辑</a>
             <a style="margin:0 5px"
-               :disabled="row.state==1||row.state==2"
+               v-if="!row.state==1||!row.state==2"
                @click="handleSet(4,row,index)">删除</a>
             <a style="margin:0 5px"
-               :disabled="row.state==1||row.state==2"
-               @click="handleSet(5,row,index)">提交</a>
+               @click="handleSet(5,row,index)">{{row.state==0?'审批':'弃审'}}</a>
           </template>
         </Table>
         <div class="qualitycontrol_order_content_page">
@@ -167,20 +204,35 @@ export default {
         end_time: '',
       },
       tableColumns: [
-        { title: '订单号', key: 'purchase_order_quality_no', align: 'center', minWidth: 140 },
+        { title: '订单号', key: 'return_no', align: 'center', minWidth: 140 },
         // { title: '项目名称', key: 'client_name', align: 'center', minWidth: 140 },
         { title: '供应商名称', key: 'supply_title', align: 'center', minWidth: 140 },
-        { title: '提交人', key: 'nickname', align: 'center', minWidth: 100 },
+         {
+          title: '订单状态', key: 'lock', align: 'center', minWidth: 120,
+        render: (h, params) => {
+            const { row } = params
+            const text = row.lock == 0 ? '已关闭' :row.lock == 1?'部分关闭':'正常'
+            return h('span', {}, text)
+          }
+        },
+        { title: '制单人', key: 'check_name', align: 'center', minWidth: 100 },
         {
           title: '审批状态', key: 'state', align: 'center', minWidth: 140,
-          render: (h, params) => {
+        render: (h, params) => {
             const { row } = params
-            const text = row.state == 0 ? '未提交' : row.state == 1 ? '审核中' : row.state == 2 ? '通过' : '驳回'
+            const text = row.state == 0 ? '未审批' : '已审批'
             return h('span', {}, text)
           }
         },
-        {
-          title: '制单日期', key: 'crt_time', align: 'center', minWidth: 140,
+          {
+          title: '单据日期', key: 'order_time', align: 'center', minWidth: 140,
+          render: (h, params) => {
+            const { row } = params
+            return h('span', {}, new Date((row.order_time) * 1000).toLocaleString().replace(new RegExp('/','g'),"-").split(' ')[0]||'')
+          }
+        },
+         {
+          title: '订单创建时间', key: 'crt_time', align: 'center', minWidth: 170,
           render: (h, params) => {
             const { row } = params
             return h('span', {}, this.func.replaceDate(row.crt_time))
@@ -238,7 +290,7 @@ export default {
         case 1:
         case 2:
         case 3:
-          this.handleGoPage(type, row.purchase_order_quality_no)
+          this.handleGoPage(type, row.return_no)
           break;
         case 4:
           this.$Modal.confirm({
@@ -249,7 +301,7 @@ export default {
                 method: 'post',
                 url: '/api/purchase_quality_del',
                 data: {
-                  purchase_order_arrive_no: row.purchase_order_quality_no
+                  return_no: row.return_no
                 }
               }).then((res) => {
                 this.$Message.success(res.msg)
@@ -261,15 +313,16 @@ export default {
           break;
         case 5:
           this.$Modal.confirm({
-            title: '确认提交?',
+            title: '确认审核?',
+            // content: '此操作无法恢复,请确认!',
             onOk: () => {
               this.axios({
-                method: 'post',
-                url: '/api/purchase_quality_pull',
-                data: {
-                  purchase_order_quality_no: row.purchase_order_quality_no,
-                  lock: row.lock,
-                  state: row.state + 1
+                method: 'get',
+                url: '/api/purchase_quality_check',
+                params: {
+                  return_no: row.return_no,
+                  // lock: row.lock,
+                  state: row.state==0?1:0,
                 }
               }).then((res) => {
                 this.$Message.success(res.msg)
@@ -281,12 +334,12 @@ export default {
           break;
       }
     },
-    handleGoPage (type, purchase_order_quality_no) {
+    handleGoPage (type, return_no) {
       this.$router.push({
         path: '/cms/PurchasingManage/qualitycontrolOrder/edit',
         query: {
           type,
-          purchase_order_quality_no
+          return_no
         }
       })
     },

+ 83 - 15
src/views/PurchasingManage/RequisitionOrder/edit.vue

@@ -15,7 +15,7 @@
           >栏目设置</Button
         >
         <Button @click="goBack" type="primary" ghost style="margin-right: 10px"
-          >取消</Button
+          >返回</Button
         >
         <Button
           @click="postData"
@@ -29,7 +29,7 @@
     </Toptitle>
     
     <div class="content_topform">
-      <Form :label-width="100" :model="searchData" :rules="ruleValidate">
+      <Form :label-width="100" :model="searchData" >
 
         <FormItem label="计划单号:">
           <Input
@@ -82,13 +82,14 @@
           </Input>
           <span v-show="isCheck">{{ searchData.purchase_order_apply_no }}</span>
         </FormItem> -->
-        <FormItem label="单据日期:" :prop="!isCheck?'time':''" :label-width='120'>
+        <FormItem label="单据日期:"  :label-width='120' class="order_time">
           <DatePicker
-            type="date"
+           type='datetime'
             v-show="!isCheck"
             size="small"
             style="width: 200px"
             placeholder="年/月/日"
+            format="yyyy-MM-dd"
             v-model="searchData.order_time"
           ></DatePicker>
           <span v-show="isCheck">{{ searchData.order_time?func.replaceDate(searchData.order_time).split(' ')[0]:'' }}</span>
@@ -143,7 +144,10 @@
         </DropdownMenu>
     </Dropdown>
       </div>
-      <Table :columns="tableColumns" border :data="tableData" :max-height='500' show-summary :summary-method="handleSummary" @on-selection-change='selectRow'>
+      <Table :columns="tableColumns" border :data="tableData" :max-height='500' show-summary :summary-method="handleSummary" 
+      :draggable='$route.query.type!=2?true:false'
+             @on-drag-drop='onDragDrop'
+      @on-selection-change='selectRow'>
         <template slot="materiel_specs" slot-scope="{ row }">
             <span v-if="row.material_title == '选择物料'"></span>
             <div v-else>
@@ -171,8 +175,8 @@
               
               v-show="!isCheck"
             
-             style="cursor: pointer;color:#2d8cf0"
-             @click="showModal = true"
+             :style="row.material_title=='选择物料'?{cursor: 'pointer',color:'#2d8cf0'}:{}"
+             @click="row.material_title=='选择物料'?(showModal = true):(showModal = false)"
 
             >
             {{tableData[index].material_title}}
@@ -253,6 +257,9 @@
             <span v-show="isCheck">{{ tableData[index].num }}</span>
           </Tooltip></div>
         </template>
+         <template slot="reference_num" slot-scope="{row}">
+         <span>{{row.num-row.reference_num}}</span>
+        </template>
         <template slot="arrive_timeSet" slot-scope="{ row,index }">
            <span v-if="row.material_title == '选择物料'"></span>
            <div v-else>
@@ -340,6 +347,7 @@
                 type="text"
                 v-model="modalData.title"
                 placeholder="请输入物料名称"
+                clearable
               />
             </div>
             <Button @click="initModal()" type="primary" style="margin: 0 10px"
@@ -463,13 +471,13 @@
         <Form>
           <FormItem>
             <span>项目编码 : </span>
-        <Select v-model="total_project_info.code" style="width:200px">
+        <Select v-model="total_project_info.code" style="width:200px" filterable>
         <Option v-for="(item,index) in project_number" :value="item" :key="index">{{ item }}</Option>
     </Select>
           </FormItem>
              <FormItem>
           <span>项目名称 : </span>
-        <Select v-model="total_project_info.name" style="width:200px">
+        <Select v-model="total_project_info.name" style="width:200px" filterable>
         <Option v-for="(item,index) in project_name" :value="item" :key="index">{{ item }}</Option>
     </Select>
           </FormItem>
@@ -491,7 +499,7 @@
       </div>
       <div v-if='total_type==4'>
         <span>批量修改建议的供应商 : </span>
-         <Select v-model="total_supplier" style="width:200px">
+         <Select v-model="total_supplier" style="width:200px" filterable>
         <Option v-for="item in suppliersList" :value="item.id" :key="item.id"   :label="item.title"></Option>
          </Select>
       </div>
@@ -521,7 +529,7 @@ export default {
       selectAll:false,
         ruleValidate: {
                     time: [
-                        { required: true, message: '单据日期不能为空',trigger: 'change'}
+                      {required: true}
                     ],},
       table_total_num:0,
       tableDataAlways:{material_title:'选择物料',_disabled:true},
@@ -537,7 +545,7 @@ export default {
       total_type:'',
       searchData: {
         plan_type: "",
-        order_time: null,
+        order_time: new Date().toLocaleString(),
         remark: "",
       },
       purchaseTypeList: [],
@@ -809,6 +817,9 @@ export default {
     }
     if(this.$route.query.type == 2){
       this.tableColumns.pop();
+       this.tableColumns.splice(8,0,{
+            title:'未参照数量',key:'reference_num',align:'center',minWidth:120,slot:'reference_num'
+        })
       this.tableColumns.push({
           title: "状态",
           key: "lock",
@@ -824,6 +835,33 @@ export default {
     }
   },
   methods: {
+    onDragDrop(first,end){
+      if(this.tableData[first].material_title=="选择物料"){
+         return this.$Message.warning('选择物料不可拖动')
+      }
+      // this.tableData.splice(end,1,...this.tableData.splice(first,1,this.tableData[end]));
+    first = parseInt(first);
+    end = parseInt(end);
+    let tmp = this.tableData[first];
+    if(first<end){
+      for(let i=first+1;i<=end;i++){
+        this.tableData.splice(i-1,1,this.tableData[i])
+      }
+      this.tableData.splice(end,1,tmp)
+    }
+    if(first>end){
+      for(let i=first;i>end;i--){
+        this.tableData.splice(i,1,this.tableData[i-1])
+      }
+      this.tableData.splice(end,1,tmp)
+    }
+    this.tableData.forEach((v,index)=>{
+      if(index>=end){
+        v.drag = true;
+      }
+    })
+    },
+   
     examine(){
       
       let state='';
@@ -1014,6 +1052,8 @@ this.selectChoose.map(m=>{
           this.searchData = res.data;
           this.searchData.time = this.func.replaceDate(res.data.crt_time);
           this.searchData.order_time = this.func.replaceDate(res.data.order_time);
+          console.log(this.searchData.order_time)
+          console.log(new Date().toLocaleString())
           this.tableData.forEach((element) => {
             element.time = this.func.replaceDate(element.arrive_time);
             element.warehouse_list = []
@@ -1122,6 +1162,11 @@ this.selectChoose.map(m=>{
     // },
     handleSelectedDele(row, index) {
       this.modalData.selectedData.splice(index, 1);
+        this.modalData.tableData.forEach((element,indx) => {
+           if(element.material_detail_id == row.material_detail_id){
+                     this.$refs.modelTable.toggleSelect(indx)
+           }
+      });
     },
     initModal() {
       this.axios({
@@ -1192,9 +1237,21 @@ this.selectChoose.map(m=>{
       if(!this.searchData.order_time){
        return this.$Message.warning('请选择单据日期')
       };
+      let state = false;
        let objData = [];
         objData =JSON.parse(JSON.stringify(this.tableData)); 
         objData.pop();
+        if(objData.length == 0){
+         return this.$Message.warning('请选择物料')
+        }
+       objData.forEach(element => {
+            if(!element.num){
+              return state = true
+            }
+          });
+           if(state){
+            return this.$Message.warning('物料数量不能为0')
+          }
       this.searchData.order_time =
         parseInt(new Date(this.searchData.order_time).getTime() / 1000) || "";
         objData.map(v=>{
@@ -1224,16 +1281,18 @@ this.selectChoose.map(m=>{
         })
         .catch((err) => {});
       } else {
+       
         url = "/api/purchase_apply_edit";
          let upd_list = [];
          let add_list = [];
          let del_list = this.delData;
-         objData.forEach(v=>{
+         objData.forEach((v,index)=>{
+          v.sort = index+1;
            if(v.edit||v.copy){
               add_list.push(v)
            }
-            if(v.change||v.ad){
-              if(!v.edit||!v.copy){
+            if(v.change||v.ad||v.drag){
+              if(!v.edit&&!v.copy){
                  upd_list.push(v)
               }
             
@@ -1353,4 +1412,13 @@ this.selectChoose.map(m=>{
 /deep/ .ivu-checkbox-disabled{
   display: none!important;
 }
+/deep/.order_time .ivu-form-item-label:before {
+    content: '*';
+    display: inline-block;
+    margin-right: 4px;
+    line-height: 1;
+    font-family: SimSun;
+    font-size: 14px;
+    color: #ed4014;
+}
 </style>

+ 59 - 0
src/views/leadMatch/MatchList/matchCheck.vue

@@ -1,6 +1,12 @@
 <template>
   <div>
     <Toptitle title="查看">
+         <Button
+        @click="handelDel"
+        type="primary"
+        style="margin-right: 10px"
+        >强制删除</Button
+      >
       <Button
         @click="handleMatchedSelectAll()"
         type="primary"
@@ -94,6 +100,13 @@
                 @on-change="(e) => handleMatchedSelect(matched_info, e)"
                 >选择</Checkbox
               >
+                <Checkbox
+                v-show="matched_info.produce_status != 0"
+                v-model="matched_info.del_isSelect"
+                @on-change="(e) => MatchedSelect(matched_info, e)"
+                class="del_check"
+                >选择</Checkbox
+              >
             </div>
             <span>图号:{{ matched_info.image_number }}</span>
           </Col>
@@ -318,6 +331,10 @@
         >
       </div>
     </Modal>
+    <Modal v-model="showDel" title="" @on-ok='important_del' :closable='false' style="text-align:center" :width='20'>
+      <div style="margin-top:30px"><span style="margin-right:10px">用户:</span><Input v-model="delData.user_name" style="width:70%"></Input></div>
+      <div style="margin-top:30px"><span style="margin-right:10px">密码:</span><Input v-model="delData.password" style="width:70%"></Input></div>
+    </Modal>
   </div>
 </template>
 
@@ -333,6 +350,10 @@ export default {
   data() {
     // 这里存放数据
     return {
+      delData:{
+        user_name:'',
+        password:'',
+      },
       project_number: this.$route.query.project_number,
       project_name: this.$route.query.project_name,
       isMatchedSelectAll: false,
@@ -413,6 +434,8 @@ export default {
       process_control: false,
       cut_order_product_ids: [],
       matchedSelectedList: [],
+      delList:[],
+      showDel:false,
     };
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
@@ -426,6 +449,27 @@ export default {
     this.initData();
   },
   methods: {
+    important_del(){
+       this.axios.post('/api/delete_cut_order_product',{id:[...this.delList],...this.delData}).then(res=>{
+         if(res.code == 200){
+           this.$Message.success(res.msg);
+           this.delList = [];
+           this.isMatchedSelectAll=false;
+           this.initData();
+         }
+       })
+    },
+    handelDel(){
+        if(this.delList.length == 0){
+        return this.$Message.warning('请选择要删除的数据')
+      }
+        this.confirmDelete({
+        content: '强制删除么?',
+        then: () => {
+          this.showDel = true;
+        }
+      })
+    },
     handleMatchedSelectAll(){
  this.isMatchedSelectAll = !this.isMatchedSelectAll;
  this.matchedSelectedList = [];
@@ -456,6 +500,18 @@ export default {
       this.cut_order_product_ids = this.matchedSelectedList;
       console.log(this.cut_order_product_ids);
     },
+MatchedSelect(row,e){
+  row.del_isSelect = e;
+      console.log(row);
+      console.log(this.matchedList)
+      this.delList = [];
+  this.matchedList.forEach(v=>{
+    if(v.del_isSelect){
+          this.delList.push(v.id);
+    }
+  })
+
+},
     back() {
       this.$router.go(-1);
     },
@@ -593,4 +649,7 @@ export default {
   align-items: center;
   padding: 10px;
 }
+/deep/.del_check .ivu-checkbox .ivu-checkbox-inner{
+  border-radius: 50%;
+}
 </style>

+ 1 - 1
vue.config.js

@@ -2,7 +2,7 @@ const axios_default_ip =
   process.env.NODE_ENV == "dev"
     ? "http://121.41.102.225:82"
     : process.env.NODE_ENV == "test-prd"
-    ? "http://121.37.173.82:82" //测试服
+    ? "http://121.41.102.225:82" //测试服
     : process.env.NODE_ENV == "prd_other"
     ? "http://121.37.173.82:82" //贝斯特
     : "http://124.71.176.88:882";