tangning пре 2 месеци
родитељ
комит
7d69349069

+ 24 - 24
src/views/work/checkModel.vue

@@ -80,30 +80,30 @@
           slot: 'text',
           label: '保修届满日期',
         },
-        {
-          field: 'faultIds',
-          component: 'ApiCascader',
-          required: true,
-          label: '故障类型',
-          componentProps: ({ formModel }) => {
-            return {
-              placeholder: '请选择维修物品',
-              api: async function () {
-                return await faultTree('V2');
-              },
-              labelField: 'faultMsg',
-              valueField: 'faultId',
-              immediate: true,
-              multiple: true,
-              isLeaf: (val) => {
-                return !val.children;
-              },
-            };
-          },
-          colProps: {
-            span: 12,
-          },
-        },
+        // {
+        //   field: 'faultIds',
+        //   component: 'ApiCascader',
+        //   required: true,
+        //   label: '故障类型',
+        //   componentProps: ({ formModel }) => {
+        //     return {
+        //       placeholder: '请选择维修物品',
+        //       api: async function () {
+        //         return await faultTree('V2');
+        //       },
+        //       labelField: 'faultMsg',
+        //       valueField: 'faultId',
+        //       immediate: true,
+        //       multiple: true,
+        //       isLeaf: (val) => {
+        //         return !val.children;
+        //       },
+        //     };
+        //   },
+        //   colProps: {
+        //     span: 12,
+        //   },
+        // },
         // {
         //   field: 'faultIds',
         //   component: 'ApiCascader',

+ 8 - 1
src/views/work/recoveryModal.vue

@@ -146,7 +146,14 @@
                 return !val.children;
               },
               onChange: (keys, args) => {
-                console.log('onChange', keys, args, arguments);
+                let isSn = keys.some((item) => item && item[0] == 6);
+                updateSchema([
+                  {
+                    field: 'cameraSnCode',
+                    required: isSn,
+                  },
+                ]);
+                console.log('onChange', keys, args, isSn);
               }
             };
           },

+ 14 - 0
src/views/work/signForModel.vue

@@ -10,6 +10,7 @@
       <BasicForm @register="registerForm">
         <template #text="{ model, field }"> {{ model[field] }}{{ fileFlow.type }} </template>
       </BasicForm>
+      <a-button style="margin-left: 120px" type="primary" @click="handleLine"> 线上签收</a-button>
     </div>
   </BasicModal>
 </template>
@@ -21,6 +22,7 @@
   import { signFor } from '/@/api/spares/index';
   import { useI18n } from '/@/hooks/web/useI18n';
   import { uploadApi } from '/@/api/product/index';
+  import { copyTextToClipboard } from '/@/hooks/web/useCopyToClipboard';
 
   const { t } = useI18n();
   export default defineComponent({
@@ -33,6 +35,7 @@
       const { createMessage, createConfirm } = useMessage();
       const fileFlow = reactive({
         file: null,
+        repairId: '',
         type: 2, //2-普通发票,3-专用发票
       });
       const okText = ref('发送');
@@ -96,6 +99,7 @@
       function onDataReceive(data) {
         resetFields();
         fileFlow.type = data.type;
+        fileFlow.repairId = data.repairId;
         setFieldsValue({
           ...data,
           deviceInfo: t(`routes.scene.tableType.${data.cameraType}`) + data.cameraSnCode,
@@ -126,6 +130,15 @@
       function handleVisibleChange(v) {
         v && props.userData && nextTick(() => onDataReceive(props.userData));
       }
+      function handleLine() {
+        let host = window.location.host;
+        if(host == 'v4-uat.4dkankan.com'){
+          host = 'test.4dkankan.com';
+        }
+        let str = `http://${host}/#/signature/${fileFlow.repairId}`;
+        copyTextToClipboard(str);
+        createMessage.success('复制成功');
+      }
       return {
         register,
         registerForm,
@@ -135,6 +148,7 @@
         addListFunc,
         resetFields,
         okText,
+        handleLine,
         t,
       };
     },

+ 29 - 7
src/views/work/takingOrdersModel.vue

@@ -30,7 +30,9 @@
     },
     emits: ['update'],
     setup(_, { emit }) {
-      const modelRef = ref({});
+      const modelRef = ref({
+        cameraType: 4,
+      });
       const schemas: FormSchema[] = [
         {
           field: 'repairId',
@@ -226,6 +228,7 @@
       });
 
       function onDataReceive(data) {
+        console.log('onDataReceive', data);
         modelRef.value = data;
         resetFields();
         setFieldsValue({
@@ -234,10 +237,24 @@
             data.warrantyDate + '(' + t(`routes.spares.warrantyType.${data.warrantyType}`) + ')',
           deviceType: t(`routes.scene.tableType.${data.cameraType}`) + ' ' + data.cameraSnCode,
         });
-        updateSchema({
-          field: 'convertWarranty',
-          ifShow: data.warrantyType == 2 || data.warrantyType == 1,
-        });
+        updateSchema([
+          {
+            field: 'convertWarranty',
+            ifShow: data.warrantyType == 2 || data.warrantyType == 1,
+          },
+          {
+            field: 'repairManId',
+            label: data.cameraType == 4 ? '经手人' : '维修工程师',
+          },
+          {
+            field: 'supplyAdminId',
+            ifShow: data.cameraType != 4,
+          },
+          {
+            field: 'testerId',
+            ifShow: data.cameraType != 4,
+          },
+        ]);
       }
 
       const handleSubmit = async () => {
@@ -247,10 +264,15 @@
         //   content: '删除设备后需要重新入库<br/>确定删除吗?',
         //   onOk: async () => {
         const params = await validate();
-        const res = await orderReceiving({
+        let apiData = {
           ...params,
           convertWarranty: params.convertWarranty ? 1 : 0,
-        });
+        };
+        if (modelRef.value.cameraType == 4) {
+          apiData.testerId = params.repairManId;
+          apiData.supplyAdminId = params.repairManId;
+        }
+        const res = await orderReceiving(apiData);
         console.log('validate', params, res);
         createMessage.success(t('common.optSuccess'));
         closeModal();