Răsfoiți Sursa

Merge branch 'master' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-wt

lucw 8 luni în urmă
părinte
comite
79a70a61f9

+ 11 - 0
src/BIZComponents/processSubmitDialog/api.js

@@ -75,3 +75,14 @@ export async function listSimpleUserGroups() {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+/**
+ * 获取客户信息列表
+ */
+export async function contactPageUsages(params) {
+  const res = await request.get(`/eom/contact/page2Usages`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 104 - 0
src/BIZComponents/processSubmitDialog/components/contactSearch.vue

@@ -0,0 +1,104 @@
+<!-- 搜索表单 -->
+<template>
+  <seekPage :seekList="seekList" :formLength="3" @search="search"></seekPage>
+</template>
+<script>
+  import { reviewStatusSelect } from '@/enum/dict';
+  export default {
+    data() {
+      return {};
+    },
+    computed: {
+      // 表格列配置
+      seekList() {
+        return [
+        {
+            label: '关键字:',
+            value: 'searchName',
+            type: 'input',
+            placeholder: '编码/代号/客户名称/联系人电话'
+          },
+          {
+            label: '编码/代号:',
+            value: 'codeOrSerialNo',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '客户名称:',
+            value: 'name',
+            type: 'input',
+            placeholder: '请输入',
+          },
+          // {
+          //   label: '电话:',
+          //   value: 'phone',
+          //   width: 380,
+          //   type: 'input',
+          //   placeholder: '请输入'
+          // },
+          // {
+          //   label: '注册地址:',
+          //   value: 'addressName',
+          //   width: 380,
+          //   type: 'input',
+          //   placeholder: '请输入'
+          // },
+          // {
+          //   label: '联系地址:',
+          //   value: 'otherAddressName',
+          //   width: 380,
+          //   type: 'input',
+          //   placeholder: '请输入'
+          // },
+          // {
+          //   label: '联系人:',
+          //   value: 'linkName',
+          //   width: 380,
+          //   type: 'input',
+          //   placeholder: '请输入'
+          // },
+          // {
+          //   label: '状态',
+          //   value: 'targetTime',
+          //   width: 380,
+          //   type: 'select',
+          //   placeholder: '请选择状态',
+          //   planList:reviewStatusSelect
+          // },
+          // {
+          //   label: '部门:',
+          //   value: 'assessmentObject',
+          //   width: 380,
+          //   type: 'input',
+          //   placeholder: '请输入',
+          // },
+          // {
+          //   label: '创建人:',
+          //   value: 'createUsername',
+          //   width: 380,
+          //   type: 'input',
+          //   placeholder: '请输入姓名'
+          // },
+          {
+            label: '创建时间:',
+            value: 'createTime',
+            type: 'date',
+            dateType: 'datetimerange',
+            placeholder: '',
+            width: 380,
+            valueAr: ['createTimeStart', 'createTimeEnd']
+          },
+        ];
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search(e) {
+        this.$emit('search', {
+          ...e
+        });
+      }
+    }
+  };
+</script>

+ 229 - 0
src/BIZComponents/processSubmitDialog/components/parentList.vue

@@ -0,0 +1,229 @@
+<template>
+  <ele-modal
+    title="选择客户"
+    custom-class="ele-dialog-form long-dialog-form"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    top="5vh"
+    :close-on-press-escape="false"
+    append-to-body
+    width="70%"
+    :maxable="true"
+  >
+    <el-card shadow="never">
+      <contact-search @search="reload"></contact-search>
+
+      <ele-split-layout
+        width="244px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div class="ele-border-lighter split-layout-right-content">
+          <AssetTree
+            @handleNodeClick="handleNodeClick"
+            id="17"
+            :isFirstRefreshTable="false"
+            ref="treeList"
+          />
+        </div>
+        <!-- 表格 -->
+        <template v-slot:content>
+          <ele-pro-table
+            ref="table"
+            :columns="columns"
+            :datasource="datasource"
+            row-key="id"
+            height="calc(100vh - 460px)"
+            class="dict-table"
+            @cell-click="cellClick"
+          >
+            <!-- 表头工具栏 -->
+            <template v-slot:action="{ row }">
+              <el-radio class="radio" v-model="radio" :label="row.id"
+                ><i></i
+              ></el-radio>
+            </template>
+          </ele-pro-table>
+        </template>
+      </ele-split-layout>
+    </el-card>
+
+    <div slot="footer">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { contactPageUsages } from '../api.js';
+  import ContactSearch from './contactSearch.vue';
+  import AssetTree from '@/components/AssetTree';
+
+  export default {
+    components: {
+      ContactSearch,
+      AssetTree
+    },
+    props: {
+      classType: {
+        type: Number | String,
+        default: 1
+      }
+    },
+    data() {
+      return {
+        visible: false,
+
+        columns: [
+          {
+            action: 'action',
+            slot: 'action',
+            align: 'center',
+            label: '选择'
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '客户编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'name',
+            label: '客户名称',
+            align: 'center',
+            slot: 'name',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'serialNo',
+            label: '客户代号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'phone',
+            label: '客户电话',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+          {
+            prop: 'addressName',
+            label: '单位地址',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120,
+            formatter: (_row, _column, cellValue) => {
+              let addr =
+                '' + _row.addressName
+                  ? _row.addressName.replaceAll(',', '')
+                  : '';
+              addr += _row.address ? _row.address : '';
+              return addr;
+            }
+          },
+          {
+            prop: 'linkName',
+            label: '联系人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+          {
+            prop: 'linkPhone',
+            label: '联系人电话',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100,
+            formatter: (_row, _column, cellValue) => {
+              return _row.status === 1 ? '启用' : '禁用';
+            }
+          },
+
+          {
+            prop: 'remark',
+            label: '备注',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          }
+        ],
+
+        radio: null
+      };
+    },
+
+    watch: {},
+    methods: {
+      open(item) {
+        if (item) {
+          this.radio = item.id;
+        }
+        this.visible = true;
+      },
+
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return contactPageUsages({
+          pageNum: page,
+          size: limit,
+          type: this.classType,
+          ...where,
+          status: '1'
+        });
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where });
+      },
+
+      handleNodeClick(data, node) {
+        this.curNodeData = data;
+        this.reload({ categoryId: data.id });
+      },
+
+      // 单击获取id
+      cellClick(row) {
+        this.current = row;
+        this.radio = row.id;
+      },
+      handleClose() {
+        this.visible = false;
+        this.current = null;
+        this.radio = '';
+      },
+
+      selected() {
+        if (!this.current) {
+          return this.$message.warning('请选择客户');
+        }
+        this.$emit('changeParent', this.current);
+        this.handleClose();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped></style>

+ 59 - 4
src/BIZComponents/processSubmitDialog/processSubmitDialog.vue

@@ -6,7 +6,7 @@
     :title="title"
     append-to-body
     :close-on-click-modal="false"
-    :width="isRight ? '800px' : '450px'"
+    :width="modelWidth"
     :before-close="cancel"
     :maxable="true"
     :resizable="true"
@@ -62,6 +62,17 @@
               </div>
             </div>
           </template>
+          
+          <!-- 客户名称 -->
+          <template v-slot:eom_contact="scope">
+            <div class="eom_contact">
+              <el-input
+                  v-model="scope.model.eom_contact.name"
+                  style="width: 100%"
+                  @click.native="addContact('eom_contact')"
+                ></el-input>
+            </div>
+          </template>
         </fm-generate-form>
       </div>
       <div
@@ -269,6 +280,10 @@
         @confirm="getTreeList"
       ></staffSelection>
     </div>
+    <parentList
+      ref="parentRef"
+      @changeParent="handleConcatConfirm"
+    ></parentList>
   </ele-modal>
 </template>
 <script>
@@ -295,11 +310,12 @@
   import staffSelection from '@/components/staffSelection/staffSelection.vue';
   import { topLevel1, topLevel2, topLevel3 } from '@/enum/dict';
   import dayjs from 'dayjs';
+  import parentList from './components/parentList.vue';
   import { number } from 'echarts';
   import { del } from 'vue';
   export default {
     name: 'processSubmitDialog',
-    components: { visibilityRangeDialog, staffSelection },
+    components: { visibilityRangeDialog, staffSelection, parentList },
     mixins: [dictMixins],
     props: {
       processSubmitDialogFlag: {
@@ -357,7 +373,15 @@
       };
     },
     computed: {
-      ...mapGetters(['user'])
+      ...mapGetters(['user']),
+      modelWidth() {
+        let width = this.jsonData.config?.platform && this.jsonData.config.platform === 'pc' ? 1100 : 450;
+        if(this.isRight) {
+          return width + 350 + 'px'
+        } else {
+          return width + 'px'
+        }
+      }
     },
     async created() {
       let typeObj = await getProduceTreeByCode(
@@ -433,6 +457,37 @@ this.postOptions.push(...response.data);
           input_jd9ouzyh: num
         });
       },
+
+      async addContact(type) {
+        console.log(type);
+        let data = await this.$refs.generateForm.getData(false);
+        console.log('data', data);
+        data[type] = {
+          id: '',
+          name: ''
+        };
+        this.$refs.generateForm.setData({
+          type: data[type]
+        });
+        let item = {
+          id: data[type].id
+        };
+        this.$refs.parentRef.open(item);
+      },
+
+      async handleConcatConfirm(item) {
+        console.log('选择的客户', item);
+
+        let data = await this.$refs.generateForm.getData(false);
+        data['eom_contact'] = {
+          id: item.id,
+          name: item.name
+        }
+        this.$refs.generateForm.setData({
+          'eom_contact': data['eom_contact']
+        });
+        console.log('data~~~~', data);
+      },
       async init(row = {}) {
         this.title = row.name; //'新建' + row.name + '单';
         this.form = _.cloneDeep(row);
@@ -444,7 +499,7 @@ this.postOptions.push(...response.data);
         this.$set(this.form, 'key', '');
         this.$set(this.form, 'valueJson', {});
         this.jsonData = JSON.parse(this.form.formJson.makingJson);
-        console.log(this.jsonData);
+        console.log('jsonData', this.jsonData);
 
         this.jsonData.config.dataSource &&
           this.jsonData.config.dataSource.forEach((item) => {

+ 15 - 1
src/views/bpm/collaborative/detail.vue

@@ -1,7 +1,7 @@
 <template>
   <ele-modal
     :visible="formDetailDialogFlag"
-    :width="outgoingData?.id ? '80%' : '400px'"
+    :width="modelWidth"
     :centered="true"
     :close-on-click-modal="false"
     append-to-body
@@ -53,6 +53,15 @@
             </div>
           </div>
         </template>
+        <!-- 客户名称 -->
+          <template v-slot:eom_contact="scope">
+            <div class="eom_contact">
+              <el-input
+                  v-model="scope.model.eom_contact.name"
+                  style="width: 100%"
+                ></el-input>
+            </div>
+          </template>
       </fm-generate-form>
     </div>
     <outgoingDetails
@@ -88,6 +97,11 @@
         outgoingData:{}
       };
     },
+    computed: {
+      modelWidth() {
+        return (this.outgoingData?.id || this.jsonData.config?.platform && this.jsonData.config.platform === 'pc') ? '80%' : '400px';
+      }
+    },
     methods: {
        open(row) {
         this.form = _.cloneDeep(row);

+ 2 - 8
src/views/bpm/handleTask/components/inquiryManage/inquiryTable.vue

@@ -350,11 +350,6 @@
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'resultList.' + scope.$index + '.purchaseUnitId'"
-          :rules="{
-            required: true,
-            message: '请选择单位',
-            trigger: 'change'
-          }"
         >
           <el-select
             v-model="scope.row.purchaseUnitId"
@@ -519,7 +514,6 @@
       prop: 'purchaseUnit',
       label: '单位',
       slot: 'purchaseUnit',
-      headerSlot: 'headerTotalCount',
       align: 'center'
     },
     {
@@ -930,8 +924,8 @@
         this.getNotaxSinglePrice();
         this.$forceUpdate();
       },
-            //计算不含税单价
-            getNotaxSinglePrice() {
+      //计算不含税单价
+      getNotaxSinglePrice() {
         this.form.resultList.forEach((item, index) => {
           if (item.singlePrice && item.taxRate) {
             this.$set(

+ 211 - 157
src/views/bpm/handleTask/components/saleOrder/accountstatement/saleForm.vue

@@ -5,28 +5,55 @@
       <el-col :span="12">
         <el-form-item label="来源类型" prop="sourceType">
           <el-select
-            :disabled="dialogType=='view'"
+            :disabled="dialogType == 'view'"
             clearable
             class="ele-block"
             v-model="dataForm.sourceType"
             @change="handleChange"
-            placeholder="请选择">
-            <el-option label="客户" :value="1"/>
+            placeholder="请选择"
+          >
+            <el-option label="客户" :value="1" />
             <!--            <el-option label="项目" :value="2"/>-->
-            <el-option label="销售订单" :value="3"/>
+            <el-option label="合同" :value="4" />
+            <el-option label="销售订单" :value="3" />
           </el-select>
         </el-form-item>
       </el-col>
       <el-col :span="12">
-        <el-form-item label="选择客户" prop="contactId" v-if="dataForm.sourceType ==1">
-          <el-input :disabled="dialogType=='view'" v-model="dataForm.contactName"
-                    @click.native="handleGetCus"></el-input>
+        <el-form-item
+          label="选择客户"
+          prop="contactId"
+          v-if="dataForm.sourceType == 1"
+        >
+          <el-input
+            :disabled="dialogType == 'view'"
+            v-model="dataForm.contactName"
+            @click.native="handleGetCus"
+          ></el-input>
         </el-form-item>
         <!--        <el-form-item label="选择项目" prop="projectId" v-if="dataForm.sourceType ==2">-->
         <!--          <el-input :disabled="dialogType=='view'" v-model="dataForm.projectId" @click.native="handleGetOrd"></el-input>-->
         <!--        </el-form-item>-->
-        <el-form-item label="选择订单" prop="orderId" v-if="dataForm.sourceType ==3">
-          <el-input :disabled="dialogType=='view'" v-model="dataForm.orderNo" @click.native="handleGetOrd"></el-input>
+        <el-form-item
+          label="选择订单"
+          prop="sourceName"
+          v-if="dataForm.sourceType == 3"
+        >
+          <el-input
+            :disabled="dialogType == 'view'"
+            v-model="dataForm.sourceName"
+            @click.native="handleGetOrd"
+          ></el-input>
+        </el-form-item>
+        <el-form-item
+          label="选择合同"
+          prop="contractId"
+          v-if="dataForm.sourceType == 4"
+        >
+          <el-input
+            :disabled="dialogType == 'view'"
+            v-model="dataForm.sourceName"
+          ></el-input>
         </el-form-item>
       </el-col>
     </el-row>
@@ -34,44 +61,59 @@
       <el-col :span="12">
         <el-form-item label="查询方式" prop="dateType">
           <el-select
-            :disabled="dialogType=='view'"
+            :disabled="dialogType == 'view'"
             clearable
             class="ele-block"
             v-model="dataForm.dateType"
             @change="reloadTableData"
-            placeholder="请选择">
-            <el-option label="按年度" :value="1"/>
-            <el-option label="按季度" :value="2"/>
-            <el-option label="按月度" :value="3"/>
-            <el-option label="按时间段" :value="4"/>
+            placeholder="请选择"
+          >
+            <el-option label="按年度" :value="1" />
+            <el-option label="按季度" :value="2" />
+            <el-option label="按月度" :value="3" />
+            <el-option label="按时间段" :value="4" />
           </el-select>
         </el-form-item>
       </el-col>
       <el-col :span="12" v-if="![2].includes(dataForm.dateType)">
-        <el-form-item label="选择年度" prop="year" v-if="[1].includes(dataForm.dateType)">
+        <el-form-item
+          label="选择年度"
+          prop="year"
+          v-if="[1].includes(dataForm.dateType)"
+        >
           <el-date-picker
-            :disabled="dialogType=='view'"
+            :disabled="dialogType == 'view'"
             v-model="dataForm.year"
             value-format="yyyy"
             type="year"
             style="width: 100%"
             @change="reloadTableData"
-            placeholder="选择年">
+            placeholder="选择年"
+          >
           </el-date-picker>
         </el-form-item>
-        <el-form-item label="选择月度" prop="month" v-if="[3].includes(dataForm.dateType)">
+        <el-form-item
+          label="选择月度"
+          prop="month"
+          v-if="[3].includes(dataForm.dateType)"
+        >
           <el-date-picker
-            :disabled="dialogType=='view'"
+            :disabled="dialogType == 'view'"
             v-model="dataForm.month"
             value-format="yyyy-MM"
             type="month"
             @change="reloadTableData"
-            style="width: 100%">
+            style="width: 100%"
+          >
           </el-date-picker>
         </el-form-item>
-        <el-form-item label="选择时间段" prop="dateTimeRange" v-if="[4].includes(dataForm.dateType)">
+        <el-form-item
+          label="选择时间段"
+          prop="dateTimeRange"
+          v-if="[4].includes(dataForm.dateType)"
+        >
           <el-date-picker
-            :disabled="dialogType=='view'"
+            :disabled="dialogType == 'view'"
             v-model="dataForm.dateTimeRange"
             value-format="yyyy-MM-dd"
             type="daterange"
@@ -79,191 +121,203 @@
             range-separator="至"
             start-placeholder="开始日期"
             end-placeholder="结束日期"
-            style="width: 100%">
+            style="width: 100%"
+          >
           </el-date-picker>
         </el-form-item>
       </el-col>
       <el-col :span="6" v-if="[2].includes(dataForm.dateType)">
-        <el-form-item label="选择年度" prop="year" v-if="[1,2].includes(dataForm.dateType)">
+        <el-form-item
+          label="选择年度"
+          prop="year"
+          v-if="[1, 2].includes(dataForm.dateType)"
+        >
           <el-date-picker
-            :disabled="dialogType=='view'"
+            :disabled="dialogType == 'view'"
             v-model="dataForm.year"
             value-format="yyyy"
             type="year"
             @change="reloadTableData"
             style="width: 100%"
-            placeholder="选择年">
+            placeholder="选择年"
+          >
           </el-date-picker>
         </el-form-item>
       </el-col>
       <el-col :span="6" v-if="[2].includes(dataForm.dateType)">
-        <el-form-item label="选择季度" prop="quarter" v-if="[2].includes(dataForm.dateType)">
+        <el-form-item
+          label="选择季度"
+          prop="quarter"
+          v-if="[2].includes(dataForm.dateType)"
+        >
           <el-select
-            :disabled="dialogType=='view'"
+            :disabled="dialogType == 'view'"
             clearable
             @change="reloadTableData"
             class="ele-block"
             v-model="dataForm.quarter"
-            placeholder="请选择">
-            <el-option label="一季度" value="一季度"/>
-            <el-option label="二季度" value="二季度"/>
-            <el-option label="三季度" value="三季度"/>
-            <el-option label="四季度" value="四季度"/>
+            placeholder="请选择"
+          >
+            <el-option label="一季度" value="一季度" />
+            <el-option label="二季度" value="二季度" />
+            <el-option label="三季度" value="三季度" />
+            <el-option label="四季度" value="四季度" />
           </el-select>
         </el-form-item>
       </el-col>
-
     </el-row>
     <el-row>
       <el-col :span="12">
-        <el-form-item
-        
-          prop="createUserName"
-          label="对账人">
-        
-          <el-input disabled v-model="dataForm.createUserName"
-                    ></el-input>
+        <el-form-item prop="createUserName" label="对账人">
+          <el-input disabled v-model="dataForm.createUserName"></el-input>
         </el-form-item>
       </el-col>
       <el-col :span="12">
-        <el-form-item
-          prop="createTime"
-          label="对账时间">
-          <el-input disabled v-model="dataForm.createTime"
-                    ></el-input>
+        <el-form-item prop="createTime" label="对账时间">
+          <el-input disabled v-model="dataForm.createTime"></el-input>
         </el-form-item>
       </el-col>
       <el-col :span="12">
         <el-form-item
-          v-if="taskDefinitionKey=='uploadReceipt'"
+          v-if="taskDefinitionKey == 'uploadReceipt'"
           prop="repliedFiles"
-          label="回执附件">
-          <fileMain v-model="dataForm.repliedFiles" ></fileMain>
-
+          label="回执附件"
+        >
+          <fileMain v-model="dataForm.repliedFiles"></fileMain>
         </el-form-item>
       </el-col>
     </el-row>
-    <el-row v-if="dialogType!=='view'">
+    <el-row v-if="dialogType !== 'view'">
       <el-col :span="24">
-        <el-button style="float: right;" @click="handleSearch" type="primary">查询</el-button>
+        <el-button style="float: right" @click="handleSearch" type="primary"
+          >查询</el-button
+        >
       </el-col>
     </el-row>
     <parentList ref="parentRef" @changeParent="getCusInfo"></parentList>
-    <orderListDialog ref="orderListDialogRef" @changeParent="getOrderInfo"
+    <orderListDialog
+      ref="orderListDialogRef"
+      @changeParent="getOrderInfo"
     ></orderListDialog>
   </el-form>
 </template>
 
 <script xmlns:el-col="http://www.w3.org/1999/html">
-import parentList from "./customerListDialog.vue";
-import OrderListDialog from "./orderListDialog.vue";
-import fileUpload from "@/components/upload/fileUpload.vue";
-// import fileMain from "@/components/addDoc/index.vue";
-
-export default {
-  name: "saleForm",
-  components: {
-    // fileMain,
-     fileUpload, OrderListDialog, parentList},
-  props: ['dataForm', 'datasource', 'dialogType', 'taskDefinitionKey'],
-  data() {
-    return {
-      monthByDays: {},
-
-      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'},
-        repliedFiles: {required: this.taskDefinitionKey == 'uploadReceipt', message: '请上传', trigger: 'change'},
-      },
+  import parentList from './customerListDialog.vue';
+  import OrderListDialog from './orderListDialog.vue';
+  import fileUpload from '@/components/upload/fileUpload.vue';
+  // import fileMain from "@/components/addDoc/index.vue";
 
-    }
-  },
-  methods: {
-    //查询
-    handleSearch() {
-      this.$emit('handleSearch', this.dataForm)
+  export default {
+    name: 'saleForm',
+    components: {
+      // fileMain,
+      fileUpload,
+      OrderListDialog,
+      parentList
     },
-    //
-    getDays() {
-
+    props: ['dataForm', 'datasource', 'dialogType', 'taskDefinitionKey'],
+    data() {
+      return {
+        monthByDays: {},
 
+        rules: {
+          sourceType: { required: true, message: '请选择', trigger: 'change' },
+          contactId: { required: true, message: '请选择', trigger: 'change' },
+          projectId: { 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'
+          },
+          repliedFiles: {
+            required: this.taskDefinitionKey == 'uploadReceipt',
+            message: '请上传',
+            trigger: 'change'
+          }
+        }
+      };
     },
-    //获取客户信息
-    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) {
-      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() {
-      let params = Object.assign({}, {
-        ...this.dataForm,
-        orderNo: '',
-        orderId: '',
-        contactId: '',
-        contactName: '',
-        sourceName: '',
-        sourceId: '',
-      })
-      this.$emit('update:dataForm', params)
-      this.reloadTableData()
-    },
-    reloadTableData() {
-      this.$emit('update:datasource', [])
+    methods: {
+      //查询
+      handleSearch() {
+        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) {
+        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() {
+        let params = Object.assign(
+          {},
+          {
+            ...this.dataForm,
+            orderNo: '',
+            orderId: '',
+            contactId: '',
+            contactName: '',
+            sourceName: '',
+            sourceId: ''
+          }
+        );
+        this.$emit('update:dataForm', params);
+        this.reloadTableData();
+      },
+      reloadTableData() {
+        this.$emit('update:datasource', []);
+      }
     },
-
-  },
-  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">
-::v-deep.el-divider {
-  margin: 10px;
-  font-weight: bold;
-}
+  ::v-deep.el-divider {
+    margin: 10px;
+    font-weight: bold;
+  }
 </style>