浏览代码

修改订单异常

ymy 2 年之前
父节点
当前提交
a4c4928297

+ 16 - 0
src/api/omsOrder.ts

@@ -120,4 +120,20 @@ export function unCancel(data:any){
 		method:'POST',
 		method:'POST',
 		params:data
 		params:data
 	})
 	})
+}
+//转异常
+export function setQuestions(data:any){
+	return request({
+		url:'/omsOrder/omsOrder/setQuestions',
+		method:'POST',
+		data:data
+	})
+}
+//转正常
+export function resetQuestion(data:any){
+	return request({
+		url:'/omsOrder/omsOrder/resetQuestion',
+		method:'POST',
+		data:data
+	})
 }
 }

+ 14 - 7
src/benyun/components/byForm/byForm.vue

@@ -163,17 +163,24 @@ export default class ByForm extends VueViews {
   getValue(){
   getValue(){
     return (this as any).$lodash.cloneDeep(this.value);
     return (this as any).$lodash.cloneDeep(this.value);
   }
   }
-
+  //设置表单内某组件配置
+  setCompConfig(code:any,c:any){
+    if(this.$refs[code+this.suffixCode] && (this.$refs[code+this.suffixCode] as any)[0] && (this.$refs[code+this.suffixCode] as any)[0].setConfig){
+      (this.$refs[code+this.suffixCode] as any)[0].setConfig(c)
+    }
+  }
   setConfigAfter(){
   setConfigAfter(){
-    if(this.columns.length > 0){
-      for(const itemData of this.columns){
-        for(const item of itemData){
-          if(this.$refs[item.prop+this.suffixCode] && (this.$refs[item.prop+this.suffixCode] as any)[0] && (this.$refs[item.prop+this.suffixCode] as any)[0].setConfig){
-            (this.$refs[item.prop+this.suffixCode] as any)[0].setConfig(item.compConfig)
+    this.$nextTick(()=>{
+      if(this.columns.length > 0){
+        for(const itemData of this.columns){
+          for(const item of itemData){
+            if(this.$refs[item.prop+this.suffixCode] && (this.$refs[item.prop+this.suffixCode] as any)[0] && (this.$refs[item.prop+this.suffixCode] as any)[0].setConfig){
+              (this.$refs[item.prop+this.suffixCode] as any)[0].setConfig(item.compConfig)
+            }
           }
           }
         }
         }
       }
       }
-    }
+    })
   }
   }
 
 
   //清除下级组件组件值
   //清除下级组件组件值

+ 2 - 1
src/benyun/components/byTable/byTable.vue

@@ -4,7 +4,6 @@
       ref="table"
       ref="table"
       :data="value"
       :data="value"
       :size="attrs.size?attrs.size:'small'"
       :size="attrs.size?attrs.size:'small'"
-      resizable
       sync-resize
       sync-resize
       auto-resize
       auto-resize
       :height="attrs.height"
       :height="attrs.height"
@@ -26,6 +25,7 @@
           :key="'action_'+index"
           :key="'action_'+index"
           :title="item.title"
           :title="item.title"
           :width="item.width"
           :width="item.width"
+          resizable
           fixed="right"
           fixed="right"
         >
         >
           <template #default="{ row }">
           <template #default="{ row }">
@@ -50,6 +50,7 @@
           :title="item.title"
           :title="item.title"
           :width="item.width"
           :width="item.width"
           :fixed="item.fixed"
           :fixed="item.fixed"
+          resizable
           :align="item.align"
           :align="item.align"
           :tree-node="item.treeNode"
           :tree-node="item.treeNode"
         >
         >

+ 7 - 0
src/components/byLog/byLog.vue

@@ -0,0 +1,7 @@
+<template>
+  <div></div>
+</template>
+
+<script lang="ts">
+
+</script>

+ 4 - 14
src/views/oms/order/components/addOrder.vue

@@ -913,25 +913,12 @@ export default class AddOrder extends Vue {
           }
           }
         }
         }
       }
       }
-      
-      // let disStatus = ['WaitPay','Merged','Question','Split','WaitConfirm','Cancelled'];
+
       if(this.orderValue.isSubmitted == 1){
       if(this.orderValue.isSubmitted == 1){
         this.buyerInfoConfig.attr.showType='desc';
         this.buyerInfoConfig.attr.showType='desc';
         this.buyerInfoConfig.attr.size='medium';
         this.buyerInfoConfig.attr.size='medium';
         this.newInvoicesConfig.attr.showType='desc';
         this.newInvoicesConfig.attr.showType='desc';
         this.newInvoicesConfig.attr.size='medium';
         this.newInvoicesConfig.attr.size='medium';
-        // for(let col of this.buyerInfoConfig.columns){
-        //   for(let item of col){
-        //     if(!item.compConfig.attr) item.compConfig.attr = {};
-        //     item.compConfig.attr.disabled = true;
-        //   }
-        // }
-        // for(let col of this.newInvoicesConfig.columns){
-        //   for(let item of col){
-        //     if(!item.compConfig.attr) item.compConfig.attr = {};
-        //     item.compConfig.attr.disabled = true;
-        //   }
-        // }
       }
       }
 
 
       this.totalAmount();
       this.totalAmount();
@@ -1254,6 +1241,9 @@ export default class AddOrder extends Vue {
           this.value = false;
           this.value = false;
         }else{
         }else{
           this.clearValue();
           this.clearValue();
+          let value:any = (this.$refs.baseform as any).getValue();
+          value.createBy = this.userInfo.userName;
+          (this.$refs.baseform as any).setValue(value);
         }
         }
         this.load = false;
         this.load = false;
         (this as any).$message({
         (this as any).$message({

+ 3 - 3
src/views/oms/order/components/filterDate.vue

@@ -7,7 +7,7 @@
         style="width: 100%;"
         style="width: 100%;"
         clearable
         clearable
         size="mini" 
         size="mini" 
-        type="daterange"
+        type="datetimerange"
         @change="change"
         @change="change"
         range-separator="-"
         range-separator="-"
         start-placeholder="开始日期"
         start-placeholder="开始日期"
@@ -31,8 +31,8 @@ export default class FilterInput extends Vue {
   }
   }
 
 
   change(v:any){
   change(v:any){
-    this.value[0] = Format(v[0],'yyyy-MM-dd');
-    this.value[1] = Format(v[1],'yyyy-MM-dd');
+    this.value[0] = Format(v[0],'yyyy-MM-dd HH:mm:ss');
+    this.value[1] = Format(v[1],'yyyy-MM-dd HH:mm:ss');
     this.$emit('change',this.value)
     this.$emit('change',this.value)
   }
   }
 }
 }

+ 3 - 3
src/views/oms/order/components/filterMinMax.vue

@@ -2,9 +2,9 @@
   <div class="min-max">
   <div class="min-max">
     <div v-if="title">{{title}}:</div>
     <div v-if="title">{{title}}:</div>
     <div class="munber-time">
     <div class="munber-time">
-      <el-input v-model="value[minField]" class="number-input" size="mini" type="number" @input="mininput"></el-input>
+      <vxe-input v-model="value[minField]" class="number-input" size="mini" type="number" @input="mininput"></vxe-input>
       <span class="split"> - </span>
       <span class="split"> - </span>
-      <el-input v-model="value[maxField]" class="number-input" size="mini" type="number" @input="maxinput"></el-input>
+      <vxe-input v-model="value[maxField]" class="number-input" size="mini" type="number" @input="maxinput"></vxe-input>
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
@@ -72,7 +72,7 @@ export default class OrderProduct extends Vue {
 
 
 <style lang="scss">
 <style lang="scss">
 .number-input{
 .number-input{
-  width: 70px; 
+  width: 80px; 
   flex-shrink: 0; 
   flex-shrink: 0; 
   padding: 0;
   padding: 0;
   .el-input__inner{
   .el-input__inner{

+ 6 - 4
src/views/oms/order/components/mergeMedal.vue

@@ -1,7 +1,6 @@
 <template>
 <template>
-  <vxe-modal v-model="value" id="mergeModel" title="合并订单" width="70%" height="80%" min-width="460" min-height="320" 
-    show-zoom resize transfer show-footer v-loading="load">
-    <by-table :propConfig="config" ref="table">
+  <vxe-modal v-model="value" id="mergeModel" title="合并订单" width="70%" height="80%" show-zoom resize transfer show-footer v-loading="load">
+    <by-table :propConfig="config" ref="table" id="merge-table">
       <template v-slot:sourceId="{row}">
       <template v-slot:sourceId="{row}">
         <span>{{ row.sourceId }}</span>
         <span>{{ row.sourceId }}</span>
         <div class="tag-main" v-if="row.isMain == 1">
         <div class="tag-main" v-if="row.isMain == 1">
@@ -61,7 +60,7 @@ import { merge } from '@/api/omsOrder'
 export default class MergeModel extends Vue {
 export default class MergeModel extends Vue {
   value = false;
   value = false;
   load = false;
   load = false;
-  config={
+  config:any={
     attr:{
     attr:{
       size:'small',
       size:'small',
       checkbox:true,
       checkbox:true,
@@ -120,7 +119,10 @@ export default class MergeModel extends Vue {
   }
   }
   setData(data:Array<any>){
   setData(data:Array<any>){
     this.$nextTick(()=>{
     this.$nextTick(()=>{
+      let height = (document.getElementById('merge-table') as any).parentNode.offsetHeight;
+      this.config.attr.height=height - 36;
       if(this.$refs.table){
       if(this.$refs.table){
+        (this.$refs.table as any).setConfig(this.config);
         (this.$refs.table as any).setValue(data);
         (this.$refs.table as any).setValue(data);
       }
       }
     })
     })

+ 9 - 8
src/views/oms/order/components/orderTable.vue

@@ -8,19 +8,18 @@
     :row-config="{isCurrent: true,isHover: true}"
     :row-config="{isCurrent: true,isHover: true}"
     :data="data">
     :data="data">
     <vxe-column type="checkbox" width="50" fixed="left"></vxe-column>
     <vxe-column type="checkbox" width="50" fixed="left"></vxe-column>
-    <vxe-column type="seq" width="60" title="序号" fixed="left"></vxe-column>
-    <vxe-column field="sourceId" title="线上订单号" width="160" fixed="left">
+    <!-- <vxe-column type="seq" width="60" title="序号" fixed="left"></vxe-column> -->
+    <vxe-column field="id" title="内部订单号" width="100" fixed="left">
       <template #default="{ row }">
       <template #default="{ row }">
-        <!-- <div class="detail" @click="detail(row)">{{ row.sourceId }}</div> -->
         <div class="col-cont">
         <div class="col-cont">
-          <span>{{ row.sourceId }}</span>
+          <span>{{ row.id }}</span>
           <div class="update">
           <div class="update">
             <div class="tag-update" @click="detail(row)">详</div>
             <div class="tag-update" @click="detail(row)">详</div>
           </div>
           </div>
-          
         </div>
         </div>
       </template>
       </template>
     </vxe-column>
     </vxe-column>
+    <vxe-column field="sourceId" title="线上订单号" width="140"> </vxe-column>
     <vxe-column field="isSubmitted" title="提交状态" width="130">
     <vxe-column field="isSubmitted" title="提交状态" width="130">
       <template #default="{ row }">
       <template #default="{ row }">
         <el-tag v-if="row.isSubmitted == 1" size="small">已提交</el-tag>
         <el-tag v-if="row.isSubmitted == 1" size="small">已提交</el-tag>
@@ -172,7 +171,8 @@ export default class OrderTable extends Vue {
   //合并按钮是否显示
   //合并按钮是否显示
   showMerge(item:any){
   showMerge(item:any){
     let r = false;
     let r = false;
-    if(item.isSubmitted == 1 && item.pays && item.pays.length > 0 && item.sourceFrom.indexOf('MERGE') == -1 && item.sourceFrom.indexOf('SPLIT') == -1){
+    if(item.isSubmitted == 1 && item.pays && item.pays.length > 0 && item.sourceFrom.indexOf('MERGE') == -1 && item.sourceFrom.indexOf('SPLIT') == -1 
+    && item.sourceFrom.indexOf('JUSHUITAN') == -1){
       if(item.status == 'WaitConfirm' || item.status == 'Question'){
       if(item.status == 'WaitConfirm' || item.status == 'Question'){
         r = true;
         r = true;
       }
       }
@@ -181,7 +181,8 @@ export default class OrderTable extends Vue {
   }
   }
   showSplit(item:any){
   showSplit(item:any){
     let r = false;
     let r = false;
-    if(item.isSubmitted == 1 && item.pays && item.pays.length > 0 && item.sourceFrom.indexOf('MERGE') == -1 && item.sourceFrom.indexOf('SPLIT') == -1){
+    if(item.isSubmitted == 1 && item.pays && item.pays.length > 0 && item.sourceFrom.indexOf('MERGE') == -1 && item.sourceFrom.indexOf('SPLIT') == -1 
+    && item.sourceFrom.indexOf('JUSHUITAN') == -1){
       let s=['WaitConfirm','Question','Split']
       let s=['WaitConfirm','Question','Split']
       if(s.indexOf(item.status) >= 0){
       if(s.indexOf(item.status) >= 0){
         r = true;
         r = true;
@@ -215,7 +216,7 @@ export default class OrderTable extends Vue {
       if(row.id != item.id && item.isSubmitted == 1 && row.shopId == item.shopId && row.shopName == item.shopName && row.buyerId == item.buyerId && 
       if(row.id != item.id && item.isSubmitted == 1 && row.shopId == item.shopId && row.shopName == item.shopName && row.buyerId == item.buyerId && 
       row.receiverMobile == item.receiverMobile && row.receiverProvince == item.receiverProvince && row.receiverCity == item.receiverCity 
       row.receiverMobile == item.receiverMobile && row.receiverProvince == item.receiverProvince && row.receiverCity == item.receiverCity 
       && row.receiverDistrict == item.receiverDistrict && row.receiverTown == item.receiverTown && row.receiverAddress == item.receiverAddress 
       && row.receiverDistrict == item.receiverDistrict && row.receiverTown == item.receiverTown && row.receiverAddress == item.receiverAddress 
-      && item.pays && item.pays.length > 0){
+      && item.pays && item.pays.length > 0 && item.sourceFrom.indexOf('SPLIT') == -1 && item.sourceFrom.indexOf('MERGE') == -1){
         data.push(item);
         data.push(item);
       }
       }
     }
     }

+ 2 - 2
src/views/oms/order/components/orderTool.vue

@@ -22,8 +22,8 @@
       </el-dropdown-menu>
       </el-dropdown-menu>
     </el-dropdown>
     </el-dropdown>
     <div class="split"></div>
     <div class="split"></div>
-    <el-button type="text">转异常</el-button>
-    <el-button type="text">转正常</el-button>
+    <el-button type="text" @click="handle('changeQues')">转异常</el-button>
+    <el-button type="text" @click="handle('changeNormal')">转正常</el-button>
     <el-dropdown split-button type="text" class="dropdown" @click="handle('cancelOrder')" @command="handleCommand">
     <el-dropdown split-button type="text" class="dropdown" @click="handle('cancelOrder')" @command="handleCommand">
       取消订单
       取消订单
       <i class="el-icon-info" title="只有[待付款,发货中,异常,已付款待审核,等供销商|外仓发货,已客审待财审]才可以取消订单"></i>
       <i class="el-icon-info" title="只有[待付款,发货中,异常,已付款待审核,等供销商|外仓发货,已客审待财审]才可以取消订单"></i>

+ 2 - 2
src/views/oms/order/components/purchaseModel.vue

@@ -8,7 +8,7 @@
       <el-collapse-item title="基本信息" name="1" class="add-order-item">
       <el-collapse-item title="基本信息" name="1" class="add-order-item">
         <by-form :propConfig="baseConfig" ref="baseform">
         <by-form :propConfig="baseConfig" ref="baseform">
           <template v-slot:organizationName='{ value }'>
           <template v-slot:organizationName='{ value }'>
-            <el-input placeholder="请选择供应商" v-model="value.organizationName" @clear="organizationClear" class="input-organizationName" size="mini" clearable>
+            <el-input placeholder="请选择供应商" v-model="value.organizationName" @clear="organizationClear" class="input-organizationName" size="small" clearable>
               <el-button slot="append" icon="el-icon-more" @click="handleSupplier"></el-button>
               <el-button slot="append" icon="el-icon-more" @click="handleSupplier"></el-button>
             </el-input>
             </el-input>
           </template>
           </template>
@@ -35,7 +35,7 @@ export default class PurchaseModel extends Vue {
   activeNames:Array<any>=['1','2']
   activeNames:Array<any>=['1','2']
   baseConfig:any={
   baseConfig:any={
     attr:{
     attr:{
-      size:'mini',
+      size:'small',
       rules:{
       rules:{
         organizationName:[{
         organizationName:[{
           required: true, message: '供应商不能为空!', trigger: 'blur'
           required: true, message: '供应商不能为空!', trigger: 'blur'

+ 94 - 0
src/views/oms/order/components/setQuesModal.vue

@@ -0,0 +1,94 @@
+<template>
+  <vxe-modal v-model="value" id="setQuest" width="400" v-loading="load" @hide="hide" height="300" show-footer title="转异常单">
+    <by-form :propConfig="config" ref="form"></by-form>
+    <template #footer>
+      <div class="btn">
+        <el-button type="primary" size="small" @click="btn">确定</el-button>
+      </div>
+    </template>
+  </vxe-modal>
+</template>
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+import { setQuestions } from '@/api/omsOrder'
+@Component({components:{}})
+export default class SetQuesModal extends Vue {
+  value = false;
+  load = false;
+  billValue:Array<any>=[]
+  config:any={
+    attr:{
+      rules:{
+        questionType: [
+          { required: true, message: '请选择类型', trigger: 'change' }
+        ]
+      }
+    },
+    columns:[
+      [{
+        label:'类型',
+        prop:'questionType',
+        labelWidth:'80px',
+        component:'by-select',
+        compConfig:{
+          attr:{
+            data:[],
+            label:'type',
+            value:'id'
+          }
+        }
+      }],
+      [{
+        label:'描述',
+        prop:'questionDesc',
+        labelWidth:'80px',
+        component:'by-input',
+        compConfig:{
+          attr:{
+            type:'textarea',
+            rows:3
+          }
+        }
+      }]
+    ]
+  }
+  show(){
+    
+  }
+  setQuestTypeData(data:Array<any>){
+    let c = this.config.columns[0][0].compConfig;
+    c.attr.data = data;
+    if(this.$refs.form){
+      (this.$refs.form as any).setCompConfig('questionType',c)
+    }
+  }
+  setBillValue(data:Array<any>){
+    this.billValue = data;
+  }
+  hide(){
+    (this.$refs.form as any).clearValidate();
+    (this.$refs.form as any).clearValue();
+  }
+  setShow(v:boolean){
+    this.value = v;
+  }
+  btn(){
+    (this.$refs.form as any).validate().then(()=>{
+      let data = (this.$refs.form as any).getValue();
+      data.idList = this.billValue;
+      this.load = true
+      setQuestions(data).then(()=>{
+        this.load = false;
+        (this.$message({
+          message:'操作成功!',
+          type:'success'
+        }));
+        this.$emit('handleSuccess');
+        this.value = false;
+      }).catch(()=>{
+        this.load = false;
+      })
+    })
+  }
+}
+</script>

+ 5 - 1
src/views/oms/order/components/splitModal.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
   <vxe-modal v-model="value" id="splitModel" title="拆分订单" width="70%" height="80%" min-width="460" min-height="320" show-zoom resize transfer :show-footer="!hideBtn" v-loading="load">
   <vxe-modal v-model="value" id="splitModel" title="拆分订单" width="70%" height="80%" min-width="460" min-height="320" show-zoom resize transfer :show-footer="!hideBtn" v-loading="load">
-    <by-table :propConfig="config" ref="table"> 
+    <by-table :propConfig="config" ref="table" id="split-table"> 
       <template v-slot:num="{row}">
       <template v-slot:num="{row}">
         <vxe-input v-model="row.num" v-if="row.splitNum > 0" placeholder="请输入" type="integer" @input="onChangeRow(row)"></vxe-input>
         <vxe-input v-model="row.num" v-if="row.splitNum > 0" placeholder="请输入" type="integer" @input="onChangeRow(row)"></vxe-input>
       </template>
       </template>
@@ -59,6 +59,7 @@ export default class SplitModel extends Vue {
   }
   }
 
 
   setShow(v:boolean){
   setShow(v:boolean){
+    this.hideBtn = false;
     this.value = v;
     this.value = v;
   }
   }
   setData(data:any){
   setData(data:any){
@@ -71,7 +72,10 @@ export default class SplitModel extends Vue {
       this.data = [];
       this.data = [];
     }
     }
     this.$nextTick(()=>{
     this.$nextTick(()=>{
+      let height = (document.getElementById('split-table') as any).parentNode.offsetHeight;
+      this.config.attr.height=height - 36;
       if(this.$refs.table){
       if(this.$refs.table){
+        (this.$refs.table as any).setConfig(this.config);
         (this.$refs.table as any).setValue(this.data);
         (this.$refs.table as any).setValue(this.data);
       }
       }
     })
     })

+ 88 - 37
src/views/oms/order/index.vue

@@ -54,7 +54,7 @@
             <filter-date @change="onChangeTime" ref="searchCom07" />
             <filter-date @change="onChangeTime" ref="searchCom07" />
             <div>付款后几小时未发货:</div>
             <div>付款后几小时未发货:</div>
             <div class="order-time">
             <div class="order-time">
-              <el-input v-model="value.deliveryHours" class="deliveryHours-input" size="mini" type="number" :input="value.deliveryHours=value?.deliveryHours?.replace(/^(0+)|[^\d]+/g,'')" style=""></el-input>
+              <vxe-input v-model="value.deliveryHours" class="deliveryHours-input" clearable type="number" size="mini"></vxe-input>
               <i class="el-icon-info" title="单位小时,不支持小数位。如果数值大于0,强制为未发货订单。同时勾选店铺可以实现不同平台的未发货时效查询"></i>
               <i class="el-icon-info" title="单位小时,不支持小数位。如果数值大于0,强制为未发货订单。同时勾选店铺可以实现不同平台的未发货时效查询"></i>
             </div>
             </div>
             <filterMinMax title="剩余发货时间(小时)" ref="searchCom08" minField="deliveryRemainingMin" maxField="deliveryRemainingMax" @change="parameChange" />
             <filterMinMax title="剩余发货时间(小时)" ref="searchCom08" minField="deliveryRemainingMin" maxField="deliveryRemainingMax" @change="parameChange" />
@@ -164,7 +164,7 @@
     <div class="order-right">
     <div class="order-right">
       <div class="tool">
       <div class="tool">
         <order-tool @addOrder="addOrder" @smt="smtOrder" @reSmt="reSmt" @loadOrder="loadOrder" @producePurchase="producePurchase" @cancelOrder="cancelOrder" 
         <order-tool @addOrder="addOrder" @smt="smtOrder" @reSmt="reSmt" @loadOrder="loadOrder" @producePurchase="producePurchase" @cancelOrder="cancelOrder" 
-        @reCancelOrder="reCancelOrder" @updateRmk="updateRmk"/>
+        @reCancelOrder="reCancelOrder" @updateRmk="updateRmk" @changeQues="changeQues" @changeNormal="changeNormal"/>
       </div>
       </div>
       <div class="table">
       <div class="table">
         <order-table :data="data" ref="orderTable" class="order-table" @detail="detail" @mergeHandle="mergeHandle" @splitHandle="splitHandle"/>
         <order-table :data="data" ref="orderTable" class="order-table" @detail="detail" @mergeHandle="mergeHandle" @splitHandle="splitHandle"/>
@@ -187,6 +187,8 @@
       <cancel-order-model ref="cancelOrderModel" @handleSuccess="handleSuccess" />
       <cancel-order-model ref="cancelOrderModel" @handleSuccess="handleSuccess" />
       <!-- 异常 -->
       <!-- 异常 -->
       <quest-model ref="questModel" @questHide="getQuestionList" />
       <quest-model ref="questModel" @questHide="getQuestionList" />
+      <!-- 转异常 -->
+      <set-ques-modal ref="setQuesModal" @handleSuccess="handleSuccess" />
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
@@ -208,10 +210,11 @@ import MergeModel from "./components/mergeMedal.vue"; //合并
 import SplitModel from "./components/splitModal.vue"; //拆分
 import SplitModel from "./components/splitModal.vue"; //拆分
 import CancelOrderModel from "./components/cancelOrderModel.vue"; //取消订单
 import CancelOrderModel from "./components/cancelOrderModel.vue"; //取消订单
 import QuestModel from "./components/questModel.vue";
 import QuestModel from "./components/questModel.vue";
-import { query,getProvince,smt,unSmt,purchaseQty,unCancel } from '@/api/omsOrder'
+import SetQuesModal from "./components/setQuesModal.vue";
+import { query,getProvince,smt,unSmt,purchaseQty,unCancel,setQuestions,resetQuestion } from '@/api/omsOrder'
 import { queryAll } from '@/api/question'
 import { queryAll } from '@/api/question'
 @Component({components:{filterInput,OrderCheckbox,OrderRadio,filterDate,OrderTool,OrderTable,AddOrder,InputSelect,OrderProduct,
 @Component({components:{filterInput,OrderCheckbox,OrderRadio,filterDate,OrderTool,OrderTable,AddOrder,InputSelect,OrderProduct,
-  filterMinMax,loadOrderModal,PurchaseModel,MergeModel,SplitModel,CancelOrderModel,QuestModel}})
+  filterMinMax,loadOrderModal,PurchaseModel,MergeModel,SplitModel,CancelOrderModel,QuestModel,SetQuesModal}})
 export default class Order extends Vue {
 export default class Order extends Vue {
   activeNames:Array<any>=['1','status']
   activeNames:Array<any>=['1','status']
   radio=''
   radio=''
@@ -484,12 +487,77 @@ export default class Order extends Vue {
     this.getQuestionList();
     this.getQuestionList();
   }
   }
   updateRmk(){
   updateRmk(){
-    let data = (this.$refs.table as any).getValue();
+    let data = (this.$refs.table as any).getSelectData();
     if(data.length == 0){
     if(data.length == 0){
       this.$message('请选择订单');
       this.$message('请选择订单');
       return
       return
     }
     }
-    
+  }
+  //转异常
+  changeQues(){
+    let data:Array<any>= (this.$refs.orderTable as any).getSelectData();
+    if(data.length == 0){
+      this.$message('请选择订单!');
+      return
+    }
+    let msg = '';
+    let billData:Array<any>=[]
+    for(const item of data){
+      billData.push(item.id);
+      if(item.status == 'Question'){
+        if(msg){
+          msg = msg + ',' + item.id
+        }else{
+          msg = item.id
+        }
+      }
+    }
+    if(msg){
+      this.$message({
+        message:'订单“'+msg + '”状态异常,不能执行此操作!!'
+      })
+      return
+    }
+    (this.$refs.setQuesModal as any).setBillValue(billData);
+    (this.$refs.setQuesModal as any).setQuestTypeData(this.questData);
+    (this.$refs.setQuesModal as any).setShow(true);
+  }
+  //转正常
+  changeNormal(){
+    let data:Array<any>= (this.$refs.orderTable as any).getSelectData();
+    if(data.length == 0){
+      this.$message('请选择订单!');
+      return
+    }
+    let msg = '';
+    let billData:Array<any>=[]
+    for(const item of data){
+      billData.push(item.id);
+      if(item.status != 'Question'){
+        if(msg){
+          msg = msg + ',' + item.id
+        }else{
+          msg = item.id
+        }
+      }
+    }
+    if(msg){
+      this.$message({
+        message:'订单“'+msg + '”状态正常常,不能执行此操作!!'
+      })
+      return
+    }
+    this.load = true
+    resetQuestion({idList:billData}).then(()=>{
+      this.load = false;
+      (this.$message({
+        message:'操作成功!',
+        type:'success'
+      }));
+      this.getList();
+    }).catch(()=>{
+      this.load = false;
+    })
   }
   }
   //异常数据弹窗
   //异常数据弹窗
   showQuestType(){
   showQuestType(){
@@ -499,14 +567,11 @@ export default class Order extends Vue {
   getQuestionList(){
   getQuestionList(){
     queryAll().then((res:any) => {
     queryAll().then((res:any) => {
       this.questData = res.data;
       this.questData = res.data;
-    }).catch((err:any) => {
-
-    })
+    }).catch(() => { })
   }
   }
 
 
   //生成采购单
   //生成采购单
   producePurchase(){
   producePurchase(){
-    
     let data:Array<any>= (this.$refs.orderTable as any).getSelectData();
     let data:Array<any>= (this.$refs.orderTable as any).getSelectData();
     if(data.length == 0){
     if(data.length == 0){
       this.$message('请选择订单!');
       this.$message('请选择订单!');
@@ -517,9 +582,9 @@ export default class Order extends Vue {
     for(const item of data){
     for(const item of data){
       if(item.isSubmitted != 1){
       if(item.isSubmitted != 1){
         if(msg){
         if(msg){
-          msg = msg + ',' + item.sourceId
+          msg = msg + ',' + item.id
         }else{
         }else{
-          msg = item.sourceId
+          msg = item.id
         }
         }
       }
       }
       ids.push(item.id)
       ids.push(item.id)
@@ -608,16 +673,16 @@ export default class Order extends Vue {
     for(const item of data){
     for(const item of data){
       if(item.isSubmitted == 1){
       if(item.isSubmitted == 1){
         if(smtMst){
         if(smtMst){
-          smtMst = smtMst + ',' + item.sourceId
+          smtMst = smtMst + ',' + item.id
         }else{
         }else{
-          smtMst = item.sourceId
+          smtMst = item.id
         }
         }
       }
       }
       if(!item.pays && item.pays.length == 0){
       if(!item.pays && item.pays.length == 0){
         if(msg){
         if(msg){
-          msg = msg + ',' + item.sourceId
+          msg = msg + ',' + item.id
         }else{
         }else{
-          msg = item.sourceId
+          msg = item.id
         }
         }
       }
       }
       ids.push(item.id)
       ids.push(item.id)
@@ -639,17 +704,10 @@ export default class Order extends Vue {
       ids:ids
       ids:ids
     }).then((res:any) => {
     }).then((res:any) => {
       this.load = false;
       this.load = false;
-      // if(res.data == data.length){
         (this as any).$message({
         (this as any).$message({
           message: res.msg,
           message: res.msg,
           type: 'success'
           type: 'success'
         });
         });
-      // }else{
-      //   (this as any).$message({
-      //     message: (data.length - res.data)+'条订单提交失败!',
-      //     type: 'warning'
-      //   });
-      // }
       this.getList();
       this.getList();
     })
     })
   }
   }
@@ -664,9 +722,9 @@ export default class Order extends Vue {
     for(const item of data){
     for(const item of data){
       if(item.isSubmitted == 0){
       if(item.isSubmitted == 0){
         if(smtMst){
         if(smtMst){
-          smtMst = smtMst + ',' + item.sourceId
+          smtMst = smtMst + ',' + item.id
         }else{
         }else{
-          smtMst = item.sourceId
+          smtMst = item.id
         }
         }
       }
       }
       ids.push(item.id)
       ids.push(item.id)
@@ -682,17 +740,10 @@ export default class Order extends Vue {
       ids:ids
       ids:ids
     }).then((res:any) => {
     }).then((res:any) => {
       this.load = false;
       this.load = false;
-      // if(res.data == data.length){
         (this as any).$message({
         (this as any).$message({
           message: '订单反提交成功!',
           message: '订单反提交成功!',
           type: 'success'
           type: 'success'
         });
         });
-      // }else{
-      //   (this as any).$message({
-      //     message: (data.length - res.data)+'条订单反提交失败!',
-      //     type: 'warning'
-      //   });
-      // }
       this.getList();
       this.getList();
     })
     })
   }
   }
@@ -830,9 +881,9 @@ export default class Order extends Vue {
         ids.push(item.id)
         ids.push(item.id)
       }else{
       }else{
         if(msgIds){
         if(msgIds){
-          msgIds = msgIds + ',' + item.sourceId
+          msgIds = msgIds + ',' + item.id
         }else{
         }else{
-          msgIds = item.sourceId
+          msgIds = item.id
         }
         }
       }
       }
     }
     }
@@ -859,9 +910,9 @@ export default class Order extends Vue {
         ids.push(item.id)
         ids.push(item.id)
       }else{
       }else{
         if(msgIds){
         if(msgIds){
-          msgIds = msgIds + ',' + item.sourceId
+          msgIds = msgIds + ',' + item.id
         }else{
         }else{
-          msgIds = item.sourceId
+          msgIds = item.id
         }
         }
       }
       }
     }
     }
@@ -1020,7 +1071,7 @@ export default class Order extends Vue {
   }
   }
 }
 }
 .deliveryHours-input{
 .deliveryHours-input{
-  width: 70px; 
+  width: 80px; 
   flex-shrink: 0; 
   flex-shrink: 0; 
   padding: 0;
   padding: 0;
   .el-input__inner{
   .el-input__inner{