Pārlūkot izejas kodu

售后工单 申请配件使用部门使用人必填

jingshuyong 1 gadu atpakaļ
vecāks
revīzija
97ee4c65da

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

@@ -1,7 +1,7 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never" v-loading="loading">
-      <search @search="reload"></search>
+      <search class="seep-search" @search="reload"></search>
       <!-- 数据表格 -->
       <ele-pro-table
         ref="table"
@@ -234,8 +234,7 @@
   ::v-deep .el-input__inner::placeholder {
     font-size: 13px;
   }
-
-  ::v-deep {
+  ::v-deep .seep-search {
     .el-input__inner {
       padding: 0 5px 0 10px;
     }

+ 308 - 264
src/views/salesServiceManagement/components/applyForSpare.vue

@@ -7,7 +7,13 @@
     @close="handleCancel"
     :maxable="true"
   >
-    <el-form ref="form" :model="form" :rules="rules" label-width="90px" class="create-form">
+    <el-form
+      ref="form"
+      :model="form"
+      :rules="rules"
+      label-width="90px"
+      class="create-form"
+    >
       <headerTitle title="基本信息" style="margin-top: 15px"></headerTitle>
       <el-row :gutter="24">
         <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
@@ -55,12 +61,31 @@
           </el-form-item>
         </el-col>-->
         <el-col :span="6">
-          <el-form-item label="使用部门">
-            <deptSelect v-model="form.useDeptId" @changeGroup="searchDeptNodeClick" />
+          <el-form-item
+            label="使用部门"
+            prop="useDeptId"
+            :rules="{
+              required: true,
+              message: '请选择使用部门',
+              trigger: 'change'
+            }"
+          >
+            <deptSelect
+              v-model="form.useDeptId"
+              @changeGroup="searchDeptNodeClick"
+            />
           </el-form-item>
         </el-col>
         <el-col :span="6">
-          <el-form-item label="使用人">
+          <el-form-item
+            label="使用人"
+            prop="userId"
+            :rules="{
+              required: true,
+              message: '请选择使用人',
+              trigger: 'change'
+            }"
+          >
             <el-select
               v-model="form.userId"
               size="small"
@@ -127,9 +152,15 @@
           />
         </template>
         <template v-slot:action="{ row }">
-          <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="del(row.id)">
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除吗?"
+            @confirm="del(row.id)"
+          >
             <template v-slot:reference>
-              <el-link type="danger" :underline="false" icon="el-icon-delete">删除</el-link>
+              <el-link type="danger" :underline="false" icon="el-icon-delete"
+                >删除</el-link
+              >
             </template>
           </el-popconfirm>
         </template>
@@ -138,9 +169,15 @@
 
     <template v-slot:footer v-if="this.inlet != 1">
       <el-button @click="handleCancel">取消</el-button>
-      <el-button type="primary" @click="save" :loading="loading">提交</el-button>
+      <el-button type="primary" @click="save" :loading="loading"
+        >提交</el-button
+      >
     </template>
-    <AssetsDialog ref="selectStockLedgerDialogRef" :assetType="6" @choose="confirmChoose"></AssetsDialog>
+    <AssetsDialog
+      ref="selectStockLedgerDialogRef"
+      :assetType="6"
+      @choose="confirmChoose"
+    ></AssetsDialog>
     <!-- <product-list
       ref="productListRef"
       classType="1"
@@ -153,276 +190,283 @@
 </template>
 
 <script>
-import {
-  saveOrUpdateSalesWorkOrder,
-  saveOrUpdateSalesPlan,
-  getSalesWorkOrderById
-} from '@/api/salesServiceManagement/index';
-import AssetsDialog from './AssetsDialog.vue';
-// import productList from '@/BIZComponents/product-list.vue';
-import deptSelect from '@/components/CommomSelect/dept-select.vue';
-import { getUserPage } from '@/api/system/organization';
-import { parameterGetByCode } from '@/api/main/index.js';
-export default {
-  components: {
-    AssetsDialog,
-    deptSelect,
-    // productList
-  },
-  props: {
-    inlet: {
-      type: Number,
-      default: null
-    }
-  },
-  data() {
-    return {
-      visible: false,
-      loading: false,
-      title: '配件申请单',
-      type: '',
-      form: {
-        code: '',
-        name: '',
-        receivingDeptName: '',
-        recipientName: '',
-        usageTime: '',
-        useDeptName: '',
-        userName: '',
-        purpose: '',
-        userId: '',
-        useDeptId: ''
-      },
-      rules: {},
-      tableList: [],
-      columns: [
-        {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
+  import {
+    saveOrUpdateSalesWorkOrder,
+    saveOrUpdateSalesPlan,
+    getSalesWorkOrderById
+  } from '@/api/salesServiceManagement/index';
+  import AssetsDialog from './AssetsDialog.vue';
+  // import productList from '@/BIZComponents/product-list.vue';
+  import deptSelect from '@/components/CommomSelect/dept-select.vue';
+  import { getUserPage } from '@/api/system/organization';
+  import { parameterGetByCode } from '@/api/main/index.js';
+  export default {
+    components: {
+      AssetsDialog,
+      deptSelect
+      // productList
+    },
+    props: {
+      inlet: {
+        type: Number,
+        default: null
+      }
+    },
+    data() {
+      return {
+        visible: false,
+        loading: false,
+        title: '配件申请单',
+        type: '',
+        form: {
+          code: '',
+          name: '',
+          receivingDeptName: '',
+          recipientName: '',
+          usageTime: '',
+          useDeptName: '',
+          userName: '',
+          purpose: '',
+          userId: '',
+          useDeptId: ''
         },
+        rules: {},
+        tableList: [],
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
 
-        {
-          prop: 'categoryCode',
-          label: '物品编码',
-          align: 'center'
-        },
-        {
-          prop: 'categoryName',
-          label: '物品名称',
-          align: 'center'
-        },
+          {
+            prop: 'categoryCode',
+            label: '物品编码',
+            align: 'center'
+          },
+          {
+            prop: 'categoryName',
+            label: '物品名称',
+            align: 'center'
+          },
 
-        {
-          prop: 'categoryModel',
-          label: '型号',
-          align: 'center'
-        },
-        {
-          prop: 'specification',
-          label: '规格',
-          align: 'center'
-        },
-        {
-          prop: 'level',
-          label: '级别',
-          align: 'center'
-        },
-        {
-          prop: 'totalCount',
-          label: '数量',
-          align: 'center',
-          width: 100,
-          slot: 'totalCount'
-        },
-        {
-          prop: 'singlePrice',
-          label: '单价',
-          align: 'center',
-          width: 100,
-          slot: 'singlePrice'
-        },
-        {
-          prop: 'totalPrice',
-          label: '总价',
-          align: 'center',
-          width: 100
-        },
-        //   {
-        //     prop: 'measureQuantity',
-        //     label: '库存',
-        //     align: 'center'
-        //   },
-        {
-          prop: 'measureUnit',
-          label: '计量单位',
-          align: 'center'
-        },
-        {
-          prop: 'warehouseName',
-          label: '仓库',
-          align: 'center'
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 140,
-          align: 'center',
-          resizable: false,
-          fixed: 'right',
-          slot: 'action',
-          showOverflowTooltip: true,
-          show: this.inlet != 1
-        }
-      ],
-      executorList: [] // 使用人列表
-    };
-  },
-
-  computed: {
-    // 是否开启响应式布局
-    styleResponsive() {
-      return this.$store.state.theme.styleResponsive;
-    }
-  },
-  created() {},
-  methods: {
-    // 出库数量限制
-    handleInput(row, index) {
-      // if (row.totalCount > row.measureQuantity) {
-      //   this.$set(this.tableList[index], 'totalCount', row.measureQuantity);
-      // }
-      if (row.singlePrice == 0) {
-        this.$set(this.tableList[index], 'totalPrice', 0);
-      } else {
-        this.$set(
-          this.tableList[index],
-          'totalPrice',
-          Number(row.singlePrice) * Number(row.totalCount)
-        );
-      }
+          {
+            prop: 'categoryModel',
+            label: '型号',
+            align: 'center'
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center'
+          },
+          {
+            prop: 'level',
+            label: '级别',
+            align: 'center'
+          },
+          {
+            prop: 'totalCount',
+            label: '数量',
+            align: 'center',
+            width: 100,
+            slot: 'totalCount'
+          },
+          {
+            prop: 'singlePrice',
+            label: '单价',
+            align: 'center',
+            width: 100,
+            slot: 'singlePrice'
+          },
+          {
+            prop: 'totalPrice',
+            label: '总价',
+            align: 'center',
+            width: 100
+          },
+          //   {
+          //     prop: 'measureQuantity',
+          //     label: '库存',
+          //     align: 'center'
+          //   },
+          {
+            prop: 'measureUnit',
+            label: '计量单位',
+            align: 'center'
+          },
+          {
+            prop: 'warehouseName',
+            label: '仓库',
+            align: 'center'
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 140,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action',
+            showOverflowTooltip: true,
+            show: this.inlet != 1
+          }
+        ],
+        executorList: [] // 使用人列表
+      };
     },
-    //选择部门(搜索)
-    searchDeptNodeClick(info, data) {
-      if (info) {
-        // 根据部门获取人员
-        this.form.useDeptName = data.name;
-        const params = { groupId: info };
-        this.getUserList(params);
-        this.form.userName = '';
-        this.$set(this.form, 'userId', '');
-      } else {
-        this.form.useDeptId = null;
+
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
       }
     },
-    // 获取审核人列表、巡点检人员
-    async getUserList(params) {
-      try {
-        let data = { pageNum: 1, size: -1 };
-        // 如果传了参数就是获取巡点检人员数据
-        if (params) {
-          data = Object.assign(data, params);
+    created() {},
+    methods: {
+      // 出库数量限制
+      handleInput(row, index) {
+        // if (row.totalCount > row.measureQuantity) {
+        //   this.$set(this.tableList[index], 'totalCount', row.measureQuantity);
+        // }
+        if (row.singlePrice == 0) {
+          this.$set(this.tableList[index], 'totalPrice', 0);
+        } else {
+          this.$set(
+            this.tableList[index],
+            'totalPrice',
+            Number(row.singlePrice) * Number(row.totalCount)
+          );
         }
-        const res = await getUserPage(data);
-        if (params) {
-          this.executorList = res.list;
+      },
+      // 使用人
+      changeUser(e){
+        let data = this.executorList.find((item)=>item.id == e);
+        this.form.userName = data.name
+      },
+      //选择部门(搜索)
+      searchDeptNodeClick(info, data) {
+        if (info) {
+          // 根据部门获取人员
+          this.form.useDeptName = data.name;
+          const params = { groupId: info };
+          this.getUserList(params);
+          this.form.userName = '';
+          this.$set(this.form, 'userId', '');
+        } else {
+          this.form.useDeptId = null;
         }
-      } catch (error) {}
-    },
-    async open(row, type) {
-      console.log(type);
-      this.visible = true;
-      this.type = type;
-
-      this.getSalesWorkOrderDetail(row);
-    },
-    async getSalesWorkOrderDetail(row) {
-      console.log(row, '申请备品备件列表详情');
-      this.form = row || {};
+      },
+      // 获取审核人列表、巡点检人员
+      async getUserList(params) {
+        try {
+          let data = { pageNum: 1, size: -1 };
+          // 如果传了参数就是获取巡点检人员数据
+          if (params) {
+            data = Object.assign(data, params);
+          }
+          const res = await getUserPage(data);
+          if (params) {
+            this.executorList = res.list;
+          }
+        } catch (error) {}
+      },
+      async open(row, type) {
+        this.visible = true;
+        this.type = type;
 
-      this.tableList = row.details || [];
-    },
-    del(id) {
-      this.tableList = this.tableList.filter((item) => item.id != id);
-    },
-    handleCancel() {
-      this.tableList = [];
-      this.form = {};
-      this.visible = false;
-      this.executorList = [];
-    },
-    async addEquipment() {
-      // const res = await parameterGetByCode({code: 'after_sales_accessory_source'});
-      this.$refs.selectStockLedgerDialogRef.open(this.tableList);
-      // if(res.value == '1'){
-      //   this.$refs.productListRef.open('', index);
-      // }else{
-      //   this.$refs.selectStockLedgerDialogRef.open(this.tableList);
-      // }
-      console.log(res,'res --')
-    },
-    /* 保存编辑 */
-    async save() {
-      this.$refs.form.validate(async (valid) => {
-        if (valid) {
-          this.loading = true;
-          let requestName =
-            this.type == 'work'
-              ? saveOrUpdateSalesWorkOrder
-              : saveOrUpdateSalesPlan;
-          const res = await requestName({
-            ...this.form,
-            details: this.tableList
-          });
+        this.getSalesWorkOrderDetail(row);
+      },
+      async getSalesWorkOrderDetail(row) {
+        this.form = row || {};
 
-          this.loading = false;
-          if (!res) return;
-          this.$message({
-            type: 'success',
-            message: '提交成功'
-          });
-          this.$emit('reload');
-          this.handleCancel();
-          this.loading = false;
+        this.tableList = row.details || [];
+      },
+      del(id) {
+        this.tableList = this.tableList.filter((item) => item.id != id);
+      },
+      handleCancel() {
+        this.tableList = [];
+        this.form = {};
+        this.visible = false;
+        this.executorList = [];
+         this.$refs['form'].resetFields();
+      },
+      async addEquipment() {
+        // const res = await parameterGetByCode({code: 'after_sales_accessory_source'});
+        this.$refs.selectStockLedgerDialogRef.open(this.tableList);
+        // if(res.value == '1'){
+        //   this.$refs.productListRef.open('', index);
+        // }else{
+        //   this.$refs.selectStockLedgerDialogRef.open(this.tableList);
+        // }
+        // console.log(res, 'res --');
+      },
+      /* 保存编辑 */
+      async save() {
+        if(this.tableList.length == 0){
+          this.$message.warning('请至少添加一条配件信息')
+          return;
         }
-      });
-    },
-    confirmChoose(data) {
-      console.log(data, '选中');
-      data.map((item) => {
-        item.singlePrice = item.unitPrice;
-        delete item.id;
-        return {
-          ...item
-        };
-      });
-      this.tableList = JSON.parse(JSON.stringify(data));
+        this.$refs.form.validate(async (valid) => {
+          if (valid) {
+            this.loading = true;
+            let requestName =
+              this.type == 'work'
+                ? saveOrUpdateSalesWorkOrder
+                : saveOrUpdateSalesPlan;
+            const res = await requestName({
+              ...this.form,
+              details: this.tableList
+            });
+
+            this.loading = false;
+            if (!res) return;
+            this.$message({
+              type: 'success',
+              message: '提交成功'
+            });
+            this.$emit('reload');
+            this.handleCancel();
+            this.loading = false;
+          }
+        });
+      },
+      confirmChoose(data) {
+        data.map((item) => {
+          item.singlePrice = item.unitPrice;
+          delete item.id;
+          return {
+            ...item
+          };
+        });
+        this.tableList = JSON.parse(JSON.stringify(data));
+      }
     }
-  }
-};
+  };
 </script>
 <style lang="scss" scoped>
-.basic-details-title {
-  margin: 10px 0;
-}
+  .basic-details-title {
+    margin: 10px 0;
+  }
 
-.title {
-  font-size: 16px;
-  line-height: 45px;
-}
+  .title {
+    font-size: 16px;
+    line-height: 45px;
+  }
 
-.add-product {
-  width: 100%;
-  display: flex;
-  align-items: center;
-  // justify-content: flex-end;
-  font-size: 30px;
-  color: #1890ff;
-  margin: 10px 0;
-  cursor: pointer;
-}
+  .add-product {
+    width: 100%;
+    display: flex;
+    align-items: center;
+    // justify-content: flex-end;
+    font-size: 30px;
+    color: #1890ff;
+    margin: 10px 0;
+    cursor: pointer;
+  }
 </style>

+ 5 - 6
src/views/salesServiceManagement/demandList/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never" v-loading="loading">
-      <search :levelList="levelList" @search="reload"></search>
+      <search class="seep-search" :levelList="levelList" @search="reload"></search>
       <!-- 数据表格 -->
       <ele-pro-table
         ref="table"
@@ -382,11 +382,10 @@
     font-size: 12px;
   }
 
-  ::v-deep .el-input__inner::placeholder {
-    font-size: 13px;
-  }
-
-  ::v-deep {
+  ::v-deep .seep-search {
+    .el-input__inner::placeholder {
+      font-size: 13px;
+    }
     .el-input__inner {
       padding: 0 5px 0 10px;
     }

+ 2 - 3
src/views/salesServiceManagement/evaluate/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never" v-loading="loading">
-      <search @search="reload"></search>
+      <search class="seep-search" @search="reload"></search>
       <!-- 数据表格 -->
       <ele-pro-table
         ref="table"
@@ -157,8 +157,7 @@
   ::v-deep .el-input__inner::placeholder {
     font-size: 13px;
   }
-
-  ::v-deep {
+  ::v-deep .seep-search {
     .el-input__inner {
       padding: 0 5px 0 10px;
     }

+ 0 - 1
src/views/salesServiceManagement/recycle/component/recycleDialog.vue

@@ -222,7 +222,6 @@ export default {
         // 下拉数据 name 赋值
         this.echoData();
       }
-      console.log(this.form,'form --')
     },
     async getDetail(data) {
       const row = JSON.parse(JSON.stringify(data));

+ 2 - 3
src/views/salesServiceManagement/recycle/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never" v-loading="loading">
-      <search user="recycleName" @search="reload"></search>
+      <search class="seep-search" user="recycleName" @search="reload"></search>
       <!-- 数据表格 -->
       <ele-pro-table
         ref="table"
@@ -217,8 +217,7 @@
   ::v-deep .el-input__inner::placeholder {
     font-size: 13px;
   }
-
-  ::v-deep {
+  ::v-deep .seep-search {
     .el-input__inner {
       padding: 0 5px 0 10px;
     }

+ 295 - 272
src/views/salesServiceManagement/toDoList/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never" v-loading="loading">
-      <plan-search @search="reload"></plan-search>
+      <plan-search class="seep-search" @search="reload"></plan-search>
       <!-- 数据表格 -->
       <ele-pro-table
         ref="table"
@@ -13,7 +13,13 @@
       >
         <!-- 表头工具栏 -->
         <template v-slot:toolbar>
-          <el-button size="small" type="primary" @click="quotation" class="ele-btn-icon">生成报价单</el-button>
+          <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">
@@ -21,24 +27,32 @@
           </el-radio>
         </template>
         <template v-slot:code="{ row }">
-          <el-link type="primary" :underline="false" @click="goDetail(row,'view')">{{ row.code }}</el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            @click="goDetail(row, 'view')"
+            >{{ row.code }}</el-link
+          >
         </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
           <el-link
             type="primary"
             :underline="false"
-            @click="handleUpdate(row,'edit')"
-            v-if="[0, 4,5].includes(row.planStatus)"
-          >修改</el-link>
+            @click="handleUpdate(row, 'edit')"
+            v-if="[0, 4, 5].includes(row.planStatus)"
+            >修改</el-link
+          >
           <el-popconfirm
             class="ele-action"
             title="确认删除这条记录吗?"
             @confirm="cancel(row)"
-            v-if="[0, 4,5].includes(row.planStatus)"
+            v-if="[0, 4, 5].includes(row.planStatus)"
           >
             <template v-slot:reference>
-              <el-link type="danger" :underline="false" icon="el-icon-delete">删除</el-link>
+              <el-link type="danger" :underline="false" icon="el-icon-delete"
+                >删除</el-link
+              >
             </template>
           </el-popconfirm>
           <!-- <el-dropdown @command="(command) => handleCommand(command, row)">
@@ -60,299 +74,308 @@
             :underline="false"
             @click="handleCommand('handleRevocation', row)"
             v-if="row.planStatus == 1"
-          >撤回</el-link>
+            >撤回</el-link
+          >
           <el-link
             type="primary"
             :underline="false"
             @click="handleCommand('handleDispatchOrders', row)"
-            v-if="[0, 4,5].includes(row.planStatus)"
-          >派单</el-link>
+            v-if="[0, 4, 5].includes(row.planStatus)"
+            >派单</el-link
+          >
           <!-- <jimureportBrowse   :businessId="row.id" businessCode="eomquotationprint"></jimureportBrowse> -->
-
         </template>
       </ele-pro-table>
     </el-card>
-    <addOrUpdateDialog ref="addOrUpdateDialogRef" @reload="reload"></addOrUpdateDialog>
+    <addOrUpdateDialog
+      ref="addOrUpdateDialogRef"
+      @reload="reload"
+    ></addOrUpdateDialog>
     <applyForSpare ref="edit" @reload="reload" />
     <generateForm ref="generateFormRef"></generateForm>
-    <jimureportBrowse @cancelQuo="cancelQuo"  v-if="browseShow" :browseShow="browseShow" :businessId="currentRow.id" businessCode="eomquotationprint"></jimureportBrowse>
+    <jimureportBrowse
+      @cancelQuo="cancelQuo"
+      v-if="browseShow"
+      :browseShow="browseShow"
+      :businessId="currentRow.id"
+      businessCode="eomquotationprint"
+    ></jimureportBrowse>
   </div>
 </template>
 
 <script>
-import planSearch from './components/plan-search.vue';
-import addOrUpdateDialog from './components/addOrUpdateDialog.vue';
-import generateForm from './components/generateForm.vue';
-import jimureportBrowse from '@/components/jimureport/browseModal.vue'
-import applyForSpare from '../components/applyForSpare.vue';
+  import planSearch from './components/plan-search.vue';
+  import addOrUpdateDialog from './components/addOrUpdateDialog.vue';
+  import generateForm from './components/generateForm.vue';
+  import jimureportBrowse from '@/components/jimureport/browseModal.vue';
+  import applyForSpare from '../components/applyForSpare.vue';
 
-import {
-  getSalesPlan,
-  deleteSalesPlan,
-  planRevocation
-} from '@/api/salesServiceManagement/index';
-import { getToken } from '@/utils/token-util';
-import dictMixins from '@/mixins/dictMixins';
+  import {
+    getSalesPlan,
+    deleteSalesPlan,
+    planRevocation
+  } from '@/api/salesServiceManagement/index';
+  import { getToken } from '@/utils/token-util';
+  import dictMixins from '@/mixins/dictMixins';
 
-export default {
-  mixins: [dictMixins],
-  components: {
-    planSearch,
-    addOrUpdateDialog,
-    generateForm,
-    applyForSpare,
-    jimureportBrowse
-  },
-  data() {
-    return {
-      // 表格列配置
-      columns: [
-        {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          action: 'single',
-          slot: 'single',
-          align: 'center',
-          label: '选择',
-          width: 50,
-        },
-        {
-          slot: 'code',
-          prop: 'code',
-          label: '计划单号',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'name',
-          label: '计划名称',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'categoryName',
-          label: '设备名称',
-          align: 'center',
-          showOverflowTooltip: true,
-          formatter: (row) => {
-            if (!row.deviceDetails) return '';
-            let str = '';
-            row.deviceDetails.map((el, idx) => {
-              if (idx + 1 == row.deviceDetails.length) {
-                str += el.categoryName;
-              } else {
-                str = str + '' + el.categoryName + ',';
-              }
-            });
-            return str;
-          }
-        },
-        {
-          prop: 'contactName',
-          label: '客户名称',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        // {
-        //   prop: 'isSyncBill',
-        //   label: '是否自动派单',
-        //   align: 'center',
-        //   showOverflowTooltip: true,
-        //   formatter: (item) => {
-        //     return {
-        //       0: '否',
-        //       1: '是'
-        //     }[item.isSyncBill];
-        //   }
-        // },
-        // {
-        //   prop: 'duration',
-        //   label: '预计售后时长(小时)',
-        //   align: 'center',
-        //   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',
-          label: '状态',
-          align: 'center',
-          showOverflowTooltip: true,
-          formatter: (item) => {
-            return {
-              0: '待派单',
-              1: '已派单',
-              2: '执行中',
-              3: '已完成',
-              4: '已撤回',
-              5: '已驳回'
-            }[item.planStatus];
-          }
-        },
-        {
-          prop: 'urgent',
-          label: '紧急程度',
-          align: 'center',
-          showOverflowTooltip: true,
-          formatter: (item) => {
-            return {
-              1: '普通',
-              2: '紧急',
-              3: '重要'
-            }[item.urgent];
-          }
-        },
-        {
-          prop: 'createUserName',
-          label: '创建人',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          formatter: (_row, _column, cellValue) => {
-            return this.$util.toDateString(cellValue);
-          }
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 230,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true,
-          fixed: 'right'
-        }
-      ],
-      // 加载状态
-      loading: false,
-      radioId: '',
-      currentRow: {},
-      browseShow: false,
-    };
-  },
-  computed: {},
-  created() {
-    this.requestDict('维修计划状态');
-  },
-  methods: {
-    /* 表格数据源 */
-    datasource({ page, limit, where, order }) {
-      return getSalesPlan({ pageNum: page, size: limit, ...where });
-    },
-    /* 刷新表格 */
-    reload(where) {
-      this.$refs.table.reload({ page: 1, where });
-      this.radioId = '';
-      this.currentRow = {};
-    },
-    async cancel(row) {
-      const res = await deleteSalesPlan([row.id]);
-      if (res) {
-        this.$message.success('删除成功');
-        this.reload();
-      }
-    },
-    handleUpdate(row, type) {
-      this.$nextTick(() => {
-        this.$refs.addOrUpdateDialogRef.init(row, type);
-      });
-    },
-    goDetail(row) {
-      this.$nextTick(() => {
-        this.$refs.addOrUpdateDialogRef.init(row, 'view');
-      });
-    },
-    handleDispatchOrders(row) {
-      this.$nextTick(() => {
-        this.$refs.addOrUpdateDialogRef.init(row, 'view', true);
-      });
-    },
-    async handleRevocation(row) {
-      try {
-        await planRevocation([row.id]);
-        this.$message.success('撤回成功');
-        this.reload();
-      } catch (err) {
-        // this.$message.error(err)
-      }
-    },
-    addSpareItems(row) {
-      let data = JSON.parse(JSON.stringify(row));
-      this.$refs.edit.open(data, 'plan');
-    },
-    async handleGenerate(row) {
-      this.$refs.generateFormRef.open(row);
+  export default {
+    mixins: [dictMixins],
+    components: {
+      planSearch,
+      addOrUpdateDialog,
+      generateForm,
+      applyForSpare,
+      jimureportBrowse
     },
-    handleCommand(command, row) {
-      if (command === 'handleRevocation') {
-        this.handleRevocation(row);
-      }
-      if (command === 'handleDispatchOrders') {
-        this.handleDispatchOrders(row);
-      }
-      if (command === 'handleGenerate') {
-        this.handleGenerate(row);
-      }
-      if (command === 'addSpareItems') {
-        this.addSpareItems(row);
-      }
+    data() {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            action: 'single',
+            slot: 'single',
+            align: 'center',
+            label: '选择',
+            width: 50
+          },
+          {
+            slot: 'code',
+            prop: 'code',
+            label: '计划单号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'name',
+            label: '计划名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'categoryName',
+            label: '设备名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              if (!row.deviceDetails) return '';
+              let str = '';
+              row.deviceDetails.map((el, idx) => {
+                if (idx + 1 == row.deviceDetails.length) {
+                  str += el.categoryName;
+                } else {
+                  str = str + '' + el.categoryName + ',';
+                }
+              });
+              return str;
+            }
+          },
+          {
+            prop: 'contactName',
+            label: '客户名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          // {
+          //   prop: 'isSyncBill',
+          //   label: '是否自动派单',
+          //   align: 'center',
+          //   showOverflowTooltip: true,
+          //   formatter: (item) => {
+          //     return {
+          //       0: '否',
+          //       1: '是'
+          //     }[item.isSyncBill];
+          //   }
+          // },
+          // {
+          //   prop: 'duration',
+          //   label: '预计售后时长(小时)',
+          //   align: 'center',
+          //   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',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (item) => {
+              return {
+                0: '待派单',
+                1: '已派单',
+                2: '执行中',
+                3: '已完成',
+                4: '已撤回',
+                5: '已驳回'
+              }[item.planStatus];
+            }
+          },
+          {
+            prop: 'urgent',
+            label: '紧急程度',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (item) => {
+              return {
+                1: '普通',
+                2: '紧急',
+                3: '重要'
+              }[item.urgent];
+            }
+          },
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (_row, _column, cellValue) => {
+              return this.$util.toDateString(cellValue);
+            }
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 230,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true,
+            fixed: 'right'
+          }
+        ],
+        // 加载状态
+        loading: false,
+        radioId: '',
+        currentRow: {},
+        browseShow: false
+      };
     },
-    // 单击选择
-    cellClick(row) {
-      this.currentRow = row;
-      this.radioId = row.id;
+    computed: {},
+    created() {
+      this.requestDict('维修计划状态');
     },
-    quotation(){
-      if(!this.currentRow.id){
-        this.$message.warning('请先选择计划')
-        return;
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getSalesPlan({ pageNum: page, size: limit, ...where });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where });
+        this.radioId = '';
+        this.currentRow = {};
+      },
+      async cancel(row) {
+        const res = await deleteSalesPlan([row.id]);
+        if (res) {
+          this.$message.success('删除成功');
+          this.reload();
+        }
+      },
+      handleUpdate(row, type) {
+        this.$nextTick(() => {
+          this.$refs.addOrUpdateDialogRef.init(row, type);
+        });
+      },
+      goDetail(row) {
+        this.$nextTick(() => {
+          this.$refs.addOrUpdateDialogRef.init(row, 'view');
+        });
+      },
+      handleDispatchOrders(row) {
+        this.$nextTick(() => {
+          this.$refs.addOrUpdateDialogRef.init(row, 'view', true);
+        });
+      },
+      async handleRevocation(row) {
+        try {
+          await planRevocation([row.id]);
+          this.$message.success('撤回成功');
+          this.reload();
+        } catch (err) {
+          // this.$message.error(err)
+        }
+      },
+      addSpareItems(row) {
+        let data = JSON.parse(JSON.stringify(row));
+        this.$refs.edit.open(data, 'plan');
+      },
+      async handleGenerate(row) {
+        this.$refs.generateFormRef.open(row);
+      },
+      handleCommand(command, row) {
+        if (command === 'handleRevocation') {
+          this.handleRevocation(row);
+        }
+        if (command === 'handleDispatchOrders') {
+          this.handleDispatchOrders(row);
+        }
+        if (command === 'handleGenerate') {
+          this.handleGenerate(row);
+        }
+        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.browseShow = true;
+        // this.handleCommand('handleGenerate', this.currentRow);
+      },
+      cancelQuo() {
+        this.browseShow = false;
       }
-      this.browseShow = true;
-      // this.handleCommand('handleGenerate', this.currentRow);
-    },
-    cancelQuo(){
-      this.browseShow = false;
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped>
-.el-dropdown-link {
-  cursor: pointer;
-  color: var(--color-primary-5);
-}
-
-.el-icon-arrow-down {
-  font-size: 12px;
-}
+  .el-dropdown-link {
+    cursor: pointer;
+    color: var(--color-primary-5);
+  }
 
-  ::v-deep .el-input__inner::placeholder {
-    font-size: 13px;
+  .el-icon-arrow-down {
+    font-size: 12px;
   }
 
-  ::v-deep {
+  ::v-deep .seep-search {
     .el-input__inner {
       padding: 0 5px 0 10px;
     }
+    .el-input__inner::placeholder {
+    font-size: 13px;
+  }
   }
 </style>

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

@@ -2,6 +2,7 @@
   <div class="ele-body">
     <el-card shadow="never" v-loading="loading">
       <work-search
+        class="seep-search"
         ref="workSearch"
         :levelList="levelList"
         @search="reload"
@@ -564,8 +565,7 @@
     font-size: 12px;
   }
 
-
-  ::v-deep {
+  ::v-deep .seep-search {
     .el-input__inner {
       padding: 0 5px 0 10px;
     }