Forráskód Böngészése

森语-事故处理单

jbb 2 éve
szülő
commit
0f266169e7

+ 46 - 14
src/views/oa/IncidentTicketList.vue

@@ -31,7 +31,10 @@
               <a-form-item label="质量事故单主题">
                 <a-input placeholder="请输入质量事故单主题" v-model="queryParam.accidentTheme"></a-input>
               </a-form-item>
-               <a-form-item label="财务备注">
+              
+            </a-col>
+            <a-col :xl="6" :lg="7" :md="8" :sm="24">
+              <a-form-item label="财务备注">
                 <a-input placeholder="请输入财务备注" v-model="queryParam.financeRemark"></a-input>
               </a-form-item>
             </a-col>
@@ -83,6 +86,7 @@
         :dataSource="dataSource"
         :pagination="ipagination"
         :loading="loading"
+        :scroll="{x: 2000}"
         :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
         @change="handleTableChange">
 
@@ -149,6 +153,7 @@
   import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
   import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
   import {filterObj, cloneObject, pushIfNotExist } from '@/utils/util'
+  import JEllipsis from '@/components/jeecg/JEllipsis'
 
   export default {
     name: "IncidentTicketList",
@@ -156,9 +161,11 @@
     components: {
       JDictSelectTag,
       IncidentTicketModal,
-      IncidentTicketModalDetail
+      IncidentTicketModalDetail,
+      JEllipsis
     },
     data () {
+      let ellipsis = (v, l = 15) => <j-ellipsis value={v} length={l} /> // 省略
       return {
         description: '森_工厂质量事故单-主表管理页面',
         // 表头
@@ -166,65 +173,90 @@
           {
             title:'日期',
             align:"center",
-            dataIndex: 'accidentData'
+            ellipsis: true,
+            dataIndex: 'accidentData',
+            width:100
+          
           },
           {
             title:'质量事故单号',
             align:"center",
-            dataIndex: 'accidentNumber'
+            customRender: (t) => ellipsis(t),
+            dataIndex: 'accidentNumber',
+            width:100
           },
           {
             title:'质量事故单主题',
             align:"center",
-            dataIndex: 'accidentTheme'
+            customRender: (t) => ellipsis(t),
+            dataIndex: 'accidentTheme',
+            width:100,
+            ellipsis: true,
           },
           {
             title:'责任单位',
             align:"center",
-            dataIndex: 'responsibilityCompany'
+            customRender: (t) => ellipsis(t),
+            dataIndex: 'responsibilityCompany',
+            width:160,
           },
           {
             title:'责任人1',
             align:"center",
-            dataIndex: 'responsibilityPerson1'
+            dataIndex: 'responsibilityPerson1',
+            width:80
           },
           {
             title:'责任人2',
             align:"center",
-            dataIndex: 'responsibilityPerson2'
+            dataIndex: 'responsibilityPerson2',
+            width:80
           },
           {
             title:'责任人3',
             align:"center",
-            dataIndex: 'responsibilityPerson3'
+            dataIndex: 'responsibilityPerson3',
+            width:80
           },
 
           {
             title:'计划单号',
             align:"center",
-            dataIndex: 'planNumber'
+            dataIndex: 'planNumber',
+            width:100
           },
           {
             title:'款号',
-            align:"styleNumber",
-            dataIndex: 'businessType'
+            align:"center",
+            dataIndex: 'styleNumber',
+            width:100
           },
           {
             title:'总金额',
-            align:"totalMoney",
-            dataIndex: 'businessType'
+            align:"center",
+            dataIndex: 'totalMoney',
+            width:80
+          },
+          {
+            title:'财务备注',
+            align:"center",
+            dataIndex: 'financeRemark',
+            customRender: (t) => ellipsis(t),
+            width:140
           },
           {
             title:'状态',
             align:"center",
             dataIndex: 'state',
             scopedSlots: { customRender: 'state' },
+            width:80
           },
           {
             title: '操作',
             dataIndex: 'action',
             align:"center",
             scopedSlots: { customRender: 'action' },
+            width:120
           }
         ],
         url: {

+ 81 - 100
src/views/oa/modules/IncidentTicketModal.vue

@@ -6,7 +6,9 @@
     :maskClosable="false"
     :confirmLoading="confirmLoading"
     @ok="handleOk"
-    @cancel="handleCancel">
+    @cancel="handleCancel"
+    destroyOnClose
+    >
     <a-spin :spinning="confirmLoading">
       <!-- 主表单区域 -->
       <div class="table-page-search-wrapper">
@@ -151,14 +153,6 @@
             </a-form-model-item>
           </a-col>
           </a-row>
-          <a-row :gutter="24">
-          <a-col :span="8" >
-            <a-form-model-item label="附件上传" prop="accessory" class="ff">
-              <j-upload  v-model="accessory"  :disabled="true"></j-upload>
-            </a-form-model-item>
-          </a-col>
-          
-          </a-row>
           
          </a-form-model>
          </div>
@@ -172,6 +166,17 @@
          :scroll="{x: 2000,y:300 }"
           :pagination="false"
             >
+             <!-- 自定义表头 -->
+             <span slot="zhanghaoIdTitle" class="form-table-heard">
+             账套号
+            </span>
+            <span slot="exchangeRateTitle" class="form-table-heard">
+             汇率
+            </span>
+            <span slot="practicalSumTitle" class="form-table-heard">
+            实际事故金额
+            </span>
+            
           <!-- 汇率 -->
           <span slot="exchangeRate" slot-scope="text, record, index">
                   <a-input placeholder="请输入" v-model="record.exchangeRate" />
@@ -186,7 +191,11 @@
           </span>
           <!-- 账套号 -->
           <span slot="zhanghaoId" slot-scope="text, record, index">
-                  <a-input placeholder="请输入" v-model="record.zhanghaoId" />
+            <a-select v-model="record.zhanghaoId" @change="handleChange(record)" style="width: 100%;">
+            <a-select-option value="101">101</a-select-option>
+            <a-select-option value="102">102</a-select-option>
+            <a-select-option value="103">103</a-select-option>
+          </a-select>
           </span>
            <!-- 备注 -->
            <span slot="remark" slot-scope="text, record, index">
@@ -196,21 +205,30 @@
 
           <a-form-model layout="inline" ref="form" :model="formState" :rules="validatorRules">
           <a-row :gutter="24">
-          <a-col :span="24" style="height: 110px;">
-            <a-form-model-item label="财务备注" prop="financeRemark" class="nresume">
-              <a-input v-model="formState.financeRemark"  type="textarea"  placeholder="请输入"></a-input>
-            </a-form-model-item>
-          </a-col>
           <a-col :span="24" style="height: 110px;">
             <a-form-model-item label="情况说明" prop="presentationCondition" class="nresume">
               <a-input v-model="formState.presentationCondition"  type="textarea"  placeholder="请输入" readOnly></a-input>
             </a-form-model-item>
           </a-col>
           
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="8" >
+            <a-form-model-item label="附件上传" prop="accessory" class="ff">
+              <j-upload  v-model="accessory"  :disabled="true"></j-upload>
+            </a-form-model-item>
+          </a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="24" style="height: 125px;">
+            <a-form-model-item label="财务备注" prop="financeRemark" class="nresume" >
+              <a-input v-model="formState.financeRemark"  type="textarea"  placeholder="请输入"></a-input>
+            </a-form-model-item>
+          </a-col>
           </a-row>
           <a-row :gutter="24">
             <a-col :span="8">
-            <a-form-model-item label="添加附件" prop="accessory2" class="ff">
+            <a-form-model-item label="财务添加附件" prop="accessory2" class="ff">
               <j-upload  v-model="accessory2"  ></j-upload>
               <!-- <a-input v-model="formState.accessory2"  placeholder="请输入"></a-input> -->
             </a-form-model-item>
@@ -297,86 +315,7 @@
         // 新增时子表默认添加几行空数据
         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: [
-          ]},
+          financeRemark:[{required: true, message: '财务备注不能为空!'}],
         },
         refKeys: ['incidentTicketChildren', ],
         tableKeys:['incidentTicketChildren', ],
@@ -411,18 +350,21 @@
             // scopedSlots: { customRender: 'accidentSum' },
           },
           {
-            title: '汇率',
+            // title: '汇率',
             align: "center",
             dataIndex: 'exchangeRate',
             width: 140,
             scopedSlots: { customRender: 'exchangeRate' },
+            slots:{title:'exchangeRateTitle'},
           },
           {
-            title: '实际事故金额',
+            // title: '实际事故金额',
             align: "center",
             dataIndex: 'practicalSum',
             width: 140,
             scopedSlots: { customRender: 'practicalSum' },
+            slots:{title:'practicalSumTitle'},
+
           },
           {
             title: 'U8生成运费发票号',
@@ -432,11 +374,13 @@
             scopedSlots: { customRender: 'u8Invoice' },
           },
           {
-            title: '账套号',
+            // title: '账套号',
             align: "center",
             dataIndex: 'zhanghaoId',
             width: 140,
             scopedSlots: { customRender: 'zhanghaoId' },
+            slots:{title:'zhanghaoIdTitle'},
+
           },
           
           {
@@ -497,6 +441,9 @@
         getAction('/oa/incidentTicket/queryIncidentTicketChildrenByMainId', {id:id}).then((res) => {
           if(res.success){
             this.incidentTicketChildrenTable.dataSource = res.result
+            this.incidentTicketChildrenTable.dataSource.map(item=>{
+              item.practicalSum = item.accidentSum
+            })
           }else{
             this.$message.warning(res.message)
           }
@@ -518,6 +465,28 @@
       handleOk(){
           this.formState.accessory2 = [{"type":"file","name":this.accessory2,"status":"done","uid":1673507319016,"url":"http://220.191.168.86:18087/jeecg-boot/sys/common/static/"+this.accessory2}]
           this.formState.accessory2 = JSON.stringify(this.formState.accessory2)
+          var addData = 'yes'
+          this.incidentTicketChildrenTable.dataSource.every(item=>{
+            if(item.zhanghaoId==''||!item.zhanghaoId){
+              debugger
+              this.$message.warning('请选择账套号!')
+               addData = 'no'
+               return false;
+            }
+            if(item.exchangeRate=='' || !item.exchangeRate){
+              this.$message.warning('请填写汇率!')
+               addData = 'no'
+               return false;
+            }
+            if(item.practicalSum=='' || !item.practicalSum){
+              this.$message.warning('请填写实际事故金额!')
+               addData = 'no'
+               return false;
+            }
+          })
+      this.$refs.form.validate(valid => {
+        if (valid) { 
+          if(addData=='yes'){
             var obj = this.formState
             obj.incidentTicketChildrenList =  this.incidentTicketChildrenTable.dataSource 
                 putAction('/oa/incidentTicket/edit', obj).then((res) => {
@@ -529,7 +498,15 @@
                        this.$message.warning(res.message)
                      }
                  })
-       
+          } 
+        }
+      })
+      },
+      // 改变账套号
+      handleChange(record){
+        this.incidentTicketChildrenTable.dataSource.map(item=>{
+          item.zhanghaoId = record.zhanghaoId
+        })
       },
        //关闭
        handleCancel(){
@@ -591,4 +568,8 @@
 /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item>.ant-form-item-label{
   width: 118px;
 }
+.form-table-heard:before {
+      content: '*';
+      color: red;
+    }
 </style>

+ 15 - 16
src/views/oa/modules/IncidentTicketModalDetail.vue

@@ -165,15 +165,6 @@
             </a-form-model-item>
           </a-col>
           </a-row>
-          <a-row :gutter="24">
-          
-            <a-col :span="8" >
-            <a-form-model-item label="附件上传" prop="accessory" class="ff">
-              <j-upload  v-model="accessory"  :disabled="true"></j-upload>
-            </a-form-model-item>
-          </a-col>
-          
-          </a-row>
 
           
          </a-form-model>
@@ -212,21 +203,29 @@
             <!-- 主表单区域 -->
         <a-form-model layout="inline" ref="form" :model="formState" :rules="validatorRules">
           <a-row :gutter="24">
-          <a-col :span="24" style="height: 110px;">
-            <a-form-model-item label="财务备注" prop="financeRemark" class="nresume">
-              <a-input v-model="formState.financeRemark"  type="textarea"  placeholder="请输入" readOnly></a-input>
-            </a-form-model-item>
-          </a-col>
           <a-col :span="24" style="height: 110px;">
             <a-form-model-item label="情况说明" prop="presentationCondition" class="nresume">
               <a-input v-model="formState.presentationCondition"  type="textarea"  placeholder="请输入" readOnly></a-input>
             </a-form-model-item>
           </a-col>
-          
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="8" >
+            <a-form-model-item label="附件上传" prop="accessory" class="ff">
+              <j-upload  v-model="accessory"  :disabled="true"></j-upload>
+            </a-form-model-item>
+          </a-col>
+          </a-row>
+          <a-row :gutter="24">
+          <a-col :span="24" style="height: 110px;">
+            <a-form-model-item label="财务备注" prop="financeRemark" class="nresume">
+              <a-input v-model="formState.financeRemark"  type="textarea"  placeholder="请输入" readOnly></a-input>
+            </a-form-model-item>
+          </a-col>          
           </a-row>
           <a-row :gutter="24">
             <a-col :span="8">
-            <a-form-model-item label="添加附件" prop="accessory2" class="ff">
+            <a-form-model-item label="财务添加附件" prop="accessory2" class="ff">
               <j-upload  v-model="accessory2"  ></j-upload>
               <!-- <a-input v-model="formState.accessory2"  placeholder="请输入"></a-input> -->
             </a-form-model-item>