逆水行舟 пре 2 недеља
родитељ
комит
ca36cd3192

+ 1 - 1
src/benyun/utils/auth.ts

@@ -6,7 +6,7 @@ const ExpiresInKey = "AdminOMS-Expires-In";
 
 export function getToken() {
   if (process.env.NODE_ENV === "development") {
-    return "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6Ijc0ZWMwNGI1LTcxNGUtNGVlMS1iYTIzLWZmMGI5NDUwODkzYSIsInVzZXJuYW1lIjoiYWRtaW4ifQ.eKUIVxn9f-boOtRcZ9kX_4QtRay4h3gwQpcaHTBJF9kYidmxlp66gYF8GgeGnoCNfFV848eRDJ0TbrhThIFRYA";
+    return "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6IjM5YjViMzM1LTA1NzktNDYzMC04YzQ5LWNlNTFjMDE4YzMxOSIsInVzZXJuYW1lIjoiYWRtaW4ifQ.kHWoIl1fchZ3pzO5fHnuR-vb6r6q-o3HwVnU8W6MuEjURmj-IThkRpYZUnsWmWrJutATu4maSP9JsMIfqUA7DQ";
   } else {
     return Cookies.get(TokenKey);
   }

+ 3 - 3
src/views/oms/B2BOrder/components/deliveryDetail.vue

@@ -62,7 +62,7 @@
         </div>
         <div class="s-row">
           <div class="s-col width50">WMS发货类型:{{ getSendType(value.wmsSendType) }}</div>
-          <div class="s-col width50">WMS编号:{{ value.wmsSyncId }}</div>
+          <div class="s-col width50">TMS编号:{{ value.wmsSyncId }}</div>
         </div>
       </div>
       <div class="deli-footer">
@@ -132,7 +132,7 @@ export default class DeliveryDetail extends Vue {
     let n = '';
     switch (v) {
       case 0:
-        n = '创建';
+        n = 'oms 已完成向wms(极智嘉)的订单推送';
         break;
       case 5:
         n = '已分派';
@@ -166,7 +166,7 @@ export default class DeliveryDetail extends Vue {
     let n = '';
     switch (s) {
       case 1:
-        n = '创建';
+        n = 'oms 已完成向wms(极智嘉)的订单推送';
         break;
       case 2:
         n = '确认';

+ 91 - 43
src/views/oms/B2BOrder/components/importExcelModal.vue

@@ -1,17 +1,30 @@
 <template>
-  <vxe-modal v-model="show" id="importExcelFailModel" width="600" height="300" title="B2B订单导入" @hide="hide" resize transfer show-footer v-loading="load">
+  <vxe-modal v-model="show" id="importExcelFailModel" width="800" height="600" title="B2B订单导入" @hide="hide" resize
+    transfer show-footer v-loading="load">
     <div class="upload" v-if="!uploadRes">
       <div class="upload-name">{{ value.name }}</div>
-      <div class="upload-btn" @click="importOrder">{{value.name?'重新上传':'上传'}}</div>
+      <div class="upload-btn" @click="importOrder">{{ value.name ? '重新上传' : '上传' }}</div>
     </div>
     <div class="upload-module" v-if="!uploadRes" @click="loadDownExcel">下载excel模版</div>
     <div class="shop-result" v-if="uploadRes">
-      <div class="success">成功:{{uploadRes.successCount}}</div>
+      <div class="success">成功:{{ uploadRes.successCount }}</div>
       <div class="err">异常:{{ uploadRes.failureCount }}</div>
     </div>
+    <div v-if="uploadRes && uploadRes.failureCount > 0">
+      <el-table :data="tableData" border style="width: 100%">
+        <el-table-column type="index" width="50" />
+        <el-table-column v-for="(val, key) in tableData[0]" v-if="key === '订单编号' || key === '是否成功' || key === '操作信息'"
+          :key="key" :prop="key" :label="key === '操作信息' ? '异常原因' : key" show-overflow-tooltip
+          :width="key === '操作信息' ? '' : '120'" />
+      </el-table>
+
+      <el-pagination @current-change="handleCurrentChange" v-model:current-page="currentPage" :page-size="pageSize"
+        :total="total" layout="prev, pager, next, jumper" style="margin-top: 20px; text-align: right" />
+    </div>
     <template #footer>
       <div class="btn">
-        <el-button type="primary" size="small" @click="uploadErr" v-if="uploadRes && uploadRes.failureCount > 0">下载异常数据</el-button>
+        <el-button type="primary" size="small" @click="uploadErr"
+          v-if="uploadRes && uploadRes.failureCount > 0">下载异常数据</el-button>
         <el-button type="primary" size="small" @click="btn" v-if="!uploadRes">完成上传</el-button>
         <el-button plain size="small" @click="show = false">关闭</el-button>
       </div>
@@ -21,27 +34,32 @@
 
 <script lang="ts">
 import { Component, Prop, Vue, Watch } from "vue-property-decorator";
-import { importExc,loadDownModule } from '@/api/omsOrder'
+import { importExc, loadDownModule } from '@/api/omsOrder'
 import ExcelHelper from '@/benyun/utils/excelHelper'
-@Component({components:{}})
+// 处理成 table 能用的结构
+@Component({ components: {} })
 export default class ImportExcelFailModel extends Vue {
-  show:boolean = false;
-  value:any = {}
-  load:boolean = false;
-  uploadRes:any = null
-  setShow(v:boolean){
+  show: boolean = false;
+  value: any = {}
+  load: boolean = false;
+  uploadRes: any = null;
+  tableData: any = [];
+  currentPage = 1;
+  pageSize = 10;
+  total = this.tableData.length;
+  setShow(v: boolean) {
     this.show = v;
   }
-  hide(){
-    if(this.uploadRes && this.uploadRes.successCount > 0){
+  hide() {
+    if (this.uploadRes && this.uploadRes.successCount > 0) {
       this.$emit('handleSuccess')
     }
     this.value = {};
     this.uploadRes = null;
   }
   //下载模版
-  loadDownExcel(){
-    loadDownModule().then((res:any) => {
+  loadDownExcel() {
+    loadDownModule().then((res: any) => {
       let url = window.URL.createObjectURL(new Blob([res]));
       let link = document.createElement("a");
       link.style.display = "none";
@@ -50,7 +68,7 @@ export default class ImportExcelFailModel extends Vue {
       document.body.appendChild(link);
       link.click();
       document.body.removeChild(link);
-      
+
       this.$message({
         message: '下载成功!',
         type: 'success'
@@ -66,12 +84,12 @@ export default class ImportExcelFailModel extends Vue {
     input.accept = accept
     document.body.appendChild(input);
     const that = this;
-    input.addEventListener('change', function (e:any) {
+    input.addEventListener('change', function (e: any) {
       let txt = e.target.files[0];
       let s = txt.name.split('.');
       let suffix = '.' + s[s.length - 1];
-      if(accept.indexOf(suffix) == -1){
-        that.$message({message:'不支持该类型文件上传!'})
+      if (accept.indexOf(suffix) == -1) {
+        that.$message({ message: '不支持该类型文件上传!' })
         return
       }
       that.value = txt;
@@ -79,48 +97,72 @@ export default class ImportExcelFailModel extends Vue {
     input.click();
     document.body.removeChild(input);
   }
-  btn(){
-    if(!this.value.name){
+  btn() {
+    if (!this.value.name) {
       this.$message('请选择文件!');
       return
     }
     let data = new FormData();
-    data.append('file' , this.value);
+    data.append('file', this.value);
     this.load = true;
     importExc(data).then(res => {
       this.uploadRes = res.data;
+      this.tableData = this.transformFailureList(res.data.failureList);
+      this.total = this.tableData.length;
+      this.currentPage = 1;
+      this.tableData = this.pagedData()
       this.load = false;
     }).catch(err => {
       this.load = false;
-      if(err && err.msg) {
+      if (err && err.msg) {
         this.$message({
           showClose: true,
-          message:err.msg,
-          type:'error'
+          message: err.msg,
+          type: 'error'
         })
       }
     })
   }
-  uploadErr(){
-    let ExcelHead:Array<any> = [];
-    let data:Array<any>=[]
+  pagedData() {
+    const start = (this.currentPage - 1) * this.pageSize;
+    this.tableData = this.transformFailureList(this.uploadRes.failureList);
+    return this.tableData.slice(start, start + this.pageSize);
+  }
+  handleCurrentChange(val: number) {
+    this.currentPage = val;
+    this.tableData = this.pagedData();
+  }
+  transformFailureList(failureList) {
+    if (!failureList || failureList.length < 2) return [];
+    const headers = failureList[0];
+    return failureList.slice(1).map(row => {
+      const obj = {};
+      headers.forEach((h, i) => {
+        obj[h] = row[i];
+      });
+      return obj;
+    });
+  }
+  uploadErr() {
+    let ExcelHead: Array<any> = [];
+    let data: Array<any> = []
     // let arr=['orderCode','plantTime','sProvince','sCity','sCounty','address','sName','sTel','orderDate','buyId','orderRmk','lineRmk','productCode','productType','mProductCode','mProductName','mTypeCode','isGift','num','basePrice','price','rmk','isSuccess','info']
 
-    this.uploadRes.failureList.forEach((item:any,index:any) => {
-      let obj:any={}
-      item.forEach((ele:any,dex:any) => {
-        if(index === 0) {
+    this.uploadRes.failureList.forEach((item: any, index: any) => {
+      let obj: any = {}
+      item.forEach((ele: any, dex: any) => {
+        if (index === 0) {
           let excelHeadConfig = {
             text: ele,
             value: 'a' + dex,
             width: '200'
           }
           ExcelHead.push(excelHeadConfig)
-        }else{
+        } else {
           obj['a' + dex] = ele;
         }
       });
-      if(index !== 0){
+      if (index !== 0) {
         data.push(obj)
       }
     });
@@ -136,15 +178,15 @@ export default class ImportExcelFailModel extends Vue {
     excelHelper.toExcel({
       fileName: 'B2B异常数据(仅供参考,请误上传).xlsx',
       data: data,
-      otherData: {ExcelHead}
+      otherData: { ExcelHead }
     })
-    
+
   }
 }
 </script>
 
 <style lang="scss" scoped>
-.upload{
+.upload {
   width: 100%;
   display: flex;
   height: 40px;
@@ -153,7 +195,8 @@ export default class ImportExcelFailModel extends Vue {
   justify-content: center;
   margin-top: 32px;
   margin-bottom: 8px;
-  .upload-name{
+
+  .upload-name {
     height: 32px;
     width: 400px;
     border-radius: 5px;
@@ -164,7 +207,8 @@ export default class ImportExcelFailModel extends Vue {
     color: #333;
     line-height: 32px;
   }
-  .upload-btn{
+
+  .upload-btn {
     height: 32px;
     width: 70px;
     background-color: #0581FF;
@@ -178,25 +222,29 @@ export default class ImportExcelFailModel extends Vue {
     cursor: pointer;
   }
 }
-.upload-module{
+
+.upload-module {
   color: #0581FF;
   font-size: 14px;
   text-align: center;
   width: 100%;
   cursor: pointer;
 }
-.shop-result{
+
+.shop-result {
   width: 100%;
   padding-top: 40px;
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 28px;
-  .success{
+
+  .success {
     color: #0581FF;
     padding-right: 24px;
   }
-  .err{
+
+  .err {
     color: #F00;
     padding-left: 24px;
   }

+ 4 - 1
src/views/oms/B2BOrder/components/orderTable.vue

@@ -47,7 +47,10 @@
         <span v-if="row.status == 'WaitPay'">待付款</span>
         <span v-if="row.status == 'Delivering'">发货中</span>
         <span v-if="row.status == 'Merged'">被合并</span>
-        <span v-if="row.status == 'Question'" style="color:red">异常</span>
+        <div v-if="row.status == 'Question'" style="text-align: center;">
+          <div style="color:red">异常</div>
+          <div>{{ row.errorType }}</div>
+        </div>
         <span v-if="row.status == 'Split'">被拆分</span>
         <span v-if="row.status == 'WaitOuterSent'">等供销商|外仓发货</span>
         <span v-if="row.status == 'WaitConfirm'">已付款待审核</span>

+ 39 - 38
src/views/oms/B2BOrder/components/setQuesModal.vue

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

+ 22 - 4
src/views/oms/B2BOrder/index.vue

@@ -28,7 +28,7 @@
                   <div class="ques-list" v-show="showQues">
                     <template v-for="item of questData">
                       <el-checkbox :label="item.id" v-if="item.isShow == 1" :key="item.value">{{ item.type
-                        }}</el-checkbox>
+                      }}</el-checkbox>
                     </template>
                   </div>
                 </el-collapse-transition>
@@ -515,9 +515,11 @@ export default class Order extends Vue {
   orderTimeConfigOptions: IOrderTimeConfigItem[] = []
 
   mounted() {
-    this.getList();
+    //this.getList();
     this.getProvince();
-    this.getQuestionList();
+    this.getQuestionList(() => {
+      this.getList();
+    });
     this.getQuesttion();
     this.getOrderTimeOutList();
     this.tipOrderTimeOut();
@@ -873,12 +875,25 @@ export default class Order extends Vue {
     (this.$refs.questModel as any).setShow(true);
   }
   //获取异常数据
-  getQuestionList() {
+  getQuestionList(callBack) {
     queryAll().then((res: any) => {
       this.questData = res.data;
+      callBack();
     }).catch(() => { })
   }
 
+  updateQuestion() {
+    if (this.questData.length === 0 || this.data.length === 0) return;
+    //遍历this.data,获取this.data.questionType的值对应到this.questData中的this.questData,取this.questData.type
+    for (const item of this.data) {
+      for (const _item of this.questData) {
+        if (item.errorType == _item.id) {
+          item.errorType = _item.type;
+        }
+      }
+    }
+  }
+
   //生成采购单
   producePurchase() {
     let data: Array<any> = (this.$refs.orderTable as any).getSelectData();
@@ -1186,6 +1201,7 @@ export default class Order extends Vue {
     this.load = true;
     query(params, data).then((res: any) => {
       this.data = res.data.records;
+      this.updateQuestion();//更新异常记录的说明信息
       this.page.pageNo = res.data.current;
       this.page.total = res.data.total;
       this.load = false;
@@ -1202,6 +1218,7 @@ export default class Order extends Vue {
     const res = await queryByBarCode({ businessType: 'B2B', barCode: this.barCode, pageNo: 1, pageSize: 10 })
     this.load = false;
     this.data = res.data.records;
+    this.updateQuestion();//更新异常记录的说明信息
     this.page.pageNo = res.data.current;
     this.page.total = res.data.total;
   }
@@ -1220,6 +1237,7 @@ export default class Order extends Vue {
         this.data = [];//res.data.records;
       else
         this.data = res.data.records;
+      this.updateQuestion();//更新异常记录的说明信息
       this.page.pageNo = res.data.current;
       this.page.total = res.data.total;
       this.load = false;

+ 1 - 1
src/views/oms/B2COrder/components/deliveryDetail.vue

@@ -117,7 +117,7 @@ export default class DeliveryDetail extends Vue {
     let n = '';
     switch (s) {
       case 1:
-        n = 'oms 已完成向 wms 的订单推送';
+        n = 'oms 已完成向wms(极智嘉)的订单推送';
         break;
       case 2:
         n = '确认';

+ 90 - 43
src/views/oms/B2COrder/components/importExcelModal.vue

@@ -1,17 +1,30 @@
 <template>
-  <vxe-modal v-model="show" id="importExcelFailModel" width="600" height="300" title="B2C订单导入" @hide="hide" resize transfer show-footer v-loading="load">
+  <vxe-modal v-model="show" id="importExcelFailModel" width="800" height="600" title="B2C订单导入" @hide="hide" resize
+    transfer show-footer v-loading="load">
     <div class="upload" v-if="!uploadRes">
       <div class="upload-name">{{ value.name }}</div>
-      <div class="upload-btn" @click="importOrder">{{value.name?'重新上传':'上传'}}</div>
+      <div class="upload-btn" @click="importOrder">{{ value.name ? '重新上传' : '上传' }}</div>
     </div>
     <div class="upload-module" v-if="!uploadRes" @click="loadDownExcel">下载excel模版</div>
     <div class="shop-result" v-if="uploadRes">
-      <div class="success">成功:{{uploadRes.successCount}}</div>
+      <div class="success">成功:{{ uploadRes.successCount }}</div>
       <div class="err">异常:{{ uploadRes.failureCount }}</div>
     </div>
+    <div v-if="uploadRes && uploadRes.failureCount > 0">
+      <el-table :data="tableData" border style="width: 100%">
+        <el-table-column type="index" width="50" />
+        <el-table-column v-for="(val, key) in tableData[0]" v-if="key === '订单编号' || key === '是否成功' || key === '操作信息'"
+          :key="key" :prop="key" :label="key === '操作信息' ? '异常原因' : key" show-overflow-tooltip
+          :width="key === '操作信息' ? '' : '120'" />
+      </el-table>
+
+      <el-pagination @current-change="handleCurrentChange" v-model:current-page="currentPage" :page-size="pageSize"
+        :total="total" layout="prev, pager, next, jumper" style="margin-top: 20px; text-align: right" />
+    </div>
     <template #footer>
       <div class="btn">
-        <el-button type="primary" size="small" @click="uploadErr" v-if="uploadRes && uploadRes.failureCount > 0">下载异常数据</el-button>
+        <el-button type="primary" size="small" @click="uploadErr"
+          v-if="uploadRes && uploadRes.failureCount > 0">下载异常数据</el-button>
         <el-button type="primary" size="small" @click="btn" v-if="!uploadRes">完成上传</el-button>
         <el-button plain size="small" @click="show = false">关闭</el-button>
       </div>
@@ -21,27 +34,31 @@
 
 <script lang="ts">
 import { Component, Prop, Vue, Watch } from "vue-property-decorator";
-import { importB2cOrder,loadDownModule } from '@/api/omsOrder'
+import { importB2cOrder, loadDownModule } from '@/api/omsOrder'
 import ExcelHelper from '@/benyun/utils/excelHelper'
-@Component({components:{}})
+@Component({ components: {} })
 export default class ImportExcelFailModel extends Vue {
-  show:boolean = false;
-  value:any = {}
-  load:boolean = false;
-  uploadRes:any = null
-  setShow(v:boolean){
+  show: boolean = false;
+  value: any = {}
+  load: boolean = false;
+  uploadRes: any = null;
+  tableData: any = [];
+  currentPage = 1;
+  pageSize = 10;
+  total = this.tableData.length;
+  setShow(v: boolean) {
     this.show = v;
   }
-  hide(){
-    if(this.uploadRes && this.uploadRes.successCount > 0){
+  hide() {
+    if (this.uploadRes && this.uploadRes.successCount > 0) {
       this.$emit('handleSuccess')
     }
     this.value = {};
     this.uploadRes = null;
   }
   //下载模版
-  loadDownExcel(){
-    loadDownModule().then((res:any) => {
+  loadDownExcel() {
+    loadDownModule().then((res: any) => {
       let url = window.URL.createObjectURL(new Blob([res]));
       let link = document.createElement("a");
       link.style.display = "none";
@@ -50,7 +67,7 @@ export default class ImportExcelFailModel extends Vue {
       document.body.appendChild(link);
       link.click();
       document.body.removeChild(link);
-      
+
       this.$message({
         message: '下载成功!',
         type: 'success'
@@ -66,12 +83,12 @@ export default class ImportExcelFailModel extends Vue {
     input.accept = accept
     document.body.appendChild(input);
     const that = this;
-    input.addEventListener('change', function (e:any) {
+    input.addEventListener('change', function (e: any) {
       let txt = e.target.files[0];
       let s = txt.name.split('.');
       let suffix = '.' + s[s.length - 1];
-      if(accept.indexOf(suffix) == -1){
-        that.$message({message:'不支持该类型文件上传!'})
+      if (accept.indexOf(suffix) == -1) {
+        that.$message({ message: '不支持该类型文件上传!' })
         return
       }
       that.value = txt;
@@ -79,48 +96,72 @@ export default class ImportExcelFailModel extends Vue {
     input.click();
     document.body.removeChild(input);
   }
-  btn(){
-    if(!this.value.name){
+  btn() {
+    if (!this.value.name) {
       this.$message('请选择文件!');
       return
     }
     let data = new FormData();
-    data.append('file' , this.value);
+    data.append('file', this.value);
     this.load = true;
     importB2cOrder(data).then(res => {
       this.uploadRes = res.data;
+      this.tableData = this.transformFailureList(res.data.failureList);
+      this.total = this.tableData.length;
+      this.currentPage = 1;
+      this.tableData = this.pagedData()
       this.load = false;
     }).catch(err => {
       this.load = false;
-      if(err && err.msg) {
+      if (err && err.msg) {
         this.$message({
           showClose: true,
-          message:err.msg,
-          type:'error'
+          message: err.msg,
+          type: 'error'
         })
       }
     })
   }
-  uploadErr(){
-    let ExcelHead:Array<any> = [];
-    let data:Array<any>=[]
+  pagedData() {
+    const start = (this.currentPage - 1) * this.pageSize;
+    this.tableData = this.transformFailureList(this.uploadRes.failureList);
+    return this.tableData.slice(start, start + this.pageSize);
+  }
+  handleCurrentChange(val: number) {
+    this.currentPage = val;
+    this.tableData = this.pagedData();
+  }
+  transformFailureList(failureList) {
+    if (!failureList || failureList.length < 2) return [];
+    const headers = failureList[0];
+    return failureList.slice(1).map(row => {
+      const obj = {};
+      headers.forEach((h, i) => {
+        obj[h] = row[i];
+      });
+      return obj;
+    });
+  }
+  uploadErr() {
+    let ExcelHead: Array<any> = [];
+    let data: Array<any> = []
     // let arr=['orderCode','plantTime','sProvince','sCity','sCounty','address','sName','sTel','orderDate','buyId','orderRmk','lineRmk','productCode','productType','mProductCode','mProductName','mTypeCode','isGift','num','basePrice','price','rmk','isSuccess','info']
 
-    this.uploadRes.failureList.forEach((item:any,index:any) => {
-      let obj:any={}
-      item.forEach((ele:any,dex:any) => {
-        if(index === 0) {
+    this.uploadRes.failureList.forEach((item: any, index: any) => {
+      let obj: any = {}
+      item.forEach((ele: any, dex: any) => {
+        if (index === 0) {
           let excelHeadConfig = {
             text: ele,
             value: 'a' + dex,
             width: '200'
           }
           ExcelHead.push(excelHeadConfig)
-        }else{
+        } else {
           obj['a' + dex] = ele;
         }
       });
-      if(index !== 0){
+      if (index !== 0) {
         data.push(obj)
       }
     });
@@ -136,15 +177,15 @@ export default class ImportExcelFailModel extends Vue {
     excelHelper.toExcel({
       fileName: 'B2C异常数据(仅供参考,请误上传).xlsx',
       data: data,
-      otherData: {ExcelHead}
+      otherData: { ExcelHead }
     })
-    
+
   }
 }
 </script>
 
 <style lang="scss" scoped>
-.upload{
+.upload {
   width: 100%;
   display: flex;
   height: 40px;
@@ -153,7 +194,8 @@ export default class ImportExcelFailModel extends Vue {
   justify-content: center;
   margin-top: 32px;
   margin-bottom: 8px;
-  .upload-name{
+
+  .upload-name {
     height: 32px;
     width: 400px;
     border-radius: 5px;
@@ -164,7 +206,8 @@ export default class ImportExcelFailModel extends Vue {
     color: #333;
     line-height: 32px;
   }
-  .upload-btn{
+
+  .upload-btn {
     height: 32px;
     width: 70px;
     background-color: #0581FF;
@@ -178,25 +221,29 @@ export default class ImportExcelFailModel extends Vue {
     cursor: pointer;
   }
 }
-.upload-module{
+
+.upload-module {
   color: #0581FF;
   font-size: 14px;
   text-align: center;
   width: 100%;
   cursor: pointer;
 }
-.shop-result{
+
+.shop-result {
   width: 100%;
   padding-top: 40px;
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 28px;
-  .success{
+
+  .success {
     color: #0581FF;
     padding-right: 24px;
   }
-  .err{
+
+  .err {
     color: #F00;
     padding-left: 24px;
   }

+ 5 - 1
src/views/oms/B2COrder/components/orderTable.vue

@@ -50,7 +50,10 @@
         <span v-if="row.status == 'WaitPay'">待付款</span>
         <span v-if="row.status == 'Delivering'">发货中</span>
         <span v-if="row.status == 'Merged'">被合并</span>
-        <span v-if="row.status == 'Question'" style="color:red">异常</span>
+        <div v-if="row.status == 'Question'" style="text-align: center;">
+          <div style="color:red">异常</div>
+          <div>{{ row.errorType }}</div>
+        </div>
         <span v-if="row.status == 'Split'">被拆分</span>
         <span v-if="row.status == 'WaitOuterSent'">等供销商|外仓发货</span>
         <span v-if="row.status == 'WaitConfirm'">已付款待审核</span>
@@ -182,6 +185,7 @@ export default class OrderTable extends Vue {
   @Prop()
   data!: Array<any>
   height = null
+  questionData = []
 
   operationFlag: any = {
     'OMS': '手工下单',

+ 26 - 4
src/views/oms/B2COrder/index.vue

@@ -8,6 +8,7 @@
               基本信息<i class="header-icon el-icon-info" title="精确搜索"></i>
             </template>
             <input-select :options="myOptions" @input="parameChange" ref="searchCom01" />
+            <input-select :options="jstOption" @input="parameChange" ref="searchCom01_1" />
             <input-select :options="outLineOptions" @input="parameChangeBase($event, 'idType', 'idValue')"
               ref="searchCom02" />
             <input-select :options="buyerOptions" @input="parameChangeInfo($event, 'receiverInfo', 'receiverValue')"
@@ -254,10 +255,15 @@ export default class Order extends Vue {
     // excludeSkuType:1, //排除编码类型
   }
   myOptions = [{
-    label: '内部订单号',
+    label: 'OMS订单号',
     value: 'orderId',
     format: /[^0-9,]*/g
   }]
+  jstOption = [{
+    label: '聚水潭内部订单号',
+    value: 'innerId',
+    format: /[^0-9,]*/g
+  }]
   outLineOptions = [{
     label: '线上订单号',
     value: 'sourceId'
@@ -494,9 +500,11 @@ export default class Order extends Vue {
   provinceOptions: Array<any> = []
 
   mounted() {
-    this.getList();
+    //this.getList();
     this.getProvince();
-    this.getQuestionList();
+    this.getQuestionList(() => {
+      this.getList();
+    });
     this.getQuesttion();
   }
   //打印
@@ -840,11 +848,23 @@ export default class Order extends Vue {
     (this.$refs.questModel as any).setShow(true);
   }
   //获取异常数据
-  getQuestionList() {
+  getQuestionList(callBack) {
     queryAll().then((res: any) => {
       this.questData = res.data;
+      callBack();
     }).catch(() => { })
   }
+  updateQuestion() {
+    if (this.questData.length === 0 || this.data.length === 0) return;
+    //遍历this.data,获取this.data.questionType的值对应到this.questData中的this.questData,取this.questData.type
+    for (const item of this.data) {
+      for (const _item of this.questData) {
+        if (item.errorType == _item.id) {
+          item.errorType = _item.type;
+        }
+      }
+    }
+  }
 
   //生成采购单
   producePurchase() {
@@ -1130,6 +1150,7 @@ export default class Order extends Vue {
     this.load = true;
     query(params, data).then((res: any) => {
       this.data = res.data.records;
+      this.updateQuestion();//更新异常记录的说明信息
       this.page.pageNo = res.data.current;
       this.page.total = res.data.total;
       this.load = false;
@@ -1146,6 +1167,7 @@ export default class Order extends Vue {
     const res = await queryByBarCode({ businessType: 'B2C', barCode: this.barCode, pageNo: 1, pageSize: 10 })
     this.load = false;
     this.data = res.data.records;
+    this.updateQuestion();//更新异常记录的说明信息
     this.page.pageNo = res.data.current;
     this.page.total = res.data.total;
   }

+ 35 - 1
src/views/order/orderTimeLog/index.vue

@@ -43,10 +43,30 @@ export default class BackCallLog extends Vue {
                 title: '推送仓库时间',
                 field: 'pushWarehouseTime',
                 ellipsis: true,
+                component: 'textChange',
+                compConfig: {
+                    attr: {
+                        data: [{
+                            label: '未能获取WMS(极智嘉)数据',
+                            value: '未能获取WMS(极智嘉)数据',
+                            color: '#E99D42'
+                        }]
+                    }
+                }
             }, {
                 title: '仓库响应时间',
                 field: 'warehouseResponseTime',
                 ellipsis: true,
+                component: 'textChange',
+                compConfig: {
+                    attr: {
+                        data: [{
+                            label: '未能获取WMS(极智嘉)数据',
+                            value: '未能获取WMS(极智嘉)数据',
+                            color: '#E99D42'
+                        }]
+                    }
+                }
             }, {
                 title: '完成耗时(秒)',
                 field: 'finishTime',
@@ -77,7 +97,17 @@ export default class BackCallLog extends Vue {
         this.load = true;
         orderTimeList(query).then((res: any) => {
             this.load = false;
-            (this.$refs.view as any).setTableValue(this.checkFinishTime(res.rows as ICallbackLog[]));
+            //this.checkTableData(res.rows as ICallbackLog[]);
+            this.checkFinishTime(res.rows as ICallbackLog[])
+            res.rows.forEach((item: ICallbackLog) => {
+                if (!item.pushWarehouseTime) {
+                    item.pushWarehouseTime = '未能获取WMS(极智嘉)数据';
+                }
+                if (!item.warehouseResponseTime) {
+                    item.warehouseResponseTime = '未能获取WMS(极智嘉)数据';
+                }
+            });
+            (this.$refs.view as any).setTableValue(res.rows);
             //(this.$refs.view as any).setTableValue(res.rows);
             let page = {
                 pageNum: 1,// res.data.current, //当前页
@@ -129,5 +159,9 @@ export default class BackCallLog extends Vue {
     width: 100%;
     height: 100%;
     overflow-y: hidden;
+
+    ::v-deep .def-color {
+        color: #E99D42;
+    }
 }
 </style>