Explorar o código

售后管理服务禅道bug修复

8521520123jsy hai 1 ano
pai
achega
c303a5b957

+ 13 - 1
src/api/salesServiceManagement/index.js

@@ -357,6 +357,18 @@ export async function recycleSave(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+// 配件回收记录 表格 修改
+export async function recycleUpdate(data) {
+  const res = await request.put('/eom/afterSalesAccessoryApply/update',
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
 // 配件回收记录 表格 详情
 export async function recycleDetails(id) {
   const res = await request.get(`/eom/afterSalesAccessoryApply/getById/${id}`);
@@ -375,4 +387,4 @@ export async function recycleDelete(data) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+}

+ 12 - 10
src/views/salesServiceManagement/accessory/components/accessoryDialog.vue

@@ -64,21 +64,22 @@
         <el-col :span="6">
           <el-form-item
             label="领用人"
-            prop="recipientId"
+            prop="recipientName"
             :rules="{
               required: true,
               message: '请输入领用人',
               trigger: 'change'
             }"
           >
-            <el-select style="width: 100%;" v-model="form.recipientId" disabled placeholder="请选择">
+          <el-input v-model="form.recipientName" disabled />
+            <!-- <el-select style="width: 100%;" v-model="form.recipientName" disabled placeholder="请选择">
               <el-option
                 v-for="item in loginChangeRoleVOList"
                 :key="item.roleId"
                 :label="item.roleName"
                 :value="item.roleId"
               ></el-option>
-            </el-select>
+            </el-select> -->
           </el-form-item>
         </el-col>
       </el-row>
@@ -165,7 +166,6 @@ import {
   accessorySave,
   accessoryUpdate
 } from '@/api/salesServiceManagement/index';
-import { getCurrentUser } from '@/utils/token-util';
 
 export default {
   data() {
@@ -188,7 +188,7 @@ export default {
   },
   methods: {
     init(row, type) {
-      let currentUser = getCurrentUser()
+      let currentUser = JSON.parse(sessionStorage['currentUser']);
       this.form.receivingDeptId = currentUser.currentGroupId; // 部门id
       this.roleVOListData();
       this.addRepairNotesDialog = true;
@@ -198,11 +198,13 @@ export default {
         this.getDetail(row);
       } else {
         this.form.recipientId = currentUser.currentRoleId; // 领用人Id
+        console.log(currentUser.currentRoleId,'currentUser.currentRoleId')
         // 下拉数据 name 赋值
         this.echoData();
       }
     },
-    getDetail(row) {
+    getDetail(data) {
+      const row = JSON.parse(JSON.stringify(data));
       const params = { groupId: row.useDeptId };
       this.getUserList(params);
       this.$set(this.form, 'code', row.code);
@@ -214,8 +216,8 @@ export default {
       this.$set(this.form, 'userId', row.userId);
       this.$set(this.form, 'purpose', row.purpose);
       this.form.id = row.id;
+      this.$set(this.form, 'recipientName', row.recipientName);
       this.form.receivingDeptName = row.receivingDeptName;
-      this.form.recipientName = row.recipientName;
       this.form.useDeptName = row.useDeptName;
       this.form.userName = row.userName;
       this.form.repairId = row.repairId;
@@ -230,7 +232,7 @@ export default {
         (item) => item.roleId === this.form.recipientId
       );
       this.form.receivingDeptName = depObj.groupName;
-      this.form.recipientName = roleObj.roleName;
+      this.$set(this.form,'recipientName',roleObj.roleName)
     },
     // 选择工单
     handHead() {
@@ -311,10 +313,10 @@ export default {
       });
     },
     handleClose() {
-      this.addRepairNotesDialog = false;
       this.form = {};
-      this.$refs.accessoryFormRef.resetFields();
       this.detailList = [];
+      this.$refs.accessoryFormRef.resetFields();
+      this.addRepairNotesDialog = false;
     }
   }
 };

+ 46 - 13
src/views/salesServiceManagement/accessory/components/spareInfo.vue

@@ -9,9 +9,13 @@
       height="30vh"
       :needPage="false"
     >
-      <template v-slot:toolbar v-if="types != 'view'">
-        <div class="add-product" @click="addEquipment">
-          <i class="el-icon-circle-plus-outline"></i>
+      <!--  <template v-slot:toolbar v-if="types != 'view'"> *** -->
+      <template v-slot:toolbar>
+        <div class="toobar" :class="types != 'view'?'':'toobar_r'">
+          <div v-if="types != 'view'" class="add-product" @click="addEquipment">
+            <i class="el-icon-circle-plus-outline"></i>
+          </div>
+          <div class="total_price">总计: {{ totalPrice }} (元)</div>
         </div>
       </template>
 
@@ -20,7 +24,7 @@
           type="number"
           placeholder="请输入"
           v-model="row.totalCount"
-          @input="handleInput(row, $index)"
+          @input="handleInput(row, $index,'totalCount')"
           min="0"
           :disabled="types == 'view'"
         />
@@ -30,7 +34,7 @@
           type="number"
           placeholder="请输入"
           v-model="row.singlePrice"
-          @input="handleInput(row, $index)"
+          @input="handleInput(row, $index,'singlePrice')"
           min="0"
           :disabled="types == 'view'"
         />
@@ -76,7 +80,8 @@ export default {
   watch: {
     detailList: {
       handler(newVal) {
-        this.tableList = newVal;
+        this.tableList = JSON.parse(JSON.stringify(newVal));;
+        this.calculatePrice();
       },
       immediate: true
     }
@@ -167,15 +172,21 @@ export default {
           showOverflowTooltip: true,
           show: this.types != 'view'
         }
-      ]
+      ],
+      totalPrice: 0 // 总计
     };
   },
   mounted() {
-    this.tableList = this.detailList;
+    this.tableList = JSON.parse(JSON.stringify(this.detailList));
   },
   methods: {
-    // 出库数量限制
-    handleInput(row, index) {
+    // 出库数量限制 totalPrice
+    handleInput(row, index ,name) {
+      row[name] = row[name].replace(/[^\d]/g, '').replace(/^0+/, '') || '0';
+      if (!row.singlePrice || !row.totalCount) {
+        this.$set(this.tableList[index], 'totalPrice', 0);
+        return;
+      }
       if (row.singlePrice == 0) {
         this.$set(this.tableList[index], 'totalPrice', 0);
       } else {
@@ -185,10 +196,16 @@ export default {
           Number(row.singlePrice) * Number(row.totalCount)
         );
       }
+      // 计算汇总价格 ***
+      this.calculatePrice();
+    },
+    // 计算汇总价格 ***
+    calculatePrice() {
+      let totlal = 0;
+      this.tableList.map((el) => (totlal += el.totalPrice || 0));
+      this.totalPrice = totlal;
     },
     del(id, index) {
-      console.log(index,'index')
-      console.log(this.tableList, 'this.tableList');
       // this.tableList = this.tableList.filter((item) => item.id != id);
       this.tableList.splice(index, 1);
     },
@@ -222,7 +239,7 @@ export default {
 
 <style lang="scss" scoped>
 .add-product {
-  width: 100%;
+  // width: 70%;
   display: flex;
   align-items: center;
   // justify-content: flex-end;
@@ -231,4 +248,20 @@ export default {
   margin: 10px 0;
   cursor: pointer;
 }
+
+.toobar {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding-right: 16px;
+
+  .total_price {
+    margin-left: 24px;
+    min-width: 50px;
+  }
+}
+
+.toobar_r {
+  justify-content: flex-end;
+}
 </style>

+ 1 - 2
src/views/salesServiceManagement/accessory/index.vue

@@ -24,7 +24,7 @@
           <el-link type="primary" :underline="false" @click="openEdit(row, 'view')">{{ row.code }}</el-link>
         </template>
         <template v-slot:action="{ row }">
-          <!-- <el-link type="primary" :underline="false" @click="openEdit(row, 'edit')">修改</el-link> -->
+          <el-link type="primary" v-if="row.source == 0" :underline="false" @click="openEdit(row, 'edit')">修改</el-link>
           <el-popconfirm
             v-if="row.source == 0"
             class="ele-action"
@@ -35,7 +35,6 @@
               <el-link type="danger" :underline="false" icon="el-icon-delete">删除</el-link>
             </template>
           </el-popconfirm>
-          <!-- <el-link type="primary" :underline="false" @click="openEdit(row, 'view')">详情</el-link> -->
         </template>
       </ele-pro-table>
     </el-card>

+ 12 - 4
src/views/salesServiceManagement/components/info.vue

@@ -767,6 +767,7 @@ export default {
   created() {},
   methods: {
     async init(res) {
+      console.log(res, 'res 000');
       this.$set(this.form, 'tableList', res.productDetail);
       this.$set(this.form, 'orderCode', res.orderCode);
       this.$set(this.form, 'orderId', res.orderId);
@@ -808,9 +809,7 @@ export default {
       if (other.address) {
         addressName += other.address;
       }
-
       this.$set(this.form, 'contractInfo', base);
-
       if (type != 'init') {
         this.$set(this.form, 'contactAddress', addressName);
         this.$set(
@@ -823,8 +822,12 @@ export default {
             return item;
           })
         );
+
+        // 清空发货单的数据 *** 初次进来不清空
+        this.$set(this.form, 'orderCode', '');
+        this.$set(this.form, 'orderId', '');
+        this.$set(this.form, 'tableList', []);
       }
-      // this.contractInfo = base;
     },
     //发货单选择
     invoiceDialogOpen() {
@@ -833,7 +836,12 @@ export default {
         return;
       }
       if (this.type != 'view') {
-        this.$refs.invoiceDialogRef.open(this.form.contractInfo.id);
+        let obj = {
+          tableList: this.form.tableList || [],
+          orderCode: this.form.orderCode || '',
+          orderId: this.form.orderId || ''
+        };
+        this.$refs.invoiceDialogRef.open(this.form.contractInfo.id, obj);
       }
     },
     //发货单回调

+ 14 - 4
src/views/salesServiceManagement/components/invoiceDialog.vue

@@ -240,15 +240,24 @@ export default {
   created() {},
   methods: {
     // 初始化数据(父组件调用)
-    open(data) {
+    open(data, obj) {
       this.contactId = data;
       this.addRepairNotesDialog = true;
-      this.contractId = data.contractId;
-      this.rowClickData.id = data.orderId;
-      this.rowClickData.docNo = data.orderCode;
+      // this.contractId = data.contractId;
+      // this.rowClickData.id = data.orderId;
+      // this.rowClickData.docNo = data.orderCode;
+      // 数据回显 ***
+      this.rowClickData.id = obj.orderId;
+      this.rowClickData.docNo = obj.orderCode;
+      this.packingList = JSON.parse(JSON.stringify(obj.tableList));
+      
       this.$nextTick(() => {
+        this.packingList.forEach((row) => {
+          this.$refs.tableRef3.toggleRowSelection(row);
+        });
         this.reload();
       });
+      console.log(this.selection, 'this.selection 开始');
     },
 
     datasource({ page, limit, where, order }) {
@@ -283,6 +292,7 @@ export default {
       this.addRepairNotesDialog = false;
     },
     submitAdd() {
+      console.log(this.selection, 'this.selection 确定');
       if (!this.selection.length) {
         return this.$message.warning('请至少选择一条数据');
       }

+ 4 - 4
src/views/salesServiceManagement/components/sparePartsList.vue

@@ -125,10 +125,9 @@
           >
             <el-input
               v-model="scope.row.totalCount"
-              @input="totalCountChange(scope.$index)"
+              @input="totalCountChange(scope.$index,scope.row,'totalCount')"
               :disabled="type == 'view' || scope.row.isApply == 1"
               type="number"
-              oninput="if(value){value=value.replace(/[^\d]/g,'')} if(value<=0){value=''} if(value>999999999){value=999999999}"
               :min="1"
             ></el-input>
           </el-form-item>
@@ -157,7 +156,7 @@
           >
             <el-input
               v-model="scope.row.singlePrice"
-              @input="totalCountChange(scope.$index)"
+              @input="totalCountChange(scope.$index,scope.row,'singlePrice')"
               :disabled="type == 'view'"
               type="number"
               :min="0"
@@ -569,7 +568,8 @@ export default {
       // ***
       this.calculatePrice();
     },
-    totalCountChange(index) {
+    totalCountChange(index,data,name) {
+      data[name] = data[name].replace(/[^\d]/g, '').replace(/^0+/, '') || '0';
       let row = this.form.tableList[index];
       if (row.totalCount && row.singlePrice) {
         row.settlementPrice = row.totalCount * row.singlePrice;

+ 41 - 55
src/views/salesServiceManagement/evaluate/components/search.vue

@@ -1,71 +1,57 @@
 <!-- 搜索表单 -->
 <template>
-  <el-form label-width="100px" class="ele-form-search" @keyup.enter.native="search" @submit.native.prevent>
-    <el-row :gutter="24">
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="编码:">
-          <el-input clearable v-model="where.code" placeholder="请输入" />
-        </el-form-item>
-      </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="工单编码:">
-          <el-input clearable v-model="where.workCode" placeholder="请输入" />
-        </el-form-item>
-      </el-col>
-      <el-col class="ele-form-actions" v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-button type="primary" icon="el-icon-search" class="ele-btn-icon" @click="search" size="small">
-          查询
-        </el-button>
-        <el-button @click="reset" icon="el-icon-refresh-left" size="small" type="primary">重置</el-button>
-      </el-col>
-    </el-row>
-  </el-form>
+  <seekPage :seekList="seekList" :formLength="4" @search="search"></seekPage>
 </template>
-
 <script>
 export default {
-  components: {},
   data() {
-    // 默认表单数据
-    const defaultWhere = {
-      code: '',
-      workCode: '',
-    };
-    return {
-      // 表单数据
-      where: { ...defaultWhere },
-    };
+    return {};
   },
+  props: {},
   computed: {
-    // 是否开启响应式布局
-    styleResponsive() {
-      return this.$store.state.theme.styleResponsive;
+    // 表格列配置
+    seekList() {
+      return [
+        {
+          label: '编码:',
+          value: 'code',
+          type: 'input',
+          placeholder: ''
+        },
+        {
+          label: '工单编码:',
+          value: 'workCode',
+          type: 'input',
+          placeholder: ''
+        },
+        {
+          label: '客户名称:',
+          value: 'contactName',
+          type: 'input',
+          placeholder: ''
+        },
+        {
+          label: '客户编码:',
+          value: 'contactCode',
+          type: 'input',
+          placeholder: ''
+        },
+        {
+          label: '创建人:',
+          value: 'createUserName',
+          type: 'input',
+          placeholder: ''
+        }
+      ];
     }
   },
-  created() { },
   methods: {
     /* 搜索 */
-    search() {
-      this.$emit('search');
-    },
-    /*  重置 */
-    reset() {
-      this.where = { ...this.defaultWhere };
-      this.search();
+    search(e) {
+      this.$emit('search', {
+        ...e
+      });
     }
   }
 };
 </script>
-<style lang="scss" scoped>
-.ele-form-actions {
-  // display: flex;
-  // align-items: center;
-  // justify-content: flex-end;
-}
-
-::v-deep {
-  .el-range-editor--medium.el-input__inner {
-    width: 100%;
-  }
-}
-</style>

+ 13 - 1
src/views/salesServiceManagement/evaluate/index.vue

@@ -22,7 +22,7 @@
           </el-link>
         </template>-->
         <!-- 操作列 -->
-        <template v-slot:action="{ row }"></template>
+        <!-- <template v-slot:action="{ row }"></template> -->
       </ele-pro-table>
     </el-card>
   </div>
@@ -78,6 +78,18 @@ export default {
           align: 'center',
           showOverflowTooltip: true
         },
+        {
+          prop: 'contactName',
+          label: '客户名称',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'contactCode',
+          label: '客户编码',
+          align: 'center',
+          showOverflowTooltip: true
+        },
         {
           prop: 'attitudeRating',
           label: '服务态度评分',

+ 27 - 19
src/views/salesServiceManagement/recycle/component/recycleDialog.vue

@@ -39,10 +39,7 @@
           </el-form-item>
         </el-col>
         <el-col :span="6">
-          <el-form-item
-            label="回收人:"
-            prop="recycleName"
-          >
+          <el-form-item label="回收人:" prop="recycleName">
             <!-- <el-select style="width: 100%;" v-model="form.recycleId" disabled placeholder="请选择">
               <el-option
                 v-for="item in loginChangeRoleVOList"
@@ -50,7 +47,7 @@
                 :label="item.roleName"
                 :value="item.roleId"
               ></el-option>
-            </el-select> -->
+            </el-select>-->
             <el-input v-model="form.recycleName" disabled />
           </el-form-item>
         </el-col>
@@ -161,7 +158,7 @@
     </el-form>
     <template v-slot:footer>
       <el-button @click="handleClose">取消</el-button>
-      <el-button type="primary" v-if="type == 'add'" @click="save" :loading="loading">确认</el-button>
+      <el-button type="primary" v-if="type != 'view'" @click="save" :loading="loading">确认</el-button>
     </template>
     <workOrderList ref="workOrderListRef" @changeSelect="changeSelect" />
   </ele-modal>
@@ -170,10 +167,10 @@
 <script>
 import spareInfo from '@/views/salesServiceManagement/accessory/components/spareInfo.vue';
 import workOrderList from '@/views/salesServiceManagement/accessory/components/workOrderList.vue';
-import { getCurrentUser } from '@/utils/token-util';
-
+// import spareParts from '@/views/salesServiceManagement/components/sparePartsList.vue';
 import {
   recycleSave,
+  recycleUpdate,
   getSalesWorkOrderById,
   recycleDetails
 } from '@/api/salesServiceManagement/index';
@@ -193,20 +190,27 @@ export default {
       editRepairNotesDialog: false,
       type: 'add',
       form: {
-        recycleName:'',
+        recycleName: ''
       },
       loginChangeRoleVOList: [],
       deviceList: [],
       detailList: []
     };
   },
-  watch: {},
+  watch: {
+    detailList: {
+      handler(newVal) {
+        this.tableList = newVal;
+      },
+      immediate: true
+    }
+  },
   methods: {
     init(row, type) {
       this.editRepairNotesDialog = true;
       this.type = type;
-      this.title = type == 'add' ? '新增' : '详情';
-      let currentUser = getCurrentUser()
+      this.title = type == 'add' ? '新增' : type == 'edit' ? '编辑' : '详情';
+      let currentUser = JSON.parse(sessionStorage['currentUser']);
       this.form.recycleDeptId = currentUser.currentGroupId; // 部门id
       this.roleVOListData();
       if (row?.id) {
@@ -217,7 +221,8 @@ export default {
         this.echoData();
       }
     },
-    async getDetail(row) {
+    async getDetail(data) {
+      const row = JSON.parse(JSON.stringify(data));
       const res = await recycleDetails(row.id);
       this.detailList = res.detailList;
       this.form.code = res.code;
@@ -228,6 +233,7 @@ export default {
       this.$set(this.form, 'reason', res.reason);
       this.$set(this.form, 'contactName', res.contactName);
       this.$set(this.form, 'contactCode', res.contactCode);
+      this.form.id = row.id;
       this.changeSelect(
         {
           id: res.repairId,
@@ -240,13 +246,11 @@ export default {
       //    this.echoData();
       this.$set(this.form, 'recycleId', res.recycleId);
       this.$set(this.form, 'recycleName', res.recycleName);
-      console.log(res, 'res 55');
-      console.log(this.loginChangeRoleVOList, 'loginChangeRoleVOList --');
     },
     handleClose() {
       this.editRepairNotesDialog = false;
       this.form = {
-        recycleName:''
+        recycleName: ''
       };
       this.$refs.recyleFormRef.resetFields();
       this.deviceList = [];
@@ -266,7 +270,11 @@ export default {
             ...this.form,
             detailList
           };
-          const res = await recycleSave(data);
+          if (data.code) {
+            delete data.code;
+          }
+          const requestName = this.type == 'add' ? recycleSave : recycleUpdate;
+          const res = await requestName(data);
           if (res) {
             this.$message.success('操作成功');
             this.handleClose();
@@ -285,11 +293,12 @@ export default {
     },
     addData(item, arr) {
       let totalCount = item.totalCount ? item.totalCount - 0 : '';
-      if (!totalCount) {
+      if (!totalCount || totalCount == 1) {
         arr.push(item);
         return;
       }
       for (let i = 0; i < totalCount; i++) {
+        item.totalPrice = item.singlePrice || 0;
         item.totalCount = 1;
         arr.push(item);
       }
@@ -302,7 +311,6 @@ export default {
     },
     // 确认选择工单
     async changeSelect(row, type) {
-      console.log(row, 'row ==========');
       this.$set(this.form, 'orderWorkName', row.name);
       this.$set(this.form, 'orderWorkCode', row.code);
       this.form.repairId = row.id; // 工单id

+ 6 - 1
src/views/salesServiceManagement/recycle/index.vue

@@ -30,6 +30,12 @@
             :underline="false"
             @click="openEdit(row, 'edit')"
           >修改</el-link>-->
+          <el-link
+            v-if="row.source == 0"
+            type="primary"
+            :underline="false"
+            @click="openEdit(row, 'edit')"
+          >修改</el-link>
           <el-popconfirm class="ele-action" title="确定要删除当前故障吗?" @confirm="deleteRecycle(row)">
             <template v-slot:reference>
               <el-link
@@ -40,7 +46,6 @@
               >删除</el-link>
             </template>
           </el-popconfirm>
-          <!-- <el-link type="primary" :underline="false" @click="openEdit(row, 'view')">详情</el-link> -->
         </template>
       </ele-pro-table>
     </el-card>

+ 4 - 0
src/views/salesServiceManagement/toDoList/components/addOrUpdateDialog.vue

@@ -353,6 +353,10 @@ export default {
       const res = await getSalesPlanById(id);
       if (!res) return;
       this.addForm = res;
+      // 默认赋值 时间单位
+      this.addForm.durationUnit = this.addForm.durationUnit
+        ? this.addForm.durationUnit
+        : '2';
       this.$nextTick(() => {
         this.$refs.infoRef.init(res.afterSalesDemandVO);
         this.$refs.sparePartsRef.setTableValue(res?.costListVOS || []);

+ 6 - 4
src/views/salesServiceManagement/toDoList/components/generateForm.vue

@@ -7,11 +7,11 @@
                 <el-descriptions title="" :column="2" border>
                     <el-descriptions-item>
                         <template slot="label"> 客户编码 </template>
-                        {{ form ? form.contactCode : '' }}
+                        {{ form ? form.afterSalesDemandVO?.contactCode : '' }}
                     </el-descriptions-item>
                     <el-descriptions-item>
                         <template slot="label"> 客户名称 </template>
-                        {{ form ? form.contactName : '' }}
+                        {{ form ? form.afterSalesDemandVO?.contactName : '' }}
                     </el-descriptions-item>
                     <el-descriptions-item>
                         <template slot="label"> 发货单编号 </template>
@@ -19,7 +19,7 @@
                     </el-descriptions-item>
                     <el-descriptions-item>
                         <template slot="label"> 售后时间 </template>
-                        {{ form ? form.createTime : '' }}
+                        {{ form ? form.afterSalesDemandVO?.createTime : '' }}
                     </el-descriptions-item>
 
                 </el-descriptions>
@@ -199,7 +199,8 @@ export default {
     },
     methods: {
         open(row) {
-            this.addForm = row;
+            console.log(row,'row ----')
+            // this.addForm = row;
             this.visibleDialog = true;
             this.getDetail(row);
         },
@@ -210,6 +211,7 @@ export default {
 
         async getDetail(row) {
             const res = await generateQuotationSheet(row.id);
+            console.log(res,'res ----')
             this.rowData = row;
             console.log(res, 'fffff');
             this.form = res;

+ 1 - 1
src/views/salesServiceManagement/toDoList/components/plan-search.vue

@@ -41,7 +41,7 @@ export default {
       return [
         {
           label: '计划单号:',
-          value: 'planCode',
+          value: 'code',
           type: 'input',
           placeholder: ''
         },

+ 58 - 9
src/views/salesServiceManagement/toDoList/index.vue

@@ -9,9 +9,17 @@
         :datasource="datasource"
         cache-key="systemRoleTable"
         :pageSize="20"
+        @cell-click="cellClick"
       >
         <!-- 表头工具栏 -->
-        <template v-slot:toolbar></template>
+        <template v-slot:toolbar>
+          <el-button size="small" type="primary" @click="quotation" class="ele-btn-icon">生成报价单</el-button>
+        </template>
+        <template v-slot:single="{ row }">
+          <el-radio class="radio" v-model="radioId" :label="row.id">
+            <i></i>
+          </el-radio>
+        </template>
         <template v-slot:code="{ row }">
           <el-link type="primary" :underline="false" @click="goDetail(row,'view')">{{ row.code }}</el-link>
         </template>
@@ -33,7 +41,7 @@
               <el-link type="danger" :underline="false" icon="el-icon-delete">删除</el-link>
             </template>
           </el-popconfirm>
-          <el-dropdown @command="(command) => handleCommand(command, row)">
+          <!-- <el-dropdown @command="(command) => handleCommand(command, row)">
             <span class="el-dropdown-link">
               操作菜单
               <i class="el-icon-arrow-down el-icon--right"></i>
@@ -45,11 +53,20 @@
                 v-if="[0, 4,5].includes(row.planStatus)"
               >派单</el-dropdown-item>
               <el-dropdown-item command="handleGenerate">生成报价单</el-dropdown-item>
-              <!-- <el-dropdown-item command="addSpareItems"
-                >申请备品备件
-              </el-dropdown-item>-->
             </el-dropdown-menu>
-          </el-dropdown>
+          </el-dropdown>-->
+          <el-link
+            type="primary"
+            :underline="false"
+            @click="handleCommand('handleRevocation', row)"
+            v-if="row.planStatus == 1"
+          >撤回</el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            @click="handleCommand('handleDispatchOrders', row)"
+            v-if="[0, 4,5].includes(row.planStatus)"
+          >派单</el-link>
         </template>
       </ele-pro-table>
     </el-card>
@@ -95,6 +112,13 @@ export default {
           showOverflowTooltip: true,
           fixed: 'left'
         },
+        {
+          action: 'single',
+          slot: 'single',
+          align: 'center',
+          label: '选择',
+          width: 50,
+        },
         {
           slot: 'code',
           prop: 'code',
@@ -146,9 +170,18 @@ export default {
         },
         {
           prop: 'duration',
-          label: '预计售后时长(分钟)',
+          label: '预计售后时长(小时)',
           align: 'center',
-          showOverflowTooltip: true
+          showOverflowTooltip: true,
+          formatter: (row) => {
+            if (!row.duration) return '';
+            if (row.durationUnit == '2')
+              return row.duration.toFixed(1) + ' 小时';
+            if (row.durationUnit == '1')
+              return (row.duration / 60).toFixed(1) + ' 小时';
+            if (row.durationUnit == '3')
+              return (row.duration * 24).toFixed(1) + ' 小时';
+          }
         },
         {
           prop: 'planStatus',
@@ -206,7 +239,9 @@ export default {
         }
       ],
       // 加载状态
-      loading: false
+      loading: false,
+      radioId: '',
+      currentRow: {}
     };
   },
   computed: {},
@@ -221,6 +256,8 @@ export default {
     /* 刷新表格 */
     reload(where) {
       this.$refs.table.reload({ page: 1, where });
+      this.radioId = '';
+      this.currentRow = {};
     },
     async cancel(row) {
       const res = await deleteSalesPlan([row.id]);
@@ -273,6 +310,18 @@ export default {
       if (command === 'addSpareItems') {
         this.addSpareItems(row);
       }
+    },
+    // 单击选择
+    cellClick(row) {
+      this.currentRow = row;
+      this.radioId = row.id;
+    },
+    quotation(){
+      if(!this.currentRow.id){
+        this.$message.warning('请先选择计划')
+        return;
+      }
+      this.handleCommand('handleGenerate', this.currentRow);
     }
   }
 };

+ 2 - 1
src/views/salesServiceManagement/workOrder/components/declarationDialog.vue

@@ -493,11 +493,12 @@ export default {
     },
     addData(item, arr) {
       let totalCount = item.totalCount ? item.totalCount - 0 : '';
-      if (!totalCount) {
+      if (!totalCount || totalCount == 1) {
         arr.push(item);
         return;
       }
       for (let i = 0; i < totalCount; i++) {
+        item.totalPrice = item.singlePrice || 0;
         item.totalCount = 1;
         arr.push(item);
       }

+ 33 - 2
src/views/salesServiceManagement/workOrder/index.vue

@@ -41,7 +41,8 @@
                             </el-link>
                         </template>
           </el-popconfirm>-->
-          <el-dropdown
+          <!-- *** 不用下拉组件 -->
+          <!-- <el-dropdown
             @command="(command) => handleCommand(command, row)"
             v-if="row.orderStatus != 5"
           >
@@ -65,7 +66,37 @@
               >验收</el-dropdown-item>
               <el-dropdown-item command="evaluate" v-if="row.orderStatus == 4">评价</el-dropdown-item>
             </el-dropdown-menu>
-          </el-dropdown>
+          </el-dropdown> -->
+          <el-link
+            type="primary"
+            v-if="row.orderStatus == 0"
+            :underline="false"
+            @click="handleCommand('handleReceive', row)"
+          >接收</el-link>
+          <el-link
+            type="primary"
+            v-if="row.orderStatus == 0 || row.orderStatus == 1"
+            :underline="false"
+            @click="handleCommand('toRedeploy', row)"
+          >转派</el-link>
+          <el-link
+            type="primary"
+            v-if="row.orderStatus == 1 || row.orderStatus == 2"
+            :underline="false"
+            @click="handleCommand('addSpareItems', row)"
+          >申请配件</el-link>
+          <el-link
+            type="primary"
+            v-if="row.orderStatus == 3||row.orderStatus == 6"
+            :underline="false"
+            @click="handleCommand('checkAndAccept', row)"
+          >验收</el-link>
+          <el-link
+            type="primary"
+            v-if="row.orderStatus == 4"
+            :underline="false"
+            @click="handleCommand('evaluate', row)"
+          >评价</el-link>
         </template>
       </ele-pro-table>
     </el-card>