Browse Source

修改问题

tangning 2 years ago
parent
commit
3b7f67fbf3

+ 31 - 0
README.md

@@ -167,3 +167,34 @@ If you think this project is helpful to you, you can help the author buy a cup o
 ## License
 
 [MIT © Vben-2020](./LICENSE)
+
+#**售后管理后台**
+
+###**v1.0.0** 
+~~~~
+
+~~~~
+
+
+###**v1.0.1** 
+~~~~
+详见文档
+1. /salePersonnel/saleOrderList  售后工程师工单列表
+    response 添加字段
+        warrantyDate        保修界满日期
+        warrantyType         0保内维修 ,1保内维修-人为损坏 = 保外 ,2保外维修
+2./salePersonnel/orderReceiving  售后工程师接单
+    request 删除必填参数
+        warrantyType
+        warrantyExpirationDate
+3./repairPersonnel/checkRegister  维修登记
+    request 添加必填参数
+        defineDamage    定损结论 0 非人为损坏,1人为损坏
+4./part/addOrUpdate  添加备件类型
+    request 添加必填参数
+        partPriceDiscount      备件折扣价格
+5./salePersonnel/addOrUpdatePriceList 维修报价
+    request 添加必填参数
+        discount        0没折扣,1有折扣
+6.添加状态 91取消维修备件回收
+~~~~

+ 12 - 11
src/locales/lang/zh-CN/routes/spares.ts

@@ -2,17 +2,18 @@ export default {
   tableType:{
     '-1':'全部',
     0:'待接单',
-    1:'待检测',
-    2:'待报价',
-    3:'待确认',
-    4:'已取消',
-    5:'待备料',
-    6:'维修中',
-    7:'待回收',
-    8:'待测试',
-    9:'待支付',
-    10:'待发货',
-    11:'已发货',
+    10:'待检测',
+    20:'待报价',
+    30:'待确认',
+    40:'已取消',
+    50:'待备料',
+    60:'维修中',
+    70:'待回收',
+    90:'待测试',
+    91:'取消维修',
+    // 9:'待支付',
+    100:'待发货',
+    110:'已发货',
     12:'已评价',
     13:'待评价',
     21:'待跟进',

+ 44 - 0
src/views/spares/spareModal.vue

@@ -111,6 +111,46 @@
             colProps: {
               span: 18,
             },
+          },{
+            field: 'discount',
+            label: '折扣',
+            component: 'Select',
+            required: true,
+            defaultValue: 0,
+            componentProps: {
+              options: [
+                {
+                  label: '有折扣',
+                  value: 1,
+                },{
+                  label: '无折扣',
+                  value: 0,
+                }
+              ],
+              onChange:(value)=>{
+                updateSchema({
+                  field: 'partPriceDiscount',
+                  ifShow: value == 1,
+                });
+              }
+            },
+            colProps: {
+              span: 18,
+            },
+          },{
+            field: 'partPriceDiscount',
+            component: 'InputNumber',
+            label: '折扣价(元)',
+            required: true,
+            ifShow: false,
+            componentProps:{
+              maxLength: 50,
+              precision:2,
+              min:0.01,
+            },
+            colProps: {
+              span: 18,
+            },
           },
           {
             field: 'partId',
@@ -141,6 +181,10 @@
           setFieldsValue(data)
           fileFlow.title ='编辑备件类型'
         }
+        updateSchema({
+            field: 'partPriceDiscount',
+            ifShow: data.isDiscount == 1,
+        });
         fileFlow.type = data.type
       }
       const handleSubmit = async () => {

+ 70 - 32
src/views/work/checkModel.vue

@@ -1,27 +1,32 @@
 <template>
-  <BasicModal
-    v-bind="$attrs"
-    @register="register"
-    title="检测登记"
-    width="700px"
-    @cancel="clearInfo"
-    :confirmLoading="loading"
-    @ok="handleSubmit"
-  >
-    <div class="pt-2px pr-3px">
-      <BasicForm @register="registerForm">
-        <template #text="{ model, field }">
-          {{ model[field] }}
-        </template>
-        <template #add>
-          <Button @click="add">添加备件</Button>
-        </template>
-        <template #del="{ field }">
-          <Button @click="del(field)">删除</Button>
-        </template>
-      </BasicForm>
-    </div>
-  </BasicModal>
+    <BasicModal 
+      v-bind="$attrs"
+      @register="register"
+      title="检测登记"
+      width="700px"
+      @cancel="clearInfo"
+      :confirmLoading="loading"
+      @ok="handleSubmit"
+    >
+      <div class="pt-2px pr-3px myRadioGroup">
+        <BasicForm @register="registerForm">
+          <template #text="{ model, field }">
+            {{ model[field] }}
+          </template>
+          <template #add>
+            <Button @click="add">添加备件</Button>
+          </template>
+          <template #del="{ field }">
+            <Button @click="del(field)">删除</Button>
+          </template>
+        </BasicForm>
+        <div class="tips" style="padding:0 100px">
+          <p>说明</p>
+          <p>1、保内维修,直接进入待备料或维修中</p>
+          <p>2、保外维修,由售后人员进行报价确认后再备料维修</p>
+        </div>
+      </div>
+    </BasicModal>
 </template>
 <script lang="ts">
 import { defineComponent, h, onMounted, reactive, ref } from 'vue';
@@ -69,6 +74,12 @@ export default defineComponent({
         },
       },
       {
+        field: 'warrantyExpirationDateText',
+        component: 'Input',
+        slot: 'text',
+        label: '保修届满日期',
+      },
+      {
         field: 'faultIds',
         component: 'CheckboxGroup',
         label: '故障类型',
@@ -80,6 +91,28 @@ export default defineComponent({
         colProps: {
           span: 18,
         },
+      },        
+      {
+        field: 'defineDamage',
+        component: 'RadioGroup',
+        label: '定损结论',
+        helpMessage:'保修期内人为损坏将转为保修外',
+        defaultValue: 0,
+        componentProps: {
+          options: [
+            {
+              label: '非人为损坏',
+              value: 0,
+            },
+            {
+              label: '人为损坏',
+              value: 1,
+            },
+          ],
+        },
+        colProps: {
+          span: 22,
+        },
       },
       {
         field: 'checkResult',
@@ -105,16 +138,9 @@ export default defineComponent({
         },
         componentProps: {
           api: uploadApi,
-          // fileFlow:true,
           maxNumber: 5,
           maxSize: 1000,
           accept: ['jpeg', 'jpg', 'png'],
-          // afterFetch: function (data) {
-          //   console.log('url',data)
-          //   // Reflect.set(data, 'url', data.file);
-          //   fileFlow.file = data.file
-          //   return data;
-          // },
         },
 
         colProps: {
@@ -169,16 +195,20 @@ export default defineComponent({
 
     function onDataReceive(data) {
       resetFields();
-      updateSchema({
+      updateSchema([{
         field: 'faultIds',
         componentProps: {
           options: fileFlow.faultList,
         },
-      });
+      },{
+        field: 'damage',
+        ifShow: data.warrantyType == 0,
+      }]);
       fileFlow.type = data.type;
       fileFlow.cameraType = data.cameraType;
       setFieldsValue({
         ...data,
+        warrantyExpirationDateText: `${data.warrantyDate} (${data.warrantyType==0?'保内保修':data.warrantyType==1?'保内转保外':'保外维修'})`,
         deviceInfo: t(`routes.scene.tableType.${data.cameraType}`) + data.cameraSnCode,
       });
     }
@@ -304,3 +334,11 @@ export default defineComponent({
   },
 });
 </script>
+<style lang="less">
+.myRadioGroup{
+  .ant-checkbox-group{
+    overflow-y: auto;
+    height: 90px;
+  }
+}
+</style>

+ 5 - 5
src/views/work/followedList.vue

@@ -28,27 +28,27 @@
             },
             {
               label: '报价',
-              ifShow:getCheckPerm('work_quotedPrice') && record.status == 2,
+              ifShow:getCheckPerm('work_quotedPrice') && record.status == 20,
               onClick: handleQuote.bind(null, record),
             },
             {
               label: '修改报价',
-              ifShow:getCheckPerm('work_setPrice') && record.status == 3,
+              ifShow:getCheckPerm('work_setPrice') && record.status == 30,
               onClick: handleQuote.bind(null, record),
             },
             {
               label: '确认报价',
-              ifShow:getCheckPerm('work_confirmPrice') && record.status == 3 && record.receiverType == 0,
+              ifShow:getCheckPerm('work_confirmPrice') && record.status == 30 && record.receiverType == 0,
               onClick: handleConfirmPrice.bind(null, record),
             },
             {
               label: '付款登记',
-              ifShow:getCheckPerm('work_payments') && record.status == 9,
+              ifShow:getCheckPerm('work_payments') && record.status == 90,
               onClick: handlePayLog.bind(null, record),
             },
             {
               label: '发货登记',
-              ifShow:getCheckPerm('work_dispatched') && record.status == 10,
+              ifShow:getCheckPerm('work_dispatched') && record.status == 100,
               onClick: handleDelivery.bind(null, record),
             },
             {

+ 1 - 1
src/views/work/maintenance.vue

@@ -2,7 +2,7 @@
   <PageWrapper contentBackground>
     <template #footer>
       <a-tabs v-model:activeKey="tableType" @change="changeTable">
-        <a-tab-pane :key="0" :tab="t('routes.spares.tableType.1')" />
+        <a-tab-pane :key="0" :tab="t('routes.spares.tableType.10')" />
         <a-tab-pane :key="1" :tab="t('routes.spares.tableType.21')" />
         <a-tab-pane :key="2" :tab="t('routes.spares.tableType.22')" />
       </a-tabs></template

+ 72 - 17
src/views/work/quoteModel.vue

@@ -15,7 +15,7 @@
         </template>
         <template #add>
           <div>
-            <Button  @click="add" style="margin-left:20px">添加人工</Button>
+            <!-- <Button  @click="add" style="margin-left:20px">添加人工</Button> -->
             <Button  @click="updataRepairInfo" style="margin-left:20px">重置</Button>
           </div>
         </template> 
@@ -25,10 +25,16 @@
         <template #delList="{ field }">
           <Button @click="del(field)">删除</Button>
         </template>
+        <template #discount="{ model, field }">
+          <Checkbox v-model:checked="model[field]">
+            折扣
+          </Checkbox>
+        </template>
       </BasicForm>
       <div class="priceCount">
         <span>合计:</span>
         <div class="label">总价:{{ fileFlow.priceCount || 0 }}元 <Button :preIcon="'outline-refresh'"  @click="updataCount"><RedoOutlined /></Button></div>
+        <p>注:提交报价后,需等待报修人确认后再进行维修</p>
       </div>
     </div>
   </BasicModal>
@@ -39,12 +45,13 @@
   import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
   import { useMessage } from '/@/hooks/web/useMessage';
   import { getPriceList, checkRegisterInfo, addOrUpdatePriceList, allList } from '/@/api/spares'
+  import { Checkbox } from 'ant-design-vue';
   import { useI18n } from '/@/hooks/web/useI18n';
   import { uploadApi } from '/@/api/product/index';
   import { RedoOutlined, } from '@ant-design/icons-vue';
   const { t } = useI18n();
   export default defineComponent({
-    components: { BasicModal, BasicForm, RedoOutlined },
+    components: { BasicModal, BasicForm, RedoOutlined, Checkbox },
     props: {
       userData: { type: Object },
     },
@@ -57,7 +64,8 @@
         count:1,//第一次报价
         priceCount:0,//总价
         priceLists:[],
-        priceListsPrice:{}
+        priceListsPrice:{},
+        manMadeList:[],
       })
       const loading = ref(false)
       const { createMessage,createConfirm } = useMessage();
@@ -85,6 +93,11 @@
               span: 18,
             },
           },{
+            field: 'warrantyExpirationDateText',
+            component: 'Input',
+            slot: 'text',
+            label: '保修届满日期',
+          },{
             field: 'checkResult',
             component: 'Input',
             label: '检测结果',
@@ -101,6 +114,18 @@
               span: 24,
             },
             slot: 'add',
+          },{
+            field: 'manMade',
+            component: 'CheckboxGroup',
+            label: '人工费',
+            labelWidth:0,
+            componentProps: {
+              options: fileFlow.manMadeList,
+              maxLength: 50,
+            },
+            colProps: {
+              span: 24,
+            },
           },
       ];
 
@@ -118,6 +143,11 @@
         console.log('allList',allListOption)
         fileFlow.priceListsPrice
         allListOption.map(ele => {
+          fileFlow.manMadeList.push({
+            ...ele,
+            label: `${ele.name} ${ele.price}元`,
+            value: ele.laborCostId,
+          })
           fileFlow.priceListsPrice[ele.laborCostId] = ele.price
         })
       });
@@ -143,6 +173,7 @@
         fileFlow.type = data.type
         setFieldsValue({
           ...data,
+          warrantyExpirationDateText: `${data.warrantyDate} (${data.warrantyType==0?'保内保修':data.warrantyType==1?'保内转保外':'保外维修'})`,
           deviceInfo:t(`routes.scene.tableType.${data.cameraType}`)+data.cameraSnCode
         });
       }
@@ -160,19 +191,39 @@
       function addPriceItem(list){
         fileFlow.priceLists = list.reverse()
         let priceSchema = [],valueObj = {},count=0
-        list.map(ele => {
+        list.map((ele,index) => {
           valueObj[`priceList${ele.priceListId}`] = ele.count || 0
           valueObj[`priceListText${ele.priceListId}`] = `${ele.name} ${ele.price} 元/次`
           count = count + ele.count*ele.price
           priceSchema.unshift({
             field: 'priceListText' + ele.priceListId,
             component: 'InputNumber',
-            label: ele.type == 0?'备件':'人工',
+            label: index+1,
+            labelWidth:20,
             slot: 'text',
             // labelWidth:300,
             // subLabel:"数量",
             colProps: {
-              span: 12,
+              span: 8,
+            }
+          },{
+            field: 'discount' + ele.priceListId,
+            component: 'CheckboxGroup',
+            // label: '',
+            // labelWidth:0,
+            // labelWidth:300,
+            // subLabel:"数量",
+            slot: 'discount',
+            componentProps: {
+              options: [
+              {
+                label: `折扣价${ele.priceListId}`,
+                value: 0,
+              },
+            ]
+            },
+            colProps: {
+              span: 4,
             }
           },{
             field: 'priceList' + ele.priceListId,
@@ -180,6 +231,7 @@
             // suffix:'数量',
             component: 'InputNumber',
             defaultValue:ele.count || 0,
+            labelWidth:50,
             // labelWidth:300,
             // subLabel:"数量",
             colProps: {
@@ -266,14 +318,16 @@
           onOk: async () => {
             loading.value = true
             let priceListsparams = []
-            console.log('addOrUpdatePriceList',params,fileFlow.priceLists) 
+            console.log('params',params) 
             fileFlow.priceLists.map(ele => {
+              let discount = params[`discount${ele.priceListId}`]?'1':'0';
               priceListsparams.push({
                 priceListId:ele.priceListId,
                 type:ele.type,
                 laborId:ele.laborId,
                 partId:ele.partId,
-                count:params[`priceList${ele.priceListId}`]
+                discount,
+                count:params[`priceList${ele.priceListId}`],
               })
             })
             for (let index = 1; index < n.value; index++) {
@@ -287,16 +341,17 @@
                 })
               }
             }
-            let res = await addOrUpdatePriceList({
-              repairId:params.repairId,
-              priceLists:priceListsparams,
-            })
-            console.log('res',res)
-            createMessage.success(t('common.optSuccess'));
-            closeModal();
-            emit('update');
+            console.log('addOrUpdatePriceList',params,priceListsparams) 
+            // let res = await addOrUpdatePriceList({
+            //   repairId:params.repairId,
+            //   priceLists:priceListsparams,
+            // })
+            // console.log('res',res)
+            // createMessage.success(t('common.optSuccess'));
+            // closeModal();
+            // emit('update');
             loading.value = false
-            clearInfo()
+            // clearInfo()
           },
           onCancel: () => {
             loading.value = false

+ 34 - 27
src/views/work/takingOrdersModel.vue

@@ -50,6 +50,12 @@ export default defineComponent({
         label: '设备信息',
       },
       {
+        field: 'warrantyExpirationDateText',
+        component: 'Input',
+        slot: 'text',
+        label: '保修届满日期',
+      },
+      {
         field: 'cameraFaultInfo',
         component: 'InputTextArea',
         label: '机器外观',
@@ -60,7 +66,7 @@ export default defineComponent({
           placeholder: '请描述检测后的具体故障情况。',
         },
         colProps: {
-          span: 18,
+          span: 24,
         },
       },
       {
@@ -81,32 +87,32 @@ export default defineComponent({
         colProps: {
           span: 12,
         },
-      },{
-        field: 'warrantyType',
-        component: 'RadioGroup',
-        required: true,
-        label: '保修类型',
-        defaultValue:1,
-        componentProps: {
-          placeholder: '请填写姓名',
-          options:[
-            { label: '保修期内', value: 0 },
-            { label: '保修期外', value: 1 },
-            { label: '非保修项目', value: 2 },
-          ],
-        },
-      },
-      {
-        field: 'warrantyExpirationDate',
-        component: 'DatePicker',
-        label: '保修届满日期',
-        required: true,
-        colProps: {
-          span: 18,
-        },   
-        componentProps: {
-          valueFormat: 'YYYY-MM-DD',
-        },  
+      // },{
+      //   field: 'warrantyType',
+      //   component: 'RadioGroup',
+      //   required: true,
+      //   label: '保修类型',
+      //   defaultValue:1,
+      //   componentProps: {
+      //     placeholder: '请填写姓名',
+      //     options:[
+      //       { label: '保修期内', value: 0 },
+      //       { label: '保修期外', value: 1 },
+      //       { label: '非保修项目', value: 2 },
+      //     ],
+      //   },
+      // },
+      // {
+      //   field: 'warrantyExpirationDate',
+      //   component: 'DatePicker',
+      //   label: '保修届满日期',
+      //   required: true,
+      //   colProps: {
+      //     span: 18,
+      //   },   
+      //   componentProps: {
+      //     valueFormat: 'YYYY-MM-DD',
+      //   },  
       },{
           field: 'repairManId',
           label: '维修工程师',
@@ -184,6 +190,7 @@ export default defineComponent({
       resetFields();
       setFieldsValue({
         ...data,
+        warrantyExpirationDateText: `${data.warrantyDate} (${data.warrantyType==0?'保内保修':data.warrantyType==1?'保内转保外':'保外维修'})`,
         deviceType:t(`routes.scene.tableType.${data.cameraType || 0}`) +' '+ data.cameraSnCode
       });
     }