Browse Source

质量事故单

yuansh 2 years ago
parent
commit
64d4f7f934

+ 202 - 0
src/views/oa/IncidentTicketList.vue

@@ -0,0 +1,202 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="质量事故单主题">
+              <a-input placeholder="请输入质量事故单主题" v-model="queryParam.accidentTheme"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="款号">
+              <a-input placeholder="请输入款号" v-model="queryParam.styleNumber"></a-input>
+            </a-form-item>
+          </a-col>
+          <template v-if="toggleSearchStatus">
+            <a-col :xl="6" :lg="7" :md="8" :sm="24">
+              <a-form-item label="业务员">
+                <j-dict-select-tag placeholder="请选择业务员" v-model="queryParam.businessPeople" dictCode="sys_user,realname,username"/>
+              </a-form-item>
+            </a-col>
+            <a-col :xl="6" :lg="7" :md="8" :sm="24">
+              <a-form-item label="填报人">
+                <j-dict-select-tag placeholder="请选择填报人" v-model="queryParam.informant" dictCode="sys_user ,realname,username"/>
+              </a-form-item>
+            </a-col>
+          </template>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              <a @click="handleToggleSearch" style="margin-left: 8px">
+                {{ toggleSearchStatus ? '收起' : '展开' }}
+                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+              </a>
+            </span>
+          </a-col>
+
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+    
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
+      <a-button type="primary" icon="download" @click="handleExportXls('森_工厂质量事故单-主表')">导出</a-button>
+     <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+      </a-dropdown> -->
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+     <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div> -->
+
+      <a-table
+        ref="table"
+        size="middle"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无此图片</span>
+          <img v-else :src="getImgView(text)" height="25px" alt="图片不存在" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无此文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="uploadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+<!-- 
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown> -->
+        </span>
+
+      </a-table>
+    </div>
+
+    <incidentTicket-modal ref="modalForm" @ok="modalFormOk"></incidentTicket-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import IncidentTicketModal from './modules/IncidentTicketModal'
+  import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
+  import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
+
+  export default {
+    name: "IncidentTicketList",
+    mixins:[JeecgListMixin],
+    components: {
+      JDictSelectTag,
+      IncidentTicketModal
+    },
+    data () {
+      return {
+        description: '森_工厂质量事故单-主表管理页面',
+        // 表头
+        columns: [
+          {
+            title:'日期',
+            align:"center",
+            dataIndex: 'accidentData'
+          },
+          {
+            title:'质量事故单主题',
+            align:"center",
+            dataIndex: 'accidentTheme'
+          },
+          {
+            title:'事故责任人',
+            align:"center",
+            dataIndex: 'accidentPersonLiable'
+          },
+          {
+            title:'质量事故单号',
+            align:"center",
+            dataIndex: 'accidentNumber'
+          },
+          {
+            title:'总金额',
+            align:"center",
+            dataIndex: 'totalMoney'
+          },
+          {
+            title:'业务类型',
+            align:"center",
+            dataIndex: 'businessType'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            scopedSlots: { customRender: 'action' },
+          }
+        ],
+        url: {
+          list: "/oa/incidentTicket/list",
+          delete: "/oa/incidentTicket/delete",
+          deleteBatch: "/oa/incidentTicket/deleteBatch",
+          exportXlsUrl: "/oa/incidentTicket/exportXls",
+          importExcelUrl: "oa/incidentTicket/importExcel",
+        },
+        dictOptions:{},
+      }
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      }
+    },
+    methods: {
+      initDictConfig(){
+      }
+       
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 496 - 0
src/views/oa/modules/IncidentTicketModal.vue

@@ -0,0 +1,496 @@
+<template>
+  <a-modal
+    :title="title"
+    :width="1200"
+    :visible="visible"
+    :maskClosable="false"
+    :confirmLoading="confirmLoading"
+    @ok="handleOk"
+    @cancel="handleCancel">
+    <a-spin :spinning="confirmLoading">
+      <!-- 主表单区域 -->
+      <a-form :form="form">
+        <a-row>
+
+          <a-col :span="12">
+            <a-form-item label="日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'accidentData', validatorRules.accidentData]" placeholder="请输入日期"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="质量事故单主题" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'accidentTheme', validatorRules.accidentTheme]" placeholder="请输入质量事故单主题"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="事故责任人" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'accidentPersonLiable', validatorRules.accidentPersonLiable]" placeholder="请输入事故责任人"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'supplier', validatorRules.supplier]" placeholder="请输入供应商"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="责任人" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'personLiable', validatorRules.personLiable]" placeholder="请输入责任人"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="质量事故单号" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'accidentNumber', validatorRules.accidentNumber]" placeholder="请输入质量事故单号"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="客户" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'customer', validatorRules.customer]" placeholder="请输入客户"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="工厂" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'factory', validatorRules.factory]" placeholder="请输入工厂"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="责任人1" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'responsibilityPerson1', validatorRules.responsibilityPerson1]" placeholder="请输入责任人1"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="责任人2" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'responsibilityPerson2', validatorRules.responsibilityPerson2]" placeholder="请输入责任人2"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="责任人3" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'responsibilityPerson3', validatorRules.responsibilityPerson3]" placeholder="请输入责任人3"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="责任人4" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'responsibilityPerson4', validatorRules.responsibilityPerson4]" placeholder="请输入责任人4"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="责任人5" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'responsibilityPerson5', validatorRules.responsibilityPerson5]" placeholder="请输入责任人5"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="金额1" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'sum1', validatorRules.sum1]" placeholder="请输入金额1"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="金额2" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'sum2', validatorRules.sum2]" placeholder="请输入金额2"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="金额3" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'sum3', validatorRules.sum3]" placeholder="请输入金额3"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="金额4" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'sum4', validatorRules.sum4]" placeholder="请输入金额4"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="金额5" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'sum5', validatorRules.sum5]" placeholder="请输入金额5"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="责任单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'responsibilityCompany', validatorRules.responsibilityCompany]" placeholder="请输入责任单位"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="币种" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'moneyType', validatorRules.moneyType]" placeholder="请输入币种"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="总金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'totalMoney', validatorRules.totalMoney]" placeholder="请输入总金额"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="业务类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'businessType', validatorRules.businessType]" placeholder="请输入业务类型"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="成衣销售订单号" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'garmentSalesOrder', validatorRules.garmentSalesOrder]" placeholder="请输入成衣销售订单号"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="款号" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'styleNumber', validatorRules.styleNumber]" placeholder="请输入款号"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="物料" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'material', validatorRules.material]" placeholder="请输入物料"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="计划员" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'planPersonnel', validatorRules.planPersonnel]" placeholder="请输入计划员"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="业务员" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <j-dict-select-tag type="list" v-decorator="['businessPeople', validatorRules.businessPeople]" :trigger-change="true" dictCode="sys_user,realname,username" placeholder="请选择业务员"/>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="QC" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'qualityControl', validatorRules.qualityControl]" placeholder="请输入QC"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="计划单号(主)" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'planNumber', validatorRules.planNumber]" placeholder="请输入计划单号(主)"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="事故类型(主)" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'accidentType', validatorRules.accidentType]" placeholder="请输入事故类型(主)"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="事故金额(主)" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'accidentSum', validatorRules.accidentSum]" placeholder="请输入事故金额(主)"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="情况说明" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'presentationCondition', validatorRules.presentationCondition]" placeholder="请输入情况说明"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="附件上传" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'accessory', validatorRules.accessory]" placeholder="请输入附件上传"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="填报人" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <j-dict-select-tag type="list" v-decorator="['informant', validatorRules.informant]" :trigger-change="true" dictCode="sys_user ,realname,username" placeholder="请选择填报人"/>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="工厂签章" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'factorySignature', validatorRules.factorySignature]" placeholder="请输入工厂签章"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="财务备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'financeRemark', validatorRules.financeRemark]" placeholder="请输入财务备注"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="添加附件" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'accessory2', validatorRules.accessory2]" placeholder="请输入添加附件"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="是否部门负责人" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'isLeaders', validatorRules.isLeaders]" placeholder="请输入是否部门负责人"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="森_工厂质量事故单(子)" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'incidentTicketId', validatorRules.incidentTicketId]" placeholder="请输入森_工厂质量事故单(子)"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="子表控件" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="[ 'tableNameChildren', validatorRules.tableNameChildren]" placeholder="请输入子表控件"></a-input>
+            </a-form-item>
+          </a-col>
+
+        </a-row>
+      </a-form>
+
+      <!-- 子表单区域 -->
+      <a-tabs v-model="activeKey" @change="handleChangeTabs">
+        <a-tab-pane tab="森_工厂质量事故单-子表" :key="refKeys[0]" :forceRender="true">
+          <j-editable-table
+            :ref="refKeys[0]"
+            :loading="incidentTicketChildrenTable.loading"
+            :columns="incidentTicketChildrenTable.columns"
+            :dataSource="incidentTicketChildrenTable.dataSource"
+            :maxHeight="300"
+            :rowNumber="true"
+            :rowSelection="true"
+            :actionButton="true"/>
+        </a-tab-pane>
+        
+      </a-tabs>
+
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+
+  import pick from 'lodash.pick'
+  import { FormTypes,getRefPromise } from '@/utils/JEditableTableUtil'
+  import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
+  import { validateDuplicateValue } from '@/utils/util'
+  import JDictSelectTag from "@/components/dict/JDictSelectTag"
+
+  export default {
+    name: 'IncidentTicketModal',
+    mixins: [JEditableTableMixin],
+    components: {
+      JDictSelectTag,
+    },
+    data() {
+      return {
+        labelCol: {
+          span: 6
+        },
+        wrapperCol: {
+          span: 16
+        },
+        labelCol2: {
+          span: 3
+        },
+        wrapperCol2: {
+          span: 20
+        },
+        // 新增时子表默认添加几行空数据
+        addDefaultRowNum: 1,
+        validatorRules: {
+          accidentData: {rules: [
+          ]},
+          accidentTheme: {rules: [
+          ]},
+          accidentPersonLiable: {rules: [
+          ]},
+          supplier: {rules: [
+          ]},
+          personLiable: {rules: [
+          ]},
+          accidentNumber: {rules: [
+          ]},
+          customer: {rules: [
+          ]},
+          factory: {rules: [
+          ]},
+          responsibilityPerson1: {rules: [
+          ]},
+          responsibilityPerson2: {rules: [
+          ]},
+          responsibilityPerson3: {rules: [
+          ]},
+          responsibilityPerson4: {rules: [
+          ]},
+          responsibilityPerson5: {rules: [
+          ]},
+          sum1: {rules: [
+          ]},
+          sum2: {rules: [
+          ]},
+          sum3: {rules: [
+          ]},
+          sum4: {rules: [
+          ]},
+          sum5: {rules: [
+          ]},
+          responsibilityCompany: {rules: [
+          ]},
+          moneyType: {rules: [
+          ]},
+          totalMoney: {rules: [
+          ]},
+          businessType: {rules: [
+          ]},
+          garmentSalesOrder: {rules: [
+          ]},
+          styleNumber: {rules: [
+          ]},
+          material: {rules: [
+          ]},
+          planPersonnel: {rules: [
+          ]},
+          businessPeople: {rules: [
+          ]},
+          qualityControl: {rules: [
+          ]},
+          planNumber: {rules: [
+          ]},
+          accidentType: {rules: [
+          ]},
+          accidentSum: {rules: [
+          ]},
+          presentationCondition: {rules: [
+          ]},
+          accessory: {rules: [
+          ]},
+          informant: {rules: [
+          ]},
+          factorySignature: {rules: [
+          ]},
+          financeRemark: {rules: [
+          ]},
+          accessory2: {rules: [
+          ]},
+          isLeaders: {rules: [
+          ]},
+          incidentTicketId: {rules: [
+          ]},
+          tableNameChildren: {rules: [
+          ]},
+        },
+        refKeys: ['incidentTicketChildren', ],
+        tableKeys:['incidentTicketChildren', ],
+        activeKey: 'incidentTicketChildren',
+        // 森_工厂质量事故单-子表
+        incidentTicketChildrenTable: {
+          loading: false,
+          dataSource: [],
+          columns: [
+            {
+              title: '计划单号',
+              key: 'planNumber',
+              type: FormTypes.input,
+              width:"200px",
+              placeholder: '请输入${title}',
+              defaultValue: '',
+            },
+            {
+              title: '事故类型',
+              key: 'accidentType',
+              type: FormTypes.input,
+              width:"200px",
+              placeholder: '请输入${title}',
+              defaultValue: '',
+            },
+            {
+              title: '事故金额',
+              key: 'accidentSum',
+              type: FormTypes.input,
+              width:"200px",
+              placeholder: '请输入${title}',
+              defaultValue: '',
+            },
+            {
+              title: '汇率',
+              key: 'exchangeRate',
+              type: FormTypes.input,
+              width:"200px",
+              placeholder: '请输入${title}',
+              defaultValue: '',
+            },
+            {
+              title: '实际事故金额',
+              key: 'practicalSum',
+              type: FormTypes.input,
+              width:"200px",
+              placeholder: '请输入${title}',
+              defaultValue: '',
+            },
+            {
+              title: 'U8生成运费发票号',
+              key: 'u8Invoice',
+              type: FormTypes.input,
+              width:"200px",
+              placeholder: '请输入${title}',
+              defaultValue: '',
+            },
+            {
+              title: '账套号',
+              key: 'zhanghaoId',
+              type: FormTypes.input,
+              width:"200px",
+              placeholder: '请输入${title}',
+              defaultValue: '',
+            },
+            {
+              title: '备注',
+              key: 'remark',
+              type: FormTypes.input,
+              width:"200px",
+              placeholder: '请输入${title}',
+              defaultValue: '',
+            },
+            {
+              title: '是否部门负责人',
+              key: 'isLeaders',
+              type: FormTypes.input,
+              width:"200px",
+              placeholder: '请输入${title}',
+              defaultValue: '',
+            },
+            {
+              title: '主表id',
+              key: 'incidentTicketId',
+              type: FormTypes.input,
+              width:"200px",
+              placeholder: '请输入${title}',
+              defaultValue: '',
+            },
+            {
+              title: '报错字段sort',
+              key: 'sort',
+              type: FormTypes.input,
+              width:"200px",
+              placeholder: '请输入${title}',
+              defaultValue: '',
+            },
+          ]
+        },
+        url: {
+          add: "/oa/incidentTicket/add",
+          edit: "/oa/incidentTicket/edit",
+          incidentTicketChildren: {
+            list: '/oa/incidentTicket/queryIncidentTicketChildrenByMainId'
+          },
+        }
+      }
+    },
+    methods: {
+      getAllTable() {
+        let values = this.tableKeys.map(key => getRefPromise(this, key))
+        return Promise.all(values)
+      },
+      /** 调用完edit()方法之后会自动调用此方法 */
+      editAfter() {
+        let fieldval = pick(this.model,'accidentData','accidentTheme','accidentPersonLiable','supplier','personLiable','accidentNumber','customer','factory','responsibilityPerson1','responsibilityPerson2','responsibilityPerson3','responsibilityPerson4','responsibilityPerson5','sum1','sum2','sum3','sum4','sum5','responsibilityCompany','moneyType','totalMoney','businessType','garmentSalesOrder','styleNumber','material','planPersonnel','businessPeople','qualityControl','planNumber','accidentType','accidentSum','presentationCondition','accessory','informant','factorySignature','financeRemark','accessory2','isLeaders','incidentTicketId','tableNameChildren')
+        this.$nextTick(() => {
+          this.form.setFieldsValue(fieldval)
+        })
+        // 加载子表数据
+        if (this.model.id) {
+          let params = { id: this.model.id }
+          this.requestSubTableData(this.url.incidentTicketChildren.list, params, this.incidentTicketChildrenTable)
+        }
+      },
+      /** 整理成formData */
+      classifyIntoFormData(allValues) {
+        let main = Object.assign(this.model, allValues.formValue)
+
+        return {
+          ...main, // 展开
+          incidentTicketChildrenList: allValues.tablesValue[0].values,
+        }
+      },
+      validateError(msg){
+        this.$message.error(msg)
+      },
+     popupCallback(row){
+       this.form.setFieldsValue(pick(row,'accidentData','accidentTheme','accidentPersonLiable','supplier','personLiable','accidentNumber','customer','factory','responsibilityPerson1','responsibilityPerson2','responsibilityPerson3','responsibilityPerson4','responsibilityPerson5','sum1','sum2','sum3','sum4','sum5','responsibilityCompany','moneyType','totalMoney','businessType','garmentSalesOrder','styleNumber','material','planPersonnel','businessPeople','qualityControl','planNumber','accidentType','accidentSum','presentationCondition','accessory','informant','factorySignature','financeRemark','accessory2','isLeaders','incidentTicketId','tableNameChildren'))
+     },
+
+    }
+  }
+</script>
+
+<style scoped>
+</style>

+ 116 - 28
src/views/process-center/applyListByTableName.vue

@@ -7,22 +7,13 @@
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
         <a-row :gutter="24">
-          <a-col :md="4" :sm="12">
+          <!-- <a-col :md="4" :sm="12">
             <a-form-item label="标题">
               <a-input placeholder="请输入搜索关键词" v-model="queryParam.title"></a-input>
             </a-form-item>
-          </a-col>
-          <a-col :md="4" :sm="12">
-            <a-form-item label="状态">
-              <a-select v-model="queryParam.status" placeholder="请选择" :allowClear="true">
-                <a-select-option value="0">草稿</a-select-option>
-                <a-select-option value="1">处理中</a-select-option>
-                <a-select-option value="2">已结束</a-select-option>
-                <a-select-option value="3">已撤回</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="4" :sm="12">
+          </a-col> -->
+          
+          <!-- <a-col :md="4" :sm="12">
             <a-form-item label="结果">
               <a-select v-model="queryParam.result" placeholder="请选择" :allowClear="true">
                 <a-select-option value="0">未提交</a-select-option>
@@ -31,7 +22,7 @@
                 <a-select-option value="3">驳回</a-select-option>
               </a-select>
             </a-form-item>
-          </a-col>
+          </a-col> -->
           <a-col :md="6" :sm="12">
             <a-form-item label="创建时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
               <a-range-picker
@@ -44,15 +35,50 @@
               />
             </a-form-item>
           </a-col>
-
+          <a-col :md="4" :sm="12">
+            <a-form-item label="状态">
+              <a-select v-model="queryParam.status" placeholder="请选择" :allowClear="true">
+                <a-select-option value="0">草稿</a-select-option>
+                <a-select-option value="1">处理中</a-select-option>
+                <a-select-option value="2">已结束</a-select-option>
+                <a-select-option value="3">已撤回</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
           <!-- 查询 重置 -->
           <a-col :md="6" :sm="12">
+            
             <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
             <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px;">重置</a-button>
+            <a-button type="primary" @click="()=>this.visibleSearchSuper=true" ghost icon="clock-circle" style="margin-left: 8px;">高级查询</a-button>
              <!-- <j-super-query :fieldList="fieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> -->
           </a-col>
         </a-row>
-
+        
+        <a-modal v-model:visible="visibleSearchSuper" width="880px" title="高级查询" @ok="handleOkSearchSuper">
+           <template v-for="(value, index) in ortherColumn">
+              <a-input-group compact  v-if="value.field_show_type == 'text'">
+                <input :value="value.db_field_txt" readonly="readonly" style="width: 30%" class="ant-input"/>
+                <input :ref="value.db_field_name" :placeholder="'请输入'+value.db_field_txt" style="width: 60%" class="ant-input"/>
+              </a-input-group>
+              <a-input-group compact v-if="value.field_show_type == 'date'">
+                <input :value="value.db_field_txt" readonly="readonly" style="width: 30%" class="ant-input"/>
+                <input :ref="value.db_field_name" type="date" style="width: 30%" class="ant-input"/>
+                <input :ref="value.db_field_name+'_1'" type="date" style="width: 30%" class="ant-input"/>
+              </a-input-group>
+              <a-input-group compact v-if="value.field_show_type == 'list'">
+                <input :value="value.db_field_txt" readonly="readonly" style="width: 30%" class="ant-input"/>
+                  <select style="width: 60%" :ref="value.db_field_name" class="ant-input">
+                    <option checked value="">请选择</option>
+                    <option v-for="(item, i) in value.list" :key="i" :value="item.value">
+                      {{item.text}}
+                    </option>
+                  </select>
+              </a-input-group>
+               <br/>
+           </template>
+        </a-modal>
+                
         <!-- 发起申请 按钮 -->
         <a-row>
           <a-col :md="12" :sm="12">
@@ -327,8 +353,8 @@ import pick from 'lodash.pick'
 import JTreeSelect from '@/components/jeecg/JTreeSelect'
 import { initDictOptions, filterDictText } from '@/components/dict/JDictSelectUtil'
 import historicDetail from '@/views/activiti/historicDetail'
- import JSuperQuery from '@/components/jeecg/JSuperQuery.vue';
- 
+import JSuperQuery from '@/components/jeecg/JSuperQuery.vue';
+import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
  //高级查询modal需要参数
  const superQueryFieldList=[{
    type:"date",
@@ -376,6 +402,7 @@ export default {
       loading: false,
       data,
       visible: false,
+      visibleSearchSuper: false,
 
       tableColumns: [],
       description: '我的申请',
@@ -385,12 +412,16 @@ export default {
         getProcessDataList: '/activiti_process/listData',
         delByIds: '/actBusiness/delByIds',
         getFirstNode: '/actProcessIns/getFirstNode',
+        getQueryColumnList: '/actBusiness/getQueryColumnList',
         applyBusiness: '/actBusiness/apply',
         cancelApply: '/actBusiness/cancel'
       },
       fieldList:superQueryFieldList,
       superQueryFlag:false,
       superQueryParams:"",
+      ortherParam: [],
+      ortherParam2: [1,2],
+      ortherColumn: [],
       // 查询条件
       queryParam: {
         createTimeRange: [],
@@ -440,9 +471,10 @@ export default {
     }
   },
   created() {
-    console.log(this.$route.params)
+    // console.log(this.$route.params)
     this.tableName = this.$route.params.tableName
     this.initial()
+    this.getQueryColumnList();
   },
   //时刻监听,一旦切换到其他申请表单则重新加载数据
   watch: {
@@ -456,11 +488,56 @@ export default {
   computed: {},
   methods: {
     //高级查询方法
-    handleSuperQuery(arg) {
-
-      this.tableColumns.forEach(t => {
+    handleOkSearchSuper(arg) {
+      this.visibleSearchSuper = false;
+      let that = this;
+      this.ortherParam = [];
+      this.ortherColumn.forEach(t => {
+        let par = {};
+        let testId1 = t.db_field_name;
+        let testId2 = t.db_field_name+'_1';
         
-        console.log("sssssssssssss",t);
+        if(t.field_show_type == 'text'){
+           par.name = t.db_field_name;
+           par.value = that.$refs[testId1][0].value;
+           par.type = 'text'; 
+        }
+        if(t.field_show_type == 'date'){
+           par.name = t.db_field_name;
+           par.value = that.$refs[testId1][0].value;
+           par.value2 = that.$refs[testId2][0].value;
+           par.type = 'date'; 
+        }
+        if(t.field_show_type == 'list'){
+           par.name = t.db_field_name;
+           par.value = that.$refs[testId1][0].value;
+           par.type = 'list'; 
+        }
+        if((par.value != null && par.value != null && par.value !='undefined') 
+        || (par.value2 != null && par.value2 != null && par.value2 !='undefined')){
+          that.ortherParam.push(JSON.stringify(par).toString())
+        }
+      })
+      
+     this.queryParam.ortherParam = ''+this.ortherParam.map(String);
+      
+    },
+    //高级查询方法
+    handleSuperQuery(arg) {
+      let that = this;
+      this.ortherColumn.forEach(t => {
+        let testId1 = t.db_field_name;
+        let testId2 = t.db_field_name+'_1';
+        if(t.field_show_type == 'text'){
+          that.$refs[testId1][0].value ='';
+        }
+        if(t.field_show_type == 'list'){
+          that.$refs[testId1][0].value ='';
+        }
+        if(t.field_show_type == 'date'){
+           that.$refs[testId1][0].value ='';
+           that.$refs[testId2][0].value ='';
+        }
       })
       
       // if(!arg){
@@ -479,6 +556,7 @@ export default {
       this.tableName = this.$route.params.tableName
       ///////根据表单名称查询对应相关数据
       let businessTable = this.$route.params.tableName //表单表名称
+      this.getQueryColumnList();
       this.postFormAction('/activiti_process/listData', {
         businessTable: businessTable,
         status: 1,
@@ -498,7 +576,7 @@ export default {
       // }
     },
     handleMenuClickAll_comm() {
-      console.log(this.tableColumns)
+      // console.log(this.tableColumns)
       if (this.checkedColumn.length === this.tableColumns.length) {
         this.selectText = '全选'
         this.checkedColumn = []
@@ -753,7 +831,6 @@ export default {
         .finally(() => (this.addApplyLoading = false))
     },
     loadData(arg) {
-      console.log('loadData')
       if (!this.url.list) {
         this.$message.error('请设置url.list属性!')
         return
@@ -778,7 +855,7 @@ export default {
       }
       this.queryParam.tableName = this.$route.params.tableName
       var params = this.getQueryParams() //查询条件
-      console.log(params)
+      // console.log("aaaaaaaaaaaaaaaaa",params)
       this.loading = true
       getAction(this.url.list, params).then(res => {
         if (res.success) {
@@ -803,11 +880,12 @@ export default {
       var that = this
       var logType = that.queryParam.logType
       that.queryParam = {} //清空查询区域参数
+      that.handleSuperQuery();
       that.queryParam.logType = logType
       that.loadData(this.ipagination.current)
     },
     onDateChange: function(value, dateString) {
-      console.log(dateString[0], dateString[1])
+      // console.log(dateString[0], dateString[1])
       this.queryParam.createTime_begin = dateString[0]
       this.queryParam.createTime_end = dateString[1]
     },
@@ -1039,7 +1117,7 @@ export default {
       this.getProcessList()
     },
     chooseProcess(v) {
-      console.log(v)
+      // console.log(v)
       // this.$refs.modal.add("1")
       if (!v.routeName) {
         this.$message.warning('该流程信息未配置表单,请联系开发人员!')
@@ -1069,6 +1147,16 @@ export default {
     afterSub(formData) {
       this.lcModa.visible = false
       this.loadData()
+    },
+    //获取高级查询的数据
+    getQueryColumnList() {
+      let that = this;
+      this.getAction(this.url.getQueryColumnList, { tableName: this.$route.params.tableName }).then(res => {
+         // console.log('2222222222222222',res)
+        if (res.success) {
+          that.ortherColumn = res.result;
+        }
+      })
     }
   }
 }