yusheng 1 год назад
Родитель
Сommit
388b1be48d

+ 28 - 12
src/views/contractManage/contractChange/components/addOrEditDialog.vue

@@ -9,14 +9,27 @@
     width="1000px"
     :before-close="cancel"
   >
+    <div class="switch_left" v-if="dialogType=='view'">
+      <ul>
+        <li
+          v-for="item in tabOptions"
+          :key="item.key"
+          :class="{ active: activeComp == item.key }"
+          @click="activeComp = item.key"
+        >
+          {{ item.name }}
+        </li>
+      </ul>
+    </div>
     <el-form
+      v-show="activeComp=='main'"
       ref="form"
       :rules="rules"
       class="el-form-box"
       :model="form"
       label-width="90px"
+      style="margin-top:15px"
     >
-      <headerTitle title="基本信息"></headerTitle>
       <el-row>
         <el-col :span="12" v-if="dialogType != 'add'">
           <el-form-item label="编码" prop="code">
@@ -24,11 +37,6 @@
           </el-form-item>
         </el-col>
 
-        <!-- <el-col :span="12">
-          <el-form-item label="名称" prop="name">
-            <el-input v-model="form.name"></el-input>
-          </el-form-item>
-        </el-col> -->
         <el-col :span="12">
           <el-form-item label="变更合同" prop="contractName">
             <el-input
@@ -39,8 +47,8 @@
           </el-form-item>
         </el-col>
         <el-col :span="12">
-          <el-form-item label="附件" prop="files">
-            <fileMain v-model="form.files"></fileMain>
+          <el-form-item label="附件" prop="file">
+            <fileMain v-model="form.file"></fileMain>
           </el-form-item>
         </el-col>
         <el-col :span="24">
@@ -73,14 +81,15 @@
   import { mapGetters } from 'vuex';
   import {
     addInformation,
-    UpdateInformation,getDetail
+    UpdateInformation,
+    getDetail
   } from '@/api/contractManage/contractChange.js';
   import fileMain from '@/components/addDoc/index.vue';
   import contractListDialog from '@/views/saleManage/saleOrder/components/contractListDialog.vue';
   const defForm = {
     name: '',
     code: '',
-    files: [], //条件
+    file: [], //条件
     remark: '',
     type: '',
     describes: '',
@@ -94,6 +103,11 @@
     },
     data() {
       return {
+        activeComp: 'main',
+        tabOptions: [
+          { key: 'main', name: '变更详情' },
+          { key: 'bpm', name: '流程详情' }
+        ],
         addOrEditDialogFlag: false,
         dialogType: '',
         title: '',
@@ -111,10 +125,10 @@
       //初始化
       async open(row = {}, type) {
         this.addOrEditDialogFlag = true;
-        this.title = type == 'add' ? '新增' : '修改';
+        this.title = type == 'add' ? '新增' :type == 'view' ? '详情' : '修改';
         this.dialogType = type;
         if (type !== 'add') {
-          this.getInfo(row.id)
+          this.getInfo(row.id);
         }
       },
       selectContract() {
@@ -125,6 +139,8 @@
       changeContract(data) {
         this.$set(this.form, 'contractName', data.contractName);
         this.$set(this.form, 'contractId', data.id);
+        this.$set(this.form, 'contractNo', data.contractNo);
+        this.$set(this.form, 'contractNumber', data.contractNumber);
         console.log(this.form);
       },
       //获取详情

+ 7 - 7
src/views/contractManage/contractChange/index.vue

@@ -114,12 +114,12 @@
     computed: {
       columns() {
         return [
-          {
-            width: 45,
-            type: 'selection',
-            columnKey: 'selection',
-            align: 'center'
-          },
+          // {
+          //   width: 45,
+          //   type: 'selection',
+          //   columnKey: 'selection',
+          //   align: 'center'
+          // },
           {
             width: 60,
             label: '序号',
@@ -225,7 +225,7 @@
       },
 
       remove(row) {
-        deleteInformation([row.id]).then((res) => {
+        deleteInformation(row).then((res) => {
           this.$message.success('删除成功!');
           this.reload();
         });

+ 9 - 6
src/views/financialManage/components/customerListDialog.vue

@@ -112,9 +112,10 @@ export default {
             showOverflowTooltip: true,
             minWidth: 120,
             formatter: (_row, _column, cellValue) => {
-              let addr = '' + _row.addressName ? _row.addressName.replaceAll(',', '') : '';
-              addr += _row.address ? _row.address : '';
-              return addr;
+              return (
+                (_row.addressName ? _row.addressName.replaceAll(',', '') : '') +
+                 ( _row.address || '')
+              );
             }
           },
           {
@@ -124,9 +125,11 @@ export default {
             showOverflowTooltip: true,
             minWidth: 120,
             formatter: (_row, _column, cellValue) => {
-              let addr = '' + _row.otherAddressName ? _row.otherAddressName.replaceAll(',', '') : '';
-              addr += _row.otherAddress ? _row.otherAddress : '';
-              return addr;
+              return (
+                (_row.otherAddressName
+                  ? _row.otherAddressName.replaceAll(',', '')
+                  : '') + (_row.otherAddress || '')
+              );
             }
           },
           {

+ 2 - 2
src/views/financialManage/payableManage/components/infoTable.vue

@@ -39,7 +39,7 @@
         </template>
 
         <template v-slot:action="{ row, $index }">
-          <el-link
+          <!-- <el-link
             v-if="
               dialogType == 'view' && !row.invoiceStatus && !form.invoiceCode
             "
@@ -48,7 +48,7 @@
             @click="addInvoice(row)"
           >
             新增发票
-          </el-link>
+          </el-link> -->
           <el-popconfirm
             class="ele-action"
             title="确定要删除此信息吗?"

+ 225 - 0
src/views/financialManage/receivableManage/components/receivableDialog.vue

@@ -0,0 +1,225 @@
+<template>
+  <ele-modal
+    custom-class="ele-dialog-form long-dialog-form"
+    :centered="true"
+    :visible.sync="receivableDialogFlag"
+    :title="title"
+    :append-to-body="true"
+    :close-on-click-modal="false"
+    width="60%"
+    :before-close="cancel"
+  >
+
+    <!-- 数据表格 -->
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="datasource"
+      tool-class="ele-toolbar-form"
+      cache-key="eomContactPageTable"
+      :page-size="20"
+    >
+      <!-- 操作 -->
+      <template v-slot:action="{ row }">
+        <el-link
+          type="primary"
+          :underline="false"
+          icon="el-icon-plus"
+          @click="handleDetail(row, 'view')"
+        >
+          新增发票
+        </el-link>
+      </template>
+    </ele-pro-table>
+    <detail-dialog
+      ref="detailDialogRef"
+      v-if="detailDialogFlag"
+      :detail-dialog-flag.sync="detailDialogFlag"
+      @done="done"
+      :isPay="true"
+  
+    ></detail-dialog>
+    <div slot="footer">
+      <el-button @click="cache">返回</el-button>
+    </div>
+  </ele-modal>
+</template>
+<script>
+  import { finReceivablePageListAPI } from '@/api/financialManage/receivableManage';
+  import detailDialog from './detailDialog.vue';
+  export default {
+    name: 'collectionDialog',
+    components: { detailDialog },
+    computed: {
+      columns() {
+        return [
+          {
+            width: 60,
+            label: '序号',
+            type: 'index',
+            columnKey: 'index',
+            align: 'center'
+          },
+          {
+            minWidth: 130,
+            prop: 'code',
+            label: '应收编码',
+            align: 'center',
+            slot: 'code',
+            showOverflowTooltip: true
+          },
+
+          {
+            minWidth: 130,
+            prop: 'contactName',
+            label: '单位名称',
+            align: 'center',
+            slot: 'contactName',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 140,
+            prop: 'receivableDate',
+            label: '应收日期',
+            slot: 'receivableDate',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'receivableTotalPrice',
+            label: '应收金额',
+            align: 'center',
+            slot: 'receivableTotalPrice',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'receivedTotalPrice',
+            label: '已收金额',
+            align: 'center',
+            slot: 'receivedTotalPrice',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'unreceiveTotalPrice',
+            label: '未收金额',
+            align: 'center',
+            slot: 'unreceiveTotalPrice',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'sourceCode',
+            label: '来源编码',
+            align: 'center',
+            slot: 'sourceCode',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'accountingSubjectName',
+            label: '会计科目',
+            align: 'center',
+            slot: 'accountingSubjectName',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'status',
+            label: '收款状态',
+            align: 'center',
+            slot: 'status',
+            showOverflowTooltip: true,
+            formatter: (_row, _column, cellValue) => {
+              return this.statusList.find((item) => item.value === cellValue)
+                .label;
+            }
+          },
+          {
+            minWidth: 130,
+            prop: 'remark',
+            label: '备注',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            slot: 'createTime',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            slot: 'createTime',
+            showOverflowTooltip: true
+          },
+
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 150,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true,
+            fixed: 'right'
+          }
+        ];
+      }
+    },
+    data() {
+      return {
+        detailDialogFlag: false,
+        statusList: [
+          {
+            label: '未收款',
+            value: 0
+          },
+          {
+            label: '部分收款',
+            value: 1
+          },
+          {
+            label: '已收全款',
+            value: 2
+          }
+        ]
+      };
+    },
+    created() {},
+    methods: {
+      handleDetail(row = {}, type) {
+        this.detailDialogFlag = true;
+        this.$nextTick(() => {
+          this.$refs.detailDialogRef.init(row.id);
+        });
+      },
+
+      done(data){
+
+        this.$emit('payableManage',data)
+        this.cache()
+      },
+      cache(){
+        this.$emit('update:receivableDialogFlag', false)
+      },
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return finReceivablePageListAPI({
+          pageNum: page,
+          size: limit,
+          approvalStatus:2,
+          ...where
+        });
+      }
+    }
+  };
+</script>
+<style scoped lang="scss"></style>

+ 10 - 0
src/views/purchasingManage/purchaseOrder/accountstatement/components/purchaseForm.vue

@@ -112,6 +112,16 @@
           </el-select>
         </el-form-item>
       </el-col>
+      <el-col :span="12" v-if="dialogType == 'view'">
+        <el-form-item prop="createUserName" label="对账人">
+          <el-input disabled v-model="dataForm.createUserName"></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col :span="12" v-if="dialogType == 'view'">
+        <el-form-item prop="createTime" label="对账时间">
+          <el-input disabled v-model="dataForm.createTime"></el-input>
+        </el-form-item>
+      </el-col>
     </el-row>
     <el-row  v-if="dialogType=='view'">
       <el-col :span="12">

+ 11 - 7
src/views/purchasingManage/purchaseOrder/accountstatement/index.vue

@@ -221,13 +221,17 @@ export default {
           showOverflowTooltip: true,
           minWidth: 180,
         },
-        // {
-        //   prop: 'projectName',
-        //   label: '项目名称',
-        //   align: 'center',
-        //   showOverflowTooltip: true,
-        //   minWidth: 200,
-        // },
+        {
+          prop: 'dateType',
+          label: '对账方式',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 150,
+          formatter: (_row, _column, cellValue) => {
+            return cellValue==1?'按年度':cellValue==2?'按季度':cellValue==3?'按月度':'按时间段'
+          }
+        },
+
         {
           prop: 'startDate',
           label: '对账开始日期',

+ 8 - 11
src/views/purchasingManage/supplierManage/components/parentList.vue

@@ -125,12 +125,10 @@
             showOverflowTooltip: true,
             minWidth: 120,
             formatter: (_row, _column, cellValue) => {
-              let addr =
-                '' + _row.addressName
-                  ? _row.addressName.replaceAll(',', '')
-                  : '';
-              addr += _row.address ? _row.address : '';
-              return addr;
+              return (
+                (_row.addressName ? _row.addressName.replaceAll(',', '') : '') +
+                 ( _row.address || '')
+              );
             }
           },
           {
@@ -140,12 +138,11 @@
             showOverflowTooltip: true,
             minWidth: 120,
             formatter: (_row, _column, cellValue) => {
-              let addr =
-                '' + _row.otherAddressName
+              return (
+                (_row.otherAddressName
                   ? _row.otherAddressName.replaceAll(',', '')
-                  : '';
-              addr += _row.otherAddress ? _row.otherAddress : '';
-              return addr;
+                  : '') + (_row.otherAddress || '')
+              );
             }
           },
           {

+ 9 - 9
src/views/purchasingManage/supplierManage/index.vue

@@ -222,12 +222,10 @@
             showOverflowTooltip: true,
             minWidth: 120,
             formatter: (_row, _column, cellValue) => {
-              let addr =
-                '' + _row.addressName
-                  ? _row.addressName.replaceAll(',', '')
-                  : '';
-              addr += _row.address ? _row.address : '';
-              return addr;
+              return (
+                (_row.addressName ? _row.addressName.replaceAll(',', '') : '') +
+                 ( _row.address || '')
+              );
             }
           },
           {
@@ -237,9 +235,11 @@
             showOverflowTooltip: true,
             minWidth: 120,
             formatter: (_row, _column, cellValue) => {
-              let addr = '' + _row.otherAddressName ? _row.otherAddressName.replaceAll(',', '') : '';
-              addr += _row.otherAddress ? _row.otherAddress : '';
-              return addr;
+              return (
+                (_row.otherAddressName
+                  ? _row.otherAddressName.replaceAll(',', '')
+                  : '') + (_row.otherAddress || '')
+              );
             }
           },
           {

+ 9 - 9
src/views/saleManage/contact/contactList.vue

@@ -253,12 +253,10 @@
             showOverflowTooltip: true,
             minWidth: 120,
             formatter: (_row, _column, cellValue) => {
-              let addr =
-                '' + _row.addressName
-                  ? _row.addressName.replaceAll(',', '')
-                  : '';
-              addr += _row.address ? _row.address : '';
-              return addr;
+              return (
+                (_row.addressName ? _row.addressName.replaceAll(',', '') : '') +
+                 ( _row.address || '')
+              );
             }
           },
           {
@@ -268,9 +266,11 @@
             showOverflowTooltip: true,
             minWidth: 120,
             formatter: (_row, _column, cellValue) => {
-              let addr = '' + _row.otherAddressName ? _row.otherAddressName.replaceAll(',', '') : '';
-              addr += _row.otherAddress ? _row.otherAddress : '';
-              return addr;
+              return (
+                (_row.otherAddressName
+                  ? _row.otherAddressName.replaceAll(',', '')
+                  : '') + (_row.otherAddress || '')
+              );
             }
           },
           {

+ 9 - 9
src/views/saleManage/contact/contactListAdmin.vue

@@ -317,12 +317,10 @@
             showOverflowTooltip: true,
             minWidth: 120,
             formatter: (_row, _column, cellValue) => {
-              let addr =
-                '' + _row.addressName
-                  ? _row.addressName.replaceAll(',', '')
-                  : '';
-              addr += _row.address ? _row.address : '';
-              return addr;
+              return (
+                (_row.addressName ? _row.addressName.replaceAll(',', '') : '') +
+                 ( _row.address || '')
+              );
             }
           },
           {
@@ -332,9 +330,11 @@
             showOverflowTooltip: true,
             minWidth: 120,
             formatter: (_row, _column, cellValue) => {
-              let addr = '' + _row.otherAddressName ? _row.otherAddressName.replaceAll(',', '') : '';
-              addr += _row.otherAddress ? _row.otherAddress : '';
-              return addr;
+              return (
+                (_row.otherAddressName
+                  ? _row.otherAddressName.replaceAll(',', '')
+                  : '') + (_row.otherAddress || '')
+              );
             }
           },
           {

+ 8 - 11
src/views/saleManage/contact/index.vue

@@ -328,12 +328,10 @@
             showOverflowTooltip: true,
             minWidth: 120,
             formatter: (_row, _column, cellValue) => {
-              let addr =
-                '' + _row.addressName
-                  ? _row.addressName.replaceAll(',', '')
-                  : '';
-              addr += _row.address ? _row.address : '';
-              return addr;
+              return (
+                (_row.addressName ? _row.addressName.replaceAll(',', '') : '') +
+                 ( _row.address || '')
+              );
             }
           },
           {
@@ -343,12 +341,11 @@
             showOverflowTooltip: true,
             minWidth: 120,
             formatter: (_row, _column, cellValue) => {
-              let addr =
-                '' + _row.otherAddressName
+              return (
+                (_row.otherAddressName
                   ? _row.otherAddressName.replaceAll(',', '')
-                  : '';
-              addr += _row.otherAddress ? _row.otherAddress : '';
-              return addr;
+                  : '') + (_row.otherAddress || '')
+              );
             }
           },
           {

+ 178 - 165
src/views/saleManage/saleOrder/accountstatement/components/saleForm.vue

@@ -5,7 +5,7 @@
       <el-col :span="12">
         <el-form-item label="来源类型" prop="sourceType">
           <el-select
-            :disabled="dialogType == 'view'|| !!saleOrderData?.id"
+            :disabled="dialogType == 'view' || !!saleOrderData?.id"
             clearable
             class="ele-block"
             v-model="dataForm.sourceType"
@@ -39,7 +39,7 @@
           v-if="dataForm.sourceType == 3"
         >
           <el-input
-            :disabled="dialogType == 'view'|| !!saleOrderData?.id"
+            :disabled="dialogType == 'view' || !!saleOrderData?.id"
             v-model="dataForm.orderNo"
             @click.native="handleGetOrd"
           ></el-input>
@@ -155,11 +155,21 @@
           </el-select>
         </el-form-item>
       </el-col>
+      <el-col :span="12" v-if="dialogType == 'view'">
+        <el-form-item prop="createUserName" label="对账人">
+          <el-input disabled v-model="dataForm.createUserName"></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col :span="12" v-if="dialogType == 'view'">
+        <el-form-item prop="createTime" label="对账时间">
+          <el-input disabled v-model="dataForm.createTime"></el-input>
+        </el-form-item>
+      </el-col>
     </el-row>
     <el-row v-if="dialogType == 'view'">
       <el-col :span="12">
         <el-form-item prop="repliedFiles" label="回执附件">
- 
+          <fileMain v-model="dataForm.repliedFiles" type="view"></fileMain>
         </el-form-item>
       </el-col>
     </el-row>
@@ -180,177 +190,180 @@
   </el-form>
 </template>
 <script xmlns:el-col="http://www.w3.org/1999/html">
-import parentList from '@/views/saleManage/contact/components/parentList.vue';
-import OrderListDialog from '@/views/saleManage/saleOrder/accountstatement/components/orderListDialog.vue';
-import { getFile } from '@/api/system/file';
+  import parentList from '@/views/saleManage/contact/components/parentList.vue';
+  import OrderListDialog from '@/views/saleManage/saleOrder/accountstatement/components/orderListDialog.vue';
+  import { getFile } from '@/api/system/file';
 
-export default {
-  name: 'saleForm',
-  components: { OrderListDialog, parentList },
-  //客户管理数据
-  props: {
-    dataForm: {
-      type: Object,
-      default: () => {
-        return {};
-      }
-    },
-    datasource: {
-      type: Object,
-      default: () => {
-        return [];
-      }
-    },
-    dialogType: '',
-    contactData: {
-      type: Object,
-      default: () => {
-        return {};
-      }
-    },
-    saleOrderData: {
-      type: Object,
-      default: () => {
-        return {};
-      }
-    }
-  },
-  data() {
-    return {
-      monthByDays: {},
-      quarterList: {
-        一季度: ['-01-01 00:00:00', '-03-31 23:59:59'],
-        二季度: ['-04-01 00:00:00', '-06-30 23:59:59'],
-        三季度: ['-07-01 00:00:00', '-09-30 23:59:59'],
-        四季度: ['-10-01 00:00:00', '-12-31 23:59:59']
+  export default {
+    name: 'saleForm',
+    components: { OrderListDialog, parentList },
+    //客户管理数据
+    props: {
+      dataForm: {
+        type: Object,
+        default: () => {
+          return {};
+        }
       },
-      startTime: '-01-01 00:00:00',
-      endTime: '23:59:59',
-      rules: {
-        sourceType: { required: true, message: '请选择', trigger: 'change' },
-        contactId: { required: true, message: '请选择', trigger: 'change' },
-        projectId: { required: true, message: '请选择', trigger: 'change' },
-        orderId: { required: true, message: '请选择', trigger: 'change' },
-        dateType: { required: true, message: '请选择', trigger: 'change' },
-        year: { required: true, message: '请选择', trigger: 'change' },
-        quarter: { required: true, message: '请选择', trigger: 'change' },
-        month: { required: true, message: '请选择', trigger: 'change' },
-        dateTimeRange: { required: true, message: '请选择', trigger: 'change' }
-      }
-    };
-  },
-  methods: {
-    //查询
-    handleSearch() {
-      //
-      switch (this.dataForm.dateType) {
-        case 1:
-          this.dataForm.dateValue = this.dataForm.year;
-          this.dataForm.startDate = this.dataForm.year + this.startTime;
-          this.dataForm.endDate = this.dataForm.year + '-12-31 23:59:59';
-          break;
-        case 2:
-          this.dataForm.dateValue =
-            this.dataForm.year + '年-' + this.dataForm.quarter;
-          this.dataForm.startDate =
-            this.dataForm.year + this.quarterList[this.dataForm.quarter][0];
-          this.dataForm.endDate =
-            this.dataForm.year + this.quarterList[this.dataForm.quarter][1];
-          break;
-        case 3:
-          this.dataForm.dateValue = this.dataForm.month;
-          this.dataForm.startDate = this.dataForm.month + '-01 00:00:00';
-          let data = this.dataForm.month.split('-');
-          let days = new Date(data[0], data[1], 0).getDate();
-          this.dataForm.endDate =
-            this.dataForm.month + '-' + days + ' 23:59:59';
-          break;
-        default:
-          this.dataForm.dateValue = '';
-          this.dataForm.startDate =
-            this.dataForm.dateTimeRange[0] + ' 00:00:00';
-          this.dataForm.endDate = this.dataForm.dateTimeRange[1] + ' 23:59:59';
+      datasource: {
+        type: Object,
+        default: () => {
+          return [];
+        }
+      },
+      dialogType: '',
+      contactData: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      },
+      saleOrderData: {
+        type: Object,
+        default: () => {
+          return {};
+        }
       }
-      this.$refs.form.validate((validate) => {
-        if (!validate) return;
-        this.$emit('handleSearch', this.dataForm);
-      });
-    },
-    //
-    getDays() {},
-    //获取客户信息
-    handleGetCus() {
-      let item = { id: this.dataForm.contactId };
-      this.$refs.parentRef.open(item);
-    },
-    //选择客户信息回调
-    getCusInfo(obj) {
-      let params = Object.assign({}, this.dataForm, {
-        contactId: obj.id,
-        contactName: obj.name,
-        sourceName: obj.name,
-        sourceId: obj.id
-      });
-      this.$emit('update:dataForm', params);
-      this.reloadTableData();
-    },
-    //获取订单信息
-    handleGetOrd() {
-      let item = { id: this.dataForm.orderId };
-      this.$refs.orderListDialogRef.open(item);
     },
-    //选择订单信息回调
-    getOrderInfo(obj) {
-      this.dataForm.sourceType=3
-      let params = Object.assign({}, this.dataForm, {
-        orderId: obj.id,
-        orderNo: obj.orderNo,
-        contactId: obj.partaId,
-        contactName: obj.partaName,
-        sourceName: obj.orderNo,
-        sourceId: obj.id
-      });
-      this.$emit('update:dataForm', params);
-      this.reloadTableData();
+    data() {
+      return {
+        monthByDays: {},
+        quarterList: {
+          一季度: ['-01-01 00:00:00', '-03-31 23:59:59'],
+          二季度: ['-04-01 00:00:00', '-06-30 23:59:59'],
+          三季度: ['-07-01 00:00:00', '-09-30 23:59:59'],
+          四季度: ['-10-01 00:00:00', '-12-31 23:59:59']
+        },
+        startTime: '-01-01 00:00:00',
+        endTime: '23:59:59',
+        rules: {
+          sourceType: { required: true, message: '请选择', trigger: 'change' },
+          contactId: { required: true, message: '请选择', trigger: 'change' },
+          projectId: { required: true, message: '请选择', trigger: 'change' },
+          orderId: { required: true, message: '请选择', trigger: 'change' },
+          dateType: { required: true, message: '请选择', trigger: 'change' },
+          year: { required: true, message: '请选择', trigger: 'change' },
+          quarter: { required: true, message: '请选择', trigger: 'change' },
+          month: { required: true, message: '请选择', trigger: 'change' },
+          dateTimeRange: {
+            required: true,
+            message: '请选择',
+            trigger: 'change'
+          }
+        }
+      };
     },
-    //切换来源类型重置数据
-    handleChange(val) {
-      let params = Object.assign(
-        {},
-        {
-          ...this.dataForm,
-          orderNo: '',
-          orderId: '',
-          contactId: '',
-          contactName: '',
-          sourceName: '',
-          sourceId: ''
+    methods: {
+      //查询
+      handleSearch() {
+        //
+        switch (this.dataForm.dateType) {
+          case 1:
+            this.dataForm.dateValue = this.dataForm.year;
+            this.dataForm.startDate = this.dataForm.year + this.startTime;
+            this.dataForm.endDate = this.dataForm.year + '-12-31 23:59:59';
+            break;
+          case 2:
+            this.dataForm.dateValue =
+              this.dataForm.year + '年-' + this.dataForm.quarter;
+            this.dataForm.startDate =
+              this.dataForm.year + this.quarterList[this.dataForm.quarter][0];
+            this.dataForm.endDate =
+              this.dataForm.year + this.quarterList[this.dataForm.quarter][1];
+            break;
+          case 3:
+            this.dataForm.dateValue = this.dataForm.month;
+            this.dataForm.startDate = this.dataForm.month + '-01 00:00:00';
+            let data = this.dataForm.month.split('-');
+            let days = new Date(data[0], data[1], 0).getDate();
+            this.dataForm.endDate =
+              this.dataForm.month + '-' + days + ' 23:59:59';
+            break;
+          default:
+            this.dataForm.dateValue = '';
+            this.dataForm.startDate =
+              this.dataForm.dateTimeRange[0] + ' 00:00:00';
+            this.dataForm.endDate =
+              this.dataForm.dateTimeRange[1] + ' 23:59:59';
         }
-      );
+        this.$refs.form.validate((validate) => {
+          if (!validate) return;
+          this.$emit('handleSearch', this.dataForm);
+        });
+      },
+      //
+      getDays() {},
+      //获取客户信息
+      handleGetCus() {
+        let item = { id: this.dataForm.contactId };
+        this.$refs.parentRef.open(item);
+      },
+      //选择客户信息回调
+      getCusInfo(obj) {
+        let params = Object.assign({}, this.dataForm, {
+          contactId: obj.id,
+          contactName: obj.name,
+          sourceName: obj.name,
+          sourceId: obj.id
+        });
+        this.$emit('update:dataForm', params);
+        this.reloadTableData();
+      },
+      //获取订单信息
+      handleGetOrd() {
+        let item = { id: this.dataForm.orderId };
+        this.$refs.orderListDialogRef.open(item);
+      },
+      //选择订单信息回调
+      getOrderInfo(obj) {
+        this.dataForm.sourceType = 3;
+        let params = Object.assign({}, this.dataForm, {
+          orderId: obj.id,
+          orderNo: obj.orderNo,
+          contactId: obj.partaId,
+          contactName: obj.partaName,
+          sourceName: obj.orderNo,
+          sourceId: obj.id
+        });
+        this.$emit('update:dataForm', params);
+        this.reloadTableData();
+      },
+      //切换来源类型重置数据
+      handleChange(val) {
+        let params = Object.assign(
+          {},
+          {
+            ...this.dataForm,
+            orderNo: '',
+            orderId: '',
+            contactId: '',
+            contactName: '',
+            sourceName: '',
+            sourceId: ''
+          }
+        );
 
-      this.$emit('update:dataForm', params);
-      this.reloadTableData();
-      if (val == 1 && this.contactData.id) {
-        this.getCusInfo(this.contactData);
+        this.$emit('update:dataForm', params);
+        this.reloadTableData();
+        if (val == 1 && this.contactData.id) {
+          this.getCusInfo(this.contactData);
+        }
+      },
+      reloadTableData() {
+        this.$emit('update:datasource', []);
+      },
+      downloadFile(file) {
+        getFile({ objectName: file.storePath }, file.name);
       }
     },
-    reloadTableData() {
-      this.$emit('update:datasource', []);
-    },
-    downloadFile(file) {
-      getFile({ objectName: file.storePath }, file.name);
+    mounted() {
+      // const year = new Date().getFullYear(); // 获取当前年份
+      // for (let i = 0; i < 12; i++) {
+      //   // 获取指定月份的天数
+      //   this.monthByDays[i + 1] = new Date(year, i + 1, 0).getDate()
+      // }
     }
-  },
-  mounted() {
-    // const year = new Date().getFullYear(); // 获取当前年份
-    // for (let i = 0; i < 12; i++) {
-    //   // 获取指定月份的天数
-    //   this.monthByDays[i + 1] = new Date(year, i + 1, 0).getDate()
-    // }
-  }
-};
+  };
 </script>
 
-
-<style scoped lang="scss">
-</style>
+<style scoped lang="scss"></style>

+ 10 - 0
src/views/saleManage/saleOrder/accountstatement/index.vue

@@ -279,6 +279,16 @@
             showOverflowTooltip: true,
             minWidth: 180
           },
+          {
+          prop: 'dateType',
+          label: '对账方式',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 150,
+          formatter: (_row, _column, cellValue) => {
+            return cellValue==1?'按年度':cellValue==2?'按季度':cellValue==3?'按月度':'按时间段'
+          }
+        },
           {
             prop: 'startDate',
             label: '对账开始日期',