Browse Source

售后修改 订单 客户导出

yusheng 1 năm trước cách đây
mục cha
commit
e790356e0b

+ 7 - 4
src/BIZComponents/product-list.vue

@@ -22,7 +22,7 @@
             @handleNodeClick="handleNodeClick"
             :isFirstRefreshTable="isFirstRefreshTable"
             ref="treeList"
-            :typeIds="typeIds"
+            :ids="ids"
           />
         </div>
         <!-- 表格 -->
@@ -120,7 +120,10 @@
         type: Boolean,
         default: false
       },
-      
+      ids:{
+        type: Array,
+        default: () => []
+      }
     },
 
     data() {
@@ -393,7 +396,7 @@
               .map((item) => item.productCode)
               .includes(this.current.code)
           ) {
-            return this.$message.error('选择的品已经存在列表了');
+            return this.$message.error('选择的品已经存在列表了');
           }
         } else {
           if (
@@ -401,7 +404,7 @@
               this.data.some((i) => i.productCode == item.code)
             )
           ) {
-            return this.$message.error('选择的品已经存在列表了');
+            return this.$message.error('选择的品已经存在列表了');
           }
         }
 

+ 5 - 5
src/api/system/file/index.js

@@ -114,17 +114,17 @@ export async function downLoadTemplate() {
 
 }
 /**
- * 销售订单导出
+ * 导出
  */
-export async function exportSaleorder(data) {
+export async function exportTable(data) {
   const res = await request.post(
-    '/eom/saleorder/export',
-    data,
+    data.api,
+    data.data,
     {
       responseType: 'blob'
     }
   );
   console.log(res.data, '***********');
-  download(res.data, '销售订单.xlsx');
+  download(res.data, data.fileName+'.xlsx');
 
 }

+ 9 - 1
src/components/productTree/index.vue

@@ -19,7 +19,7 @@
 
 <script>
   import { getProduceTreeByPid } from '@/api/saleManage/quotation';
-  import { getInfoByIds } from '@/api/classifyManage/index';
+  import { getInfoByIds,getTreeByIds } from '@/api/classifyManage/index';
   // let originId = '';
   // let originType = '';
   export default {
@@ -66,6 +66,10 @@
       typeIds: {
         type: Array,
         default: () => []
+      },
+      ids:{
+        type: Array,
+        default: () => []
       }
       // appendRoot: {
       //   type: Boolean,
@@ -99,6 +103,10 @@
           if (this.typeIds.length > 0) {
             let res = await getInfoByIds(this.typeIds.toString());
             data= res.data
+          }else if(this.ids.length > 0){
+            let res = await getTreeByIds({ ids: this.ids.join(',') });
+            data= res.data
+
           } else {
             data = await getProduceTreeByPid(params);
           }

+ 41 - 0
src/components/upload/exportButton.vue

@@ -0,0 +1,41 @@
+<template>
+  <el-button
+    type="primary"
+    size="small"
+    icon="el-icon-download"
+    @click="exportFn"
+    >导出</el-button
+  >
+</template>
+
+<script>
+  import { exportTable } from '@/api/system/file/index.js';
+  export default {
+    props: {
+      apiUrl: '',
+      fileName: '',
+      params: {
+        default: () => {
+          return {};
+        }
+      }
+    },
+    //注册组件
+    data() {
+      return {};
+    },
+
+    created() {},
+    methods: {
+      exportFn() {
+        exportTable({
+          api: this.apiUrl,
+          fileName: this.fileName,
+          data:this.params
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="scss"></style>

+ 21 - 9
src/views/purchasingManage/purchaseOrder/index.vue

@@ -63,6 +63,11 @@
                   @click="uploadFile"
                   >导入</el-button
                 >
+                <exportButton
+                  fileName="采购订单"
+                  apiUrl="/eom/purchaseorder/export"
+                  :params="params"
+                ></exportButton>
               </template>
 
               <!-- 查看详情列 -->
@@ -143,14 +148,17 @@
                       v-if="['3', '4', '5', '6'].includes(row.sourceType)"
                       >创建委外发货单
                     </el-dropdown-item>
-                    <el-dropdown-item command="invoice"
-                    v-if="!['3', '4', '5', '6'].includes(row.sourceType)"
+                    <el-dropdown-item
+                      command="invoice"
+                      v-if="!['3', '4', '5', '6'].includes(row.sourceType)"
                       >创建收货单
                     </el-dropdown-item>
                     <!-- <el-dropdown-item command="returnOrder"
                       >创建退货单
                     </el-dropdown-item> -->
-                    <el-dropdown-item command="invoiceManage" v-if="!row.hasInvoiceApply"
+                    <el-dropdown-item
+                      command="invoiceManage"
+                      v-if="!row.hasInvoiceApply"
                       >新增发票
                     </el-dropdown-item>
                   </el-dropdown-menu>
@@ -248,11 +256,12 @@
   import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import importDialog from '@/components/upload/import-dialog.vue';
+  import exportButton from '@/components/upload/exportButton.vue';
 
   export default {
-    mixins: [dictMixins,tabMixins],
+    mixins: [dictMixins, tabMixins],
     components: {
-      processSubmitDialog,
+      processSubmitDialog,exportButton,
       searchTable,
       returnGoods,
       accountstatement,
@@ -265,7 +274,8 @@
       detailDialog,
       outSourceSend,
       addOutSourceSend,
-      addInvoiceManage,importDialog
+      addInvoiceManage,
+      importDialog
     },
     data() {
       return {
@@ -283,6 +293,7 @@
         processSubmitDialogFlag: false,
         addOrEditDialogFlag: false,
         addOrEditDialogFlag1: false,
+        params: {},
         columns: [
           {
             width: 45,
@@ -445,7 +456,7 @@
             fixed: 'right'
           }
         ],
-        cacheKeyUrl:'eos-5f2ac512-purchaseOrder-saleorder'
+        cacheKeyUrl: 'eos-5f2ac512-purchaseOrder-saleorder'
       };
     },
     computed: {},
@@ -485,11 +496,12 @@
       },
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
-        return getTableList({
+        this.params = {
           pageNum: page,
           size: limit,
           ...where
-        });
+        };
+        return getTableList(this.params);
       },
 
       /* 刷新表格 */

+ 14 - 5
src/views/purchasingManage/supplierManage/index.vue

@@ -64,6 +64,11 @@
                   @click="uploadFile"
                   >导入</el-button
                 >
+                <exportButton
+                  fileName="供应商"
+                  apiUrl="/eom/contact/export"
+                  :params="params"
+                ></exportButton>
               </template>
 
               <template v-slot:name="{ row }">
@@ -167,6 +172,7 @@
   import { getPcTreeByPids } from '@/api/classifyManage';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import importDialog from '@/components/upload/import-dialog.vue';
+  import exportButton from '@/components/upload/exportButton.vue';
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -180,7 +186,9 @@
       ContactSearch,
       popModal,
       AddContactDialog,
-      ContactDetailDialog,importDialog
+      ContactDetailDialog,
+      importDialog,
+      exportButton
     },
     data() {
       return {
@@ -324,7 +332,8 @@
           label: 'name'
         },
         showEdit: true,
-        cacheKeyUrl: 'eos-f895878e-supplierManage'
+        cacheKeyUrl: 'eos-f895878e-supplierManage',
+        params: {}
       };
     },
     computed: {},
@@ -338,12 +347,13 @@
       },
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
-        return contactPage({
+        this.params = {
           pageNum: page,
           size: limit,
           type: 2,
           ...where
-        });
+        };
+        return contactPage(this.params);
       },
       async getTreeData() {
         try {
@@ -378,7 +388,6 @@
       },
       uploadFile() {
         this.$refs.importDialogRef.open();
-
       },
       openEdit(type, row) {
         this.current = row;

+ 22 - 13
src/views/saleManage/contact/contactList.vue

@@ -67,13 +67,18 @@
               申请
             </el-button>
             <el-button
-                  type="primary"
-                  size="small"
-                  icon="el-icon-upload2"
-                  plain
-                  @click="uploadFile"
-                  >导入</el-button
-                >
+              type="primary"
+              size="small"
+              icon="el-icon-upload2"
+              plain
+              @click="uploadFile"
+              >导入</el-button
+            >
+            <exportButton
+              fileName="客户"
+              apiUrl="/eom/contact/export"
+              :params="params"
+            ></exportButton>
           </template>
 
           <template v-slot:name="{ row }">
@@ -98,7 +103,6 @@
               修改
             </el-link>
 
-
             <el-popconfirm
               class="ele-action"
               title="确定要删除此信息吗?"
@@ -171,9 +175,10 @@
   import { mapGetters } from 'vuex';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import importDialog from '@/components/upload/import-dialog.vue';
+  import exportButton from '@/components/upload/exportButton.vue';
 
   export default {
-    mixins: [dictMixins,tabMixins],
+    mixins: [dictMixins, tabMixins],
     components: {
       processSubmitDialog,
       AssetTree,
@@ -181,12 +186,15 @@
       // popModal,
       AddContactDialog,
       ContactDetailDialog,
-      drawer,importDialog
+      drawer,
+      importDialog,
+      exportButton
     },
     data() {
       return {
         selection: [],
         defaultExpandedKeys: [],
+        params:{},
         delVisible: false,
         // 加载状态
         loading: false,
@@ -353,7 +361,7 @@
           label: 'name'
         },
         showEdit: true,
-        cacheKeyUrl:'eos-77c81132-saleManage-contact-staff',
+        cacheKeyUrl: 'eos-77c81132-saleManage-contact-staff'
       };
     },
     computed: {
@@ -366,13 +374,14 @@
     methods: {
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
-        return contactPage({
+        this.params={
           pageNum: page,
           size: limit,
           assignStatus: 0,
           type: 1,
           ...where
-        });
+        }
+        return contactPage( this.params);
       },
       async getTreeData() {
         try {

+ 23 - 14
src/views/saleManage/contact/contactListAdmin.vue

@@ -88,13 +88,18 @@
               批量释放
             </el-button>
             <el-button
-                  type="primary"
-                  size="small"
-                  icon="el-icon-upload2"
-                  plain
-                  @click="uploadFile"
-                  >导入</el-button
-                >
+              type="primary"
+              size="small"
+              icon="el-icon-upload2"
+              plain
+              @click="uploadFile"
+              >导入</el-button
+            >
+            <exportButton
+              fileName="客户"
+              apiUrl="/eom/contact/export"
+              :params="params"
+            ></exportButton>
           </template>
           <template v-slot:qrCode="{ row }">
             <el-link type="primary" :underline="false" @click="setCode(row)">
@@ -258,9 +263,10 @@
   import myqsCode from './components/qsCode.vue';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import importDialog from '@/components/upload/import-dialog.vue';
+  import exportButton from '@/components/upload/exportButton.vue';
 
   export default {
-    mixins: [dictMixins,tabMixins],
+    mixins: [dictMixins, tabMixins],
     components: {
       processSubmitDialog,
       AssetTree,
@@ -270,7 +276,9 @@
       ContactDetailDialog,
       assignDialog,
       drawer,
-      myqsCode,importDialog
+      myqsCode,
+      importDialog,
+      exportButton
     },
     data() {
       return {
@@ -278,7 +286,7 @@
         defaultExpandedKeys: [],
         delVisible: false,
         processSubmitDialogFlag: false,
-
+        params: {},
         // 加载状态
         loading: false,
         columns: [
@@ -337,7 +345,7 @@
             formatter: (_row, _column, cellValue) => {
               return (
                 (_row.addressName ? _row.addressName.replaceAll(',', '') : '') +
-                 ( _row.address || '')
+                (_row.address || '')
               );
             }
           },
@@ -454,7 +462,7 @@
           label: 'name'
         },
         showEdit: true,
-        cacheKeyUrl:'eos-ce5bbf85-saleManage-contact-admin',
+        cacheKeyUrl: 'eos-ce5bbf85-saleManage-contact-admin'
       };
     },
 
@@ -468,12 +476,13 @@
     methods: {
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
-        return contactPage({
+        this.params = {
           pageNum: page,
           size: limit,
           type: 1,
           ...where
-        });
+        };
+        return contactPage(this.params);
       },
       async getTreeData() {
         try {

+ 1 - 1
src/views/saleManage/saleOrder/components/addDialog.vue

@@ -342,7 +342,7 @@
               :max="form.totalAmount"
               clearable
               :disabled="!!form.contractId || !form.totalAmount"
-              v-model.number="form.payAmount"
+              v-model="form.payAmount"
               @input="discountInput"
               placeholder="请输入"
             >

+ 8 - 8
src/views/saleManage/saleOrder/index.vue

@@ -62,13 +62,11 @@
                   @click="uploadFile"
                   >导入</el-button
                 >
-                <el-button
-                  type="primary"
-                  size="small"
-                  icon="el-icon-download"
-                  @click="exportFn"
-                  >导出</el-button
-                >
+                <exportButton
+                  fileName="销售订单"
+                  apiUrl="/eom/saleorder/export"
+                  :params="params"
+                ></exportButton>
               </template>
 
               <!-- 查看详情列 -->
@@ -290,6 +288,7 @@
   import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import importDialog from '@/components/upload/import-dialog.vue';
+  import exportButton from '@/components/upload/exportButton.vue';
   export default {
     mixins: [dictMixins, tabMixins],
     components: {
@@ -311,7 +310,7 @@
       drawer,
       exceptionList,
       addInvoiceManage,
-      palletManagement,
+      palletManagement,exportButton,
       importDialog
     },
     //客户管理数据
@@ -649,6 +648,7 @@
         this.$refs.importDialogRef.open();
       },
       exportFn() {
+        console.log(this.params)
         exportSaleorder(this.params)
       }
     }

+ 109 - 32
src/views/salesServiceManagement/components/info.vue

@@ -69,15 +69,8 @@
         </el-form-item>
       </el-col>
       <el-col :span="8">
-        <el-form-item label="客户级别:" prop="level">
-          <DictSelection
-            dictName="供应商级别"
-            disabled
-            clearable
-            v-model="form.contractInfo.level"
-            placeholder=" "
-          >
-          </DictSelection>
+        <el-form-item label="报修地址:" prop="level">
+          <el-input v-model="form.contactAddress" />
         </el-form-item>
       </el-col>
     </el-row>
@@ -128,7 +121,6 @@
         >
           <el-input
             v-model="row.typeDescribe"
-          
             :disabled="type == 'view'"
           ></el-input>
         </el-form-item>
@@ -137,14 +129,13 @@
         <el-form-item :prop="`tableList.${$index}.useLocation`">
           <el-input
             v-model="row.useLocation"
-         
             :disabled="type == 'view'"
           ></el-input>
         </el-form-item>
       </template>
-      <template v-slot:attachmentsArray="{ row }">
+      <template v-slot:attachments="{ row }">
         <fileMain
-          v-model="row.attachmentsArray"
+          v-model="row.attachments"
           :type="type == 'view' ? 'view' : 'add'"
         ></fileMain>
       </template>
@@ -191,16 +182,48 @@
           v-model="row.contactPhone"
           placeholder="请输入"
           :disabled="type == 'view'"
-          maxlength="50"
         ></el-input>
       </template>
-
+      <template v-slot:post="{ row }">
+        <el-input
+          v-model="row.post"
+          placeholder="请输入"
+          :disabled="type == 'view'"
+        ></el-input>
+      </template>
+      <template v-slot:telephone="{ row }">
+        <el-input
+          v-model="row.telephone"
+          placeholder="请输入"
+          :disabled="type == 'view'"
+        ></el-input>
+      </template>
+      <template v-slot:email="{ row }">
+        <el-input
+          v-model="row.email"
+          placeholder="请输入"
+          :disabled="type == 'view'"
+        ></el-input>
+      </template>
+      <template v-slot:wechat="{ row }">
+        <el-input
+          v-model="row.wechat"
+          placeholder="请输入"
+          :disabled="type == 'view'"
+        ></el-input>
+      </template>
+      <template v-slot:deptName="{ row }">
+        <el-input
+          v-model="row.deptName"
+          placeholder="请输入"
+          :disabled="type == 'view'"
+        ></el-input>
+      </template>
       <template v-slot:remark="{ row }">
         <el-input
           v-model="row.remark"
           placeholder="请输入"
           :disabled="type == 'view'"
-          maxlength="50"
         ></el-input>
       </template>
     </ele-pro-table>
@@ -258,7 +281,37 @@
             slot: 'contactPhone',
             align: 'center'
           },
+          {
+            label: '电话',
+            prop: 'telephone',
+            slot: 'telephone',
+            align: 'center'
+          },
 
+          {
+            label: '微信号',
+            prop: 'wechat',
+            slot: 'wechat',
+            align: 'center'
+          },
+          {
+            label: '邮箱',
+            prop: 'email',
+            slot: 'email',
+            align: 'center'
+          },
+          {
+            label: '部门',
+            prop: 'deptName',
+            slot: 'deptName',
+            align: 'center'
+          },
+          {
+            label: '职务',
+            prop: 'post',
+            slot: 'post',
+            align: 'center'
+          },
           {
             label: '备注',
             prop: 'remark',
@@ -330,7 +383,7 @@
             align: 'center',
             showOverflowTooltip: true,
             formatter: (_row, _column, cellValue) => {
-              return _row.warrantyStatus==1?'质保期外':"质保期内"
+              return _row.warrantyStatus == 1 ? '质保期外' : '质保期内';
             }
           },
 
@@ -371,14 +424,14 @@
             align: 'center',
             showOverflowTooltip: true
           },
-          {
-            prop: 'useLocation',
-            label: '使用地点',
-            align: 'center',
-            slot: 'useLocation',
-            showOverflowTooltip: true,
-            width: 200
-          },
+          //   {
+          //     prop: 'useLocation',
+          //     label: '使用地点',
+          //     align: 'center',
+          //     slot: 'useLocation',
+          //     showOverflowTooltip: true,
+          //     width: 200
+          //   },
           {
             prop: 'type',
             slot: 'type',
@@ -396,8 +449,8 @@
             width: 400
           },
           {
-            prop: 'attachmentsArray',
-            slot: 'attachmentsArray',
+            prop: 'attachments',
+            slot: 'attachments',
             label: '附件',
             align: 'center',
             width: 120
@@ -413,8 +466,10 @@
         this.$set(this.form, 'orderCode', res.orderCode);
         this.$set(this.form, 'orderId', res.orderId);
         this.$set(this.form, 'contactInfoVOS', res.contactInfoVOS);
-
-        this.contactDetail(res.contactId);
+        if (res.contactAddress) {
+          this.$set(this.form, 'contactAddress', res.contactAddress);
+        }
+        this.contactDetail(res.contactId, 'init');
       },
       getValue() {
         return this.form;
@@ -429,15 +484,37 @@
         this.contactDetail(res.id);
       },
       //客户回调
-      async contactDetail(id) {
+      async contactDetail(id, type) {
         if (!id) {
           this.contractInfo = {};
           return;
         }
-        let { base } = await contactDetail(id);
+        let { base, other, linkList } = await contactDetail(id);
         base.contactName = base.name;
-        base.level = base.level && base.level + '';
+        let addressName = '';
+        if (other.addressName) {
+          addressName += other.addressName;
+        }
+        if (other.address) {
+          addressName += other.address;
+        }
+
         this.$set(this.form, 'contractInfo', base);
+
+        if (type != 'init') {
+          this.$set(this.form, 'contactAddress', addressName);
+          this.$set(
+            this.form,
+            'contactInfoVOS',
+            linkList.map((item) => {
+              item['contactName'] = item.linkName;
+              item['contactPhone'] = item.mobilePhone;
+              item['telephone'] = item.phone;
+              return item;
+            })
+          );
+        }
+
         // this.contractInfo = base;
       },
       //发货单选择

+ 32 - 25
src/views/salesServiceManagement/components/sparePartsList.vue

@@ -61,16 +61,16 @@
             :prop="'tableList.' + scope.$index + '.name'"
           >
             <el-input
-              v-if="scope.row.typeId != 2"
-              :disabled="type == 'view'"
+              :disabled="type == 'view'||scope.row.typeId == 2"
               v-model="scope.row.name"
+              style="width: calc(100% - 62px);"
             ></el-input>
 
-            <span v-if="scope.row.typeId == 2">{{ scope.row.name }}</span>
             <el-button
               v-if="scope.row.typeId == 2"
               size="small"
               type="primary"
+              style="margin-left: 4px;"
               @click.native="addEquipment(row, scope.$index)"
               >选择
             </el-button>
@@ -119,11 +119,12 @@
           <el-form-item
             style="margin-bottom: 20px"
             :prop="'tableList.' + scope.$index + '.measureQuantity'"
-          >
+          > 
             <el-input
-              v-model.number="scope.row.measureQuantity"
+              v-model="scope.row.measureQuantity"
               @input="measureQuantityChange(scope.$index)"
               :disabled="type == 'view'"
+              type="number"
             ></el-input>
           </el-form-item>
         </template>
@@ -148,9 +149,11 @@
             :prop="'tableList.' + scope.$index + '.singlePrice'"
           >
             <el-input
-              v-model.number="scope.row.singlePrice"
+              v-model="scope.row.singlePrice"
               @input="measureQuantityChange(scope.$index)"
               :disabled="type == 'view'"
+              type="number"
+
             ></el-input>
           </el-form-item>
         </template>
@@ -163,6 +166,14 @@
       :isAll="false"
     >
     </AssetsDialog>
+    <product-list
+      ref="productListRef"
+      classType="1"
+      :is-get-inventory-total="true"
+      @changeParent="confirmChoose"
+      :ids="[6]"
+     :isFirstRefreshTable="true"
+    ></product-list>
     <!-- <applyForSpare ref="edit" :inlet="1" /> -->
   </div>
 </template>
@@ -170,11 +181,13 @@
 <script>
   //   import applyForSpare from './applyForSpare.vue';
   import AssetsDialog from './AssetsDialog.vue';
+  import productList from '@/BIZComponents/product-list.vue';
+
 
   export default {
     components: {
       //   applyForSpare,
-      AssetsDialog
+      AssetsDialog,productList
     },
     props:{
         type:''
@@ -188,15 +201,15 @@
         typeIdList: [
           {
             label: '工时',
-            value: 1
+            value: '1'
           },
           {
             label: '零配件',
-            value: 2
+            value: '2'
           },
           {
             label: '差旅费',
-            value: 3
+            value: '3'
           }
         ],
         columnsDetail: [
@@ -229,7 +242,7 @@
             prop: 'name',
             label: '名称',
             align: 'center',
-            minWidth: 150,
+            minWidth: 200,
             slot: 'name',
             showOverflowTooltip: true
           },
@@ -315,7 +328,7 @@
       },
       addBank() {
         this.form.tableList.push({
-          typeId: 2,
+          typeId: '2',
           code: '',
           name: '',
           categoryModel: '',
@@ -329,7 +342,7 @@
       },
       addEquipment(row, index) {
         this.currentIndex = index;
-        this.$refs.selectStockLedgerDialogRef.open();
+        this.$refs.productListRef.open('', index);
       },
       getTableValue() {
         return this.form.tableList;
@@ -345,18 +358,12 @@
         this.$set(this.form.tableList[index],'settlementPrice',row.settlementPrice||0)
       },
       confirmChoose(data) {
-        this.$set(this.form.tableList, this.currentIndex, data);
-        this.$set(
-          this.form.tableList[this.currentIndex],
-          'code',
-          data.categoryCode
-        );
-        this.$set(
-          this.form.tableList[this.currentIndex],
-          'name',
-          data.categoryName
-        );
-        this.$set(this.form.tableList[this.currentIndex], 'typeId', 2);
+       
+        this.$set(this.form.tableList, this.currentIndex, data[0]);
+        this.$set(this.form.tableList[this.currentIndex],'categoryModel', data[0].modelType);
+        // this.$set(this.form.tableList, this.currentIndex, data[0]);
+
+        this.$set(this.form.tableList[this.currentIndex], 'typeId', '2');
         this.$forceUpdate();
       }
     }

+ 4 - 3
src/views/salesServiceManagement/demandList/components/addDialog.vue

@@ -6,6 +6,7 @@
     :title="title"
     :close-on-click-modal="false"
     width="85%"
+    :maxable="true"
     append-to-body
     :fullscreen="fullscreen"
     @close="handleClose"
@@ -60,12 +61,11 @@
       init(row, type) {
         this.addRepairNotesDialog = true;
         this.type = type;
-        console.log(this.type, 'this.type');
+        this.title = type=='add'?'新增':type=='view'?'详情':'修改';
         if (row?.id) {
-          this.title = '修改';
+         
           this.getDetail(row.id);
         } else {
-          this.title = '新增';
         }
       },
       async getDetail(id) {
@@ -94,6 +94,7 @@
             contactName: data.contractInfo.name,
             orderCode: data.orderCode,
             orderId: data.orderId,
+            contactAddress:data.contactAddress,
             productDetail: data.tableList.map((item) => {
               item['produceTime'] = item['produceTime'] || null;
               return item;

+ 18 - 10
src/views/salesServiceManagement/toDoList/components/addOrUpdateDialog.vue

@@ -6,7 +6,6 @@
     :title="title"
     :visible.sync="visible"
     :maxable="true"
-
     @close="handleClose"
   >
     <header-title title="计划基本信息"></header-title>
@@ -64,7 +63,18 @@
                 @input="formDataDurationTime"
                 :disabled="type == 'view'"
               >
-                <template #suffix>分钟</template>
+                <template #suffix>
+                  <el-select
+                    v-model="addForm.isSyncBill"
+                    size="small"
+                    style="width: 100%"
+                    :disabled="type == 'view'"
+                  >
+                    <el-option :value="1" label="分钟"></el-option>
+                    <el-option :value="2" label="小时"></el-option>
+                    <el-option :value="3" label="天"></el-option>
+                  </el-select>
+                </template>
               </el-input>
             </div>
           </el-form-item>
@@ -74,7 +84,7 @@
             <deptSelect
               v-model="addForm.executeGroupId"
               @changeGroup="searchDeptNodeClick"
-              :disabled="type == 'view'&&!isDispatch"
+              :disabled="type == 'view' && !isDispatch"
             />
           </el-form-item>
         </el-col>
@@ -86,7 +96,7 @@
               style="width: 100%"
               filterable
               @change="changeUser"
-              :disabled="type == 'view'&&!isDispatch"
+              :disabled="type == 'view' && !isDispatch"
             >
               <el-option
                 v-for="item in executorList"
@@ -196,7 +206,7 @@
         // 提交状态
         loading: false,
         type: 'add',
-        title:'',
+        title: '',
         isDispatch: false,
         detailList: []
       };
@@ -217,7 +227,7 @@
       // 初始化
       async init(row, type, isDispatch) {
         this.type = type;
-        this.title=isDispatch?'派单':type=='view'?'详情':'修改'
+        this.title = isDispatch ? '派单' : type == 'view' ? '详情' : '修改';
         this.isDispatch = isDispatch;
         if (row) {
           this.visible = true;
@@ -268,8 +278,7 @@
         });
       },
       save() {
-        this.addForm.costListVOS =
-          this.$refs.sparePartsRef.getTableValue();
+        this.addForm.costListVOS = this.$refs.sparePartsRef.getTableValue();
         this.$refs.addFormRef.validate(async (valid) => {
           if (valid) {
             let requestName = this.isDispatch
@@ -289,8 +298,7 @@
         this.addForm = res;
         this.$nextTick(() => {
           this.$refs.infoRef.init(res.afterSalesDemandVO);
-          this.$refs.sparePartsRef.setTableValue( res?.costListVOS || []);
-          
+          this.$refs.sparePartsRef.setTableValue(res?.costListVOS || []);
         });
       }
     }

+ 17 - 11
src/views/salesServiceManagement/workOrder/components/declarationDialog.vue

@@ -18,20 +18,22 @@
           range-separator="至"
           start-placeholder="实际开始日期"
           end-placeholder="实际结束日期"
-          :disabled="type=='view'"
+          :disabled="type == 'view'"
         >
         </el-date-picker>
       </el-form-item>
       <el-form-item label="附件:" prop="attachments">
-        <fileMain v-model="addForm.attachments" :type="type=='view'?'view':''"></fileMain>
+        <fileMain
+          v-model="addForm.attachments"
+          :type="type == 'view' ? 'view' : ''"
+        ></fileMain>
       </el-form-item>
       <el-form-item label="备注:" prop="reason">
         <el-input
           type="textarea"
           placeholder="请输入内容"
           v-model="addForm.reason"
-          :disabled="type=='view'"
-
+          :disabled="type == 'view'"
         >
         </el-input>
       </el-form-item>
@@ -42,7 +44,9 @@
     <header-title title="方案"></header-title>
     <spareParts ref="sparePartsRef" :type="type"></spareParts>
     <div slot="footer" class="footer">
-      <el-button type="primary" @click="submitAdd" v-if="type!='view'">提交</el-button>
+      <el-button type="primary" @click="submitAdd" v-if="type != 'view'"
+        >提交</el-button
+      >
       <el-button @click="handleClose">取消</el-button>
     </div>
   </ele-modal>
@@ -74,20 +78,20 @@
           reason: ''
         },
         row: {},
-        type:'add'
+        type: 'add'
       };
     },
     created() {},
     methods: {
-      open(row,type) {
-        this.row = row;
+      open(row, type) {
         this.visibleDialog = true;
-        this.type=type
+        this.type = type;
         this.getDetail(row);
       },
       async getDetail(row) {
-        console.log(row,'row')
+        console.log(row, 'row');
         const res = await getSalesWorkOrderById(row.id);
+        this.addForm=res
         this.$nextTick(() => {
           this.$refs.infoRef.init(res.afterSalesDemandVO);
           this.$refs.sparePartsRef.setTableValue(res?.costListVOS || []);
@@ -100,7 +104,9 @@
               acceptTime: this.addForm.time[0],
               finishTime: this.addForm.time[1],
               attachments: this.addForm.attachments,
-              reason: this.addForm.reason
+              id:this.addForm.id,
+              reason: this.addForm.reason,
+              costListVOS: this.$refs.sparePartsRef.getTableValue()
             }).then((res) => {
               if (!res) return;
               this.$message.success('操作成功');