tangning 1 ano atrás
pai
commit
a9790927b5

+ 11 - 0
src/api/spares/index.ts

@@ -44,6 +44,7 @@ enum Api {
   u8ListList = '/service/sale/repairU8/u8List',
   u8Send = '/service/sale/repairU8/u8Send',
   invoiceRegister = '/service/sale/repairInvoice/invoiceRegister',
+  getInvoiceInfo = '/service/sale/repairInvoice/getInvoiceInfo',
   signFor = '/service/sale/salePersonnel/signFor',
 }
 
@@ -415,6 +416,16 @@ export const invoiceRegister = (params) =>
     },
   });
 
+export const getInvoiceInfo = (params) =>
+  defHttp.post<detailResult>({
+    url: Api.getInvoiceInfo,
+    params: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
 export const signFor = (params) =>
   defHttp.post<detailResult>({
     url: Api.signFor,

+ 36 - 18
src/views/work/detail.vue

@@ -252,15 +252,6 @@
               <div class="timeItem">
                 <div class="name">
                   <span>{{ item.title || item.remark }}</span>
-                  <!-- <a-button
-                  style="margin-left: 50px"
-                  @click="handleBut(butItem)"
-                  v-for="butItem in butList"
-                  :key="butItem"
-                  v-if="indexs == 0"
-                >
-                  {{ butItem }}
-                </a-button> -->
                 </div>
                 <div class="status" v-if="item.repairLogId">
                   {{ item.subTitle }} <span>{{ item.createTime }}</span>
@@ -273,11 +264,6 @@
                     ? '前台取回'
                     : `快递寄回  ${item.customerAddress.getTrackingNum}`
                 }}</div>
-                <!-- <div class="itemText" v-if="item.customerAddress">{{
-                item.customerAddress.sendType == 0
-                  ? '前台送修'
-                  : `快递寄送  ${item.customerAddress.sendTrackingNum}`
-              }}</div> -->
                 <div
                   class="itemText htmlText"
                   v-if="item.repairRegisterVo"
@@ -456,15 +442,16 @@
         },
       ];
       async function enterDialog() {
-        const style =
-          '@page {margin:0mm 10mm};' +
-          '@media print { .status{ overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }}'; //打印时去掉眉页眉尾
+        // const style = '@page { margin:0mm 10mm } .content_left{ width: calc(100% - 400px) !important} .content{width:100% !important} .content_right{width: 400px !important; float: right;}';
+        // const style =
+        //   '@page {margin:0mm 10mm;width:100%};' +
+        //   ' @media print { .status{ overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }} .content_left_info{ width: calc(100% - 400px) !important} .ant-descriptions{width: 400px !important}'; //打印时去掉眉页眉尾
         printJS({
           printable: 'print', // 标签元素id
           type: 'html',
           headerStyle: 'font-weight:400;text-align:center;',
           targetStyles: ['*'],
-          style,
+          // style: style,
         });
       }
       async function getData() {
@@ -736,6 +723,9 @@
       }
       &_left {
         width: calc(100% - 400px);
+        &_info {
+          // width: calc(100% - 400px);
+        }
       }
     }
     .bottom_but {
@@ -767,5 +757,33 @@
     .ant-image {
       margin-right: 10px;
     }
+    .content {
+      // .content {
+      width: 100%;
+      display: flex;
+      justify-content: space-between;
+
+      &_right {
+        width: 400px;
+        padding: 40px 0px 40px 20px;
+        .timeItem {
+          .status {
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+          }
+          .ant-image-img {
+            width: 100%;
+            height: 100%;
+          }
+        }
+      }
+      &_left {
+        width: calc(100% - 400px);
+        &_info {
+          // width: calc(100% - 400px);
+        }
+      }
+    }
   }
 </style>

+ 2 - 8
src/views/work/followedList.vue

@@ -63,18 +63,12 @@
               },
               {
                 label: '开票信息',
-                ifShow:
-                  getCheckPerm('work_mark') &&
-                  record.status > 80 &&
-                  record.warrantyType != 0 &&
-                  record.warrantyType != 3 &&
-                  record.payAmount != 0 &&
-                  record.invoiceStatus == 0,
+                ifShow: getCheckPerm('work_mark'),
                 onClick: handleInvoice.bind(null, record),
               },
               {
                 label: '签收',
-                ifShow: getCheckPerm('work_mark') && record.status == 110 && record.signFor == 0,
+                ifShow: getCheckPerm('work_mark') && record.status == 110 && record.isSignFor == 0,
                 onClick: handleSignFor.bind(null, record),
               },
             ]"

+ 9 - 4
src/views/work/invoiceModal.vue

@@ -28,7 +28,7 @@
     partInfo,
     partInfo,
     invoiceRegister,
-    repairOver,
+    getInvoiceInfo,
   } from '/@/api/spares';
   import { useI18n } from '/@/hooks/web/useI18n';
   import { uploadApi } from '/@/api/product/index';
@@ -284,13 +284,15 @@
         });
       }
 
-      function onDataReceive(data) {
+      async function onDataReceive(data) {
         resetFields();
         fileFlow.invoiceAmount = data.payAmount;
         fileFlow.repairId = data.repairId;
-        console.log('openOutModal', fileFlow, data);
+        let getData = await getInvoiceInfo({ repairId: data.repairId });
+        handleUpShow(true);
         setFieldsValue({
           ...data,
+          ...getData,
           invoiceHead: data.companyName,
           deviceType: t(`routes.scene.tableType.${data.cameraType}`) + ' ' + data.cameraSnCode,
         });
@@ -346,6 +348,9 @@
       };
       const handleSubmit = async () => {
         const params = await validate();
+        if (params.defineDamage == 0) {
+          return closeModal();
+        }
         try {
           createConfirm({
             iconType: 'warning',
@@ -353,7 +358,7 @@
             content: '确定要开具发票吗?',
             onOk: async () => {
               loading.value = true;
-              await invoiceRegister({...params,...fileFlow});
+              await invoiceRegister({ ...params, ...fileFlow });
               loading.value = false;
               createMessage.success(t('common.optSuccess'));
               closeModal();