Procházet zdrojové kódy

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-eom into test

yusheng před 10 měsíci
rodič
revize
f15b9bbf25

+ 35 - 16
src/api/exceptionManagement/index.js

@@ -3,18 +3,18 @@ import request from '@/utils/request';
 /**
  * 列表
  */
- export async function getList (params) {
-    const res = await request.get('/eom/exceptionmanagement/page', {params});
-    if (res.data.code == 0) {
-      return res.data.data;
-    }
-    return Promise.reject(new Error(res.data.message));
+export async function getList(params) {
+  const res = await request.get('/eom/exceptionmanagement/page', { params });
+  if (res.data.code == 0) {
+    return res.data.data;
   }
+  return Promise.reject(new Error(res.data.message));
+}
 /**
  * 详情
  */
-export async function getById (id) {
-  const res = await request.get('/eom/exceptionmanagement/getById/'+id);
+export async function getById(id) {
+  const res = await request.get('/eom/exceptionmanagement/getById/' + id);
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -23,11 +23,30 @@ export async function getById (id) {
 /**
  * 跟新
  */
-  // 编辑
-  export async function update (data) {
-    const res = await request.put(`/eom/exceptionmanagement/update`, data);
-    if (res.data.code == 0) {
-      return res.data.message;
-    }
-    return Promise.reject(new Error(res.data.message));
-  }
+// 编辑
+export async function update(data) {
+  const res = await request.put(`/eom/exceptionmanagement/update`, data);
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 编辑
+export async function save(data) {
+  const res = await request.post(`/eom/exceptionmanagement/save`, data);
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 删除
+ */
+export async function remove(data) {
+  const res = await request.delete('/eom/exceptionmanagement/delete', { data });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+

+ 156 - 76
src/views/saleManage/saleOrder/exceptionManagement/components/addOrEditDialog.vue

@@ -121,10 +121,17 @@
             </el-option>
           </el-select>
         </template>
+        <template v-slot:describes="scope">
+            <el-input
+              v-model="scope.row.describes"
+              placeholder="请输入"
+            >
+            </el-input>
+          </template>
         <template v-slot:exceptionDetermine="scope">
           <el-select
             v-model="scope.row.exceptionDetermine"
-            :disabled="title== '详情'"
+            :disabled="title == '详情'"
             placeholder="请选择"
           >
             <el-option
@@ -136,6 +143,27 @@
             </el-option>
           </el-select>
         </template>
+        <template v-slot:totalCount="scope">
+          <el-input
+            v-model="scope.row.totalCount"
+            type="number"
+            placeholder="请输入"
+          ></el-input>
+        </template>
+        <!-- 操作列 -->
+        <template v-slot:action="scope" v-if="title!='详情'">
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除吗?"
+            @confirm="remove(scope.$index)"
+          >
+            <template v-slot:reference>
+              <el-link type="danger" :underline="false" icon="el-icon-delete">
+                删除
+              </el-link>
+            </template>
+          </el-popconfirm>
+        </template>
       </ele-pro-table>
     </el-form>
 
@@ -169,20 +197,30 @@
       ref="processSubmitDialogRef"
       @reload="reload"
     ></process-submit-dialog>
-    <sendConfirmDialog ref="sendConfirmDialogRef" @changeParent="changeParent"></sendConfirmDialog>
+    <sendConfirmDialog
+      ref="sendConfirmDialogRef"
+      @changeParent="changeParent"
+    ></sendConfirmDialog>
   </ele-modal>
 </template>
 
 <script>
   import dictMixins from '@/mixins/dictMixins';
-  import { getById, update } from '@/api/exceptionManagement/index';
+  import { getById, update, save } from '@/api/exceptionManagement/index';
   import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
-  import {
-    getSendSaleOrderConfirmDetail,
-  } from '@/api/saleManage/invoiceConfirm';
+  import { getSendSaleOrderConfirmDetail } from '@/api/saleManage/invoiceConfirm';
   import { relationType } from '@/enum/dict.js';
   import bpmDetail from '@/views/bpm/processInstance/detail.vue';
   import sendConfirmDialog from '@/views/saleManage/saleOrder/invoiceConfirm/components/sendConfirmDialog.vue';
+  const def = {
+    name: '',
+    relationCode: '',
+    relationType: '',
+    relationName: '',
+    relationTypeName: '',
+    relationId: '',
+    detailList: []
+  };
   export default {
     mixins: [dictMixins],
     components: {
@@ -221,14 +259,7 @@
             { required: true, message: '请选择来源', trigger: 'change' }
           ]
         },
-        form: {
-          name: '',
-          relationCode: '',
-          relationType: '',
-          relationName: '',
-          relationTypeName: '',
-          relationId:''
-        },
+        form: { ...def },
         columns: [
           {
             width: 45,
@@ -271,15 +302,31 @@
             align: 'center'
           },
           {
-            minWidth: 100,
-            prop: 'totalCount',
-            label: '发货数量',
-            showOverflowTooltip: true,
+            width: 120,
+            prop: 'specification',
+            label: '规格',
+            slot: 'specification',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'modelType',
+            label: '型号',
+            slot: 'modelType',
             align: 'center'
           },
+
+          // {
+          //   minWidth: 100,
+          //   prop: 'saleCount',
+          //   label: '发货数量',
+          //   showOverflowTooltip: true,
+          //   align: 'center'
+          // },
           {
             minWidth: 100,
             prop: 'totalCount',
+            slot: 'totalCount',
             label: '异常数量',
             showOverflowTooltip: true,
             align: 'center'
@@ -321,27 +368,27 @@
             showOverflowTooltip: true,
             align: 'center'
           },
-          {
-            minWidth: 160,
-            prop: 'packageNo',
-            align: 'center',
-            label: '包装编码',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 100,
-            prop: 'packingQuantity',
-            align: 'center',
-            label: '包装数量',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 120,
-            prop: 'packingUnit',
-            align: 'center',
-            label: '包装单位',
-            showOverflowTooltip: true
-          },
+          // {
+          //   minWidth: 160,
+          //   prop: 'packageNo',
+          //   align: 'center',
+          //   label: '包装编码',
+          //   showOverflowTooltip: true
+          // },
+          // {
+          //   minWidth: 100,
+          //   prop: 'packingQuantity',
+          //   align: 'center',
+          //   label: '包装数量',
+          //   showOverflowTooltip: true
+          // },
+          // {
+          //   minWidth: 120,
+          //   prop: 'packingUnit',
+          //   align: 'center',
+          //   label: '包装单位',
+          //   showOverflowTooltip: true
+          // },
 
           {
             minWidth: 150,
@@ -364,35 +411,35 @@
           //       : '';
           //   }
           // },
-          {
-            width: 100,
-            prop: 'singlePrice',
-            label: '单价',
-            slot: 'singlePrice',
-            align: 'center'
-          },
+          // {
+          //   width: 100,
+          //   prop: 'singlePrice',
+          //   label: '单价',
+          //   slot: 'singlePrice',
+          //   align: 'center'
+          // },
 
-          {
-            width: 100,
-            prop: 'totalPrice',
-            label: '合计',
-            align: 'center'
-          },
+          // {
+          //   width: 100,
+          //   prop: 'totalPrice',
+          //   label: '合计',
+          //   align: 'center'
+          // },
 
-          {
-            minWidth: 80,
-            prop: 'receiveTotalWeight',
-            label: '重量',
-            showOverflowTooltip: true,
-            align: 'center'
-          },
-          {
-            minWidth: 100,
-            prop: 'weightUnit',
-            label: '重量单位',
-            showOverflowTooltip: true,
-            align: 'center'
-          },
+          // {
+          //   minWidth: 80,
+          //   prop: 'receiveTotalWeight',
+          //   label: '重量',
+          //   showOverflowTooltip: true,
+          //   align: 'center'
+          // },
+          // {
+          //   minWidth: 100,
+          //   prop: 'weightUnit',
+          //   label: '重量单位',
+          //   showOverflowTooltip: true,
+          //   align: 'center'
+          // },
 
           {
             width: 220,
@@ -400,6 +447,16 @@
             label: '描述',
             slot: 'describes',
             align: 'center'
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 120,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            fixed: 'right',
+            showOverflowTooltip: true
           }
         ]
       };
@@ -418,12 +475,12 @@
           this.form.relationTypeName = relationType[1];
         }
       },
-      async changeParent(data){
-       const res= await getSendSaleOrderConfirmDetail(data.id)
-       this.form.relationCode=res.docNo
-       this.form.relationId=res.id
-       this.form.relationName=res.contactName+'-'+res.docNo
-       this.form.detailList=res.productList
+      async changeParent(data) {
+        const res = await getSendSaleOrderConfirmDetail(data.id);
+        this.form.relationCode = res.docNo;
+        this.form.relationId = res.id;
+        this.form.relationName = res.contactName + '-' + res.docNo;
+        this.$set(this.form, 'detailList', res.productList);
       },
 
       //获取订单详情
@@ -437,8 +494,25 @@
           this.form = data;
         }
       },
+      getValidate() {
+        return Promise.all([
+          new Promise((resolve, reject) => {
+            this.$refs.form.validate((valid) => {
+              if (!valid) {
+                reject(false);
+              } else {
+                resolve(true);
+              }
+            });
+          })
+        ]).catch((e) => {
+          this.$message.warning('有必填项未填写,请检查');
+          return Promise.reject(e);
+        });
+      },
       async save(type) {
         try {
+          await this.getValidate()
           this.loading = true;
           let isExceptionDispose = false;
           let isExceptionDetermine = false;
@@ -446,9 +520,7 @@
             if (!item.exceptionDispose) {
               isExceptionDispose = true;
             }
-            if (!item.exceptionDispose) {
-              is = true;
-            }
+
             if (!item.exceptionDetermine) {
               isExceptionDetermine = true;
             }
@@ -461,7 +533,8 @@
             this.$message.error('异常类型不能为空');
             return;
           }
-          update(this.form)
+          let api = this.form.id ? update : save;
+          api(this.form)
             .then((res) => {
               this.loading = false;
               this.$message.success('操作成功');
@@ -479,6 +552,10 @@
           // 表单验证未通过,不执行保存操作
         }
       },
+      remove(index) {
+        this.form.detailList.splice(index, 1);
+      },
+
       async submit() {
         this.processSubmitDialogFlag = true;
 
@@ -497,6 +574,9 @@
         });
       },
       reload() {
+        this.form = {
+          ...form
+        };
         this.cancel();
       },
       cancel() {

+ 28 - 27
src/views/saleManage/saleOrder/exceptionManagement/exceptionList/index.vue

@@ -55,16 +55,16 @@
         <!-- 操作列 -->
         <!-- 表头工具栏 -->
         <template v-slot:toolbar>
-          <!-- <el-button
+          <el-button
             size="small"
             type="primary"
             icon="el-icon-plus"
             class="ele-btn-icon"
-            @click="open('add')"
+            @click="dispose('add')"
           >
             新建
           </el-button>
-          <el-button
+          <!-- <el-button
             size="small"
             type="danger"
             icon="el-icon-delete"
@@ -107,18 +107,7 @@
 
         <!-- <template v-slot:action="{ row }">
 
-          <el-popconfirm
-            class="ele-action"
-            title="确定要删除吗?"
-            v-if="row.approvalStatus == 0 || row.approvalStatus == 3"
-            @confirm="remove([row.id])"
-          >
-            <template v-slot:reference>
-              <el-link type="danger" :underline="false" icon="el-icon-delete">
-                删除
-              </el-link>
-            </template>
-          </el-popconfirm>
+
  
           <el-link
             type="primary"
@@ -148,8 +137,20 @@
           >
             提交
           </el-link>
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除吗?"
+            v-if="row.approvalStatus == 0 || row.approvalStatus == 3"
+            @confirm="remove([row.id])"
+          >
+            <template v-slot:reference>
+              <el-link type="danger" :underline="false" icon="el-icon-delete">
+                删除
+              </el-link>
+            </template>
+          </el-popconfirm>
         </template>
-        <dispose ref="disposeRef"></dispose>
+        <dispose ref="disposeRef" @done="reload"></dispose>
       </ele-pro-table>
     </el-card>
     <process-submit-dialog
@@ -178,7 +179,7 @@
       dispose,
       processSubmitDialog
     },
-    mixins: [dictMixins,tabMixins],
+    mixins: [dictMixins, tabMixins],
     data() {
       return {
         visible: false,
@@ -192,8 +193,8 @@
         // userOptions: [],
         viewId: '',
         qualityInspector: '',
-        cacheKeyUrl:'eos-7a45afd7-saleManage-exceptionList',
-        columnsVersion:1,
+        cacheKeyUrl: 'eos-7a45afd7-saleManage-exceptionList',
+        columnsVersion: 1
       };
     },
     computed: {
@@ -260,7 +261,7 @@
           // },
           {
             prop: 'relationType',
-            label: '来源类型',
+            label: '来源单据类型',
             align: 'center',
             formatter: (row, column, cellValue) => {
               return relationType[cellValue] || '';
@@ -268,12 +269,12 @@
           },
           {
             prop: 'relationCode',
-            label: '来源编码',
+            label: '来源单据编码',
             align: 'center'
           },
           {
             prop: 'relationName',
-            label: '来源名称',
+            label: '来源单据名称',
             align: 'center'
           },
 
@@ -299,7 +300,7 @@
           {
             columnKey: 'action',
             label: '操作',
-            width: 140,
+            width: 180,
             align: 'center',
             resizable: false,
             fixed: 'right',
@@ -328,16 +329,16 @@
         return getList({
           pageNum: page,
           size: limit,
-          ...where
+          ...where,
+          relationType: 1
         });
       },
       open(type, row) {
         this.$refs.create.open(type, row);
       },
       remove(id) {
-        let ids = id || this.selection.map((item) => item.id);
-        remove(ids).then((res) => {
-          this.$message.success('删除' + res);
+        remove(id).then((res) => {
+         
           this.reload();
         });
       },

+ 2 - 2
src/views/saleManage/saleOrder/invoice/components/print-template-by.vue

@@ -67,7 +67,7 @@
           </tr>
           <tr>
             <td colspan="3" style="padding: 1px 1px 10px 1px">
-              客户:{{ formData.linkName }}</td
+              客户:{{ formData.contactName }}</td
             >
             <td colspan="3" style="padding: 1px 1px 10px 1px">
               联系电话: {{ formData.linkPhone }}</td
@@ -248,7 +248,7 @@ export default {
         if (JSON.stringify(data) != '{}') {
           this.formData = data;
           this.formData['carName']=data.carList.map(item=>item.name).toString()
-          this.formData.projectName = data.saleOrder?.projectName;
+          this.formData.projectName = data.saleOrderList?.[0]?.projectName;
           this.formData.driverNames = data.logisticTrakListNoteVOList
             .map((item) => item.driverName)
             .join(','); // 承运人

+ 1 - 1
src/views/saleManage/saleOrder/invoice/components/print-template-jsyp.vue

@@ -50,7 +50,7 @@
         "
       >
         <span style="width: 39%"
-          >上市许可持有人:>{{this.groupName||'嘉实(湖南)医院科技有限公司'}}</span
+          >上市许可持有人:{{this.groupName||'嘉实(湖南)医院科技有限公司'}}</span
         >
         <span style="width: 39%"
           >地址:长沙高新开发区汇智中路179号金导园C区8栋</span

+ 17 - 7
src/views/saleManage/saleOrder/invoiceConfirm/components/addInvoiceDialog.vue

@@ -142,15 +142,21 @@
               v-model="scope.row.notaxSinglePrice"
               placeholder="请输入"
               type="number"
-           
             >
               <template slot="append">元</template>
             </el-input>
           </template>
+          <template v-slot:remark="scope">
+            <el-input
+              v-model="scope.row.remark"
+              placeholder="请输入"
+            >
+            </el-input>
+          </template>
           <template v-slot:totalCount="scope">
             <el-input
               v-model="scope.row.totalCount"
-              @input="totalCountChange(scope.row,scope.$index)"
+              @input="totalCountChange(scope.row, scope.$index)"
               type="number"
               placeholder="请输入"
             ></el-input>
@@ -839,13 +845,17 @@
         }
         this.isUpdate = type != 'add';
       },
-      totalCountChange(row,index) {
+      totalCountChange(row, index) {
         if (row.totalCount < 0) {
-          this.$set(this.form.productList[index],'totalCount',0)
+          this.$set(this.form.productList[index], 'totalCount', 0);
         }
-        if(row.totalCount&&row.singlePrice){
-          console.log(row.totalCount*row.singlePrice)
-          this.$set(this.form.productList[index],'totalPrice',row.totalCount*row.singlePrice)
+        if (row.totalCount && row.singlePrice) {
+          console.log(row.totalCount * row.singlePrice);
+          this.$set(
+            this.form.productList[index],
+            'totalPrice',
+            row.totalCount * row.singlePrice
+          );
         }
       },
       getValidate() {

+ 1 - 1
src/views/saleManage/saleOrder/invoiceConfirm/components/detailDialog.vue

@@ -498,7 +498,7 @@
             label: '发货状态',
             slot: 'isException',
             formatter: (row, column) => {
-              return row.isException == 1 ? '未发货' : '已发货';
+              return row.isException == 1 ? '有异常' : '无异常';
             },
             fixed: 'right',
             align: 'center'

+ 272 - 0
src/views/saleManage/saleOrder/invoiceConfirm/components/sendConfirmDialog.vue

@@ -0,0 +1,272 @@
+<template>
+  <el-dialog
+    title="选择发货确认单"
+    custom-class="ele-dialog-form long-dialog-form"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="70%"
+  >
+    <el-card shadow="never">
+      <searchTable @search="reload"></searchTable>
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        row-key="id"
+        height="calc(100vh - 500px)"
+        class="dict-table"
+        @cell-click="cellClick"
+      >
+        <!-- 表头工具栏 -->
+        <template v-slot:action="{ row }">
+          <el-radio class="radio" v-model="radio" :label="row.id"
+            ><i></i
+          ></el-radio>
+        </template>
+      </ele-pro-table>
+    </el-card>
+
+    <div class="btns" slot="footer">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import searchTable from './searchTable.vue';
+  import { getSendConfirmTableList } from '@/api/saleManage/invoiceConfirm';
+  import { reviewStatus } from '@/enum/dict';
+
+  export default {
+    components: {
+      searchTable
+    },
+    //客户管理数据
+    props: {
+      contactData: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      },
+      saleOrderData: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      }
+    },
+    data() {
+      return {
+        visible: false,
+        currentIndex: null,
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            action: 'action',
+            slot: 'action',
+            align: 'center',
+            label: '选择'
+          },
+
+          {
+            prop: 'docNo',
+            label: '确认单编码',
+            align: 'center',
+            sortable: true,
+            slot: 'docNo',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'sendNo',
+            label: '发货单编码',
+            align: 'center',
+            sortable: true,
+            slot: 'sendNo',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+
+          {
+            prop: 'productNames',
+            label: '产品名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'productCodes',
+            label: '产品编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160
+          },
+          {
+            prop: 'batchNos',
+            label: '批次号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'productCount',
+            label: '数量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+
+          {
+            prop: 'contactName',
+            label: '客户名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180
+          },
+          {
+            prop: 'replied',
+            label: '是否回执',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120,
+            formatter: (_row, _column, cellValue) => {
+              return _row.replied == 1 ? '是' : '否';
+            }
+          },
+          {
+            prop: 'reviewStatus',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100,
+            formatter: (_row, _column, cellValue) => {
+              return reviewStatus[_row.reviewStatus];
+            }
+          },
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 80
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          }
+        ],
+
+        radio: null
+      };
+    },
+
+    methods: {
+      open(item, currentIndex) {
+        this.currentIndex = currentIndex;
+        if (item && item.id) {
+          this.radio = item.id;
+        }
+
+        this.visible = true;
+      },
+
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        if (this.contactData.id) {
+          where['contactId'] = this.contactData.id;
+        }
+        if (this.saleOrderData.id) {
+          where['orderNo'] = this.saleOrderData.orderNo;
+        }
+
+        return getSendConfirmTableList({
+          pageNum: page,
+          size: limit,
+          ...where,
+          reviewStatus: 2
+        });
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        where = {
+          ...where,
+          reviewStatus: 2
+        };
+        this.$refs.table.reload({ pageNum: 1, where: where });
+      },
+
+      handleNodeClick(data, node) {
+        this.reload({ categoryId: data.id });
+      },
+
+      // 单击获取id
+      cellClick(row) {
+        this.current = row;
+        console.log(row);
+        this.radio = row.id;
+      },
+      handleClose() {
+        this.visible = false;
+        this.current = null;
+        this.radio = '';
+      },
+
+      selected() {
+        if (!this.current) {
+          return this.$message.warning('请至少选择一条数据');
+        }
+        this.$emit('changeParent', this.current, this.currentIndex);
+        this.handleClose();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .tree_col {
+    border: 1px solid #eee;
+    padding: 10px 0;
+    box-sizing: border-box;
+    height: 500px;
+    overflow: auto;
+  }
+
+  .table_col {
+    padding-left: 10px;
+
+    ::v-deep .el-table th.el-table__cell {
+      background: #f2f2f2;
+    }
+  }
+
+  .pagination {
+    text-align: right;
+    padding: 10px 0;
+  }
+
+  .btns {
+    text-align: center;
+    padding: 10px 0;
+  }
+
+  .topsearch {
+    margin-bottom: 15px;
+  }
+</style>