瀏覽代碼

数据确认

于涵 1 年之前
父節點
當前提交
3f627f090c
共有 1 個文件被更改,包括 54 次插入23 次删除
  1. 54 23
      itdmWeb/src/views/module-iTDM/gongdanshuju/ItdmGongdanShujuList2.vue

+ 54 - 23
itdmWeb/src/views/module-iTDM/gongdanshuju/ItdmGongdanShujuList2.vue

@@ -127,9 +127,20 @@
               <input v-model="row.shiyanType" type="text" class="myinput" />
             </template>
           </vxe-column>
+          <!-- <vxe-column field="shiyanType_dictText" title="试验类型" :edit-render="{}">
+            <template #default="{ row }">
+              <span>{{ formatShiyanType(row.shiyanType) }}</span>
+            </template>
+            <template #edit="{ row }">
+              <vxe-select v-model="row.shiyanType" placeholder="请选择试验类型">
+                <vxe-option v-for="(item, index) in shiiyanTypeOptions" :key="index" :value="item.value" :label="item.label"></vxe-option>
+              </vxe-select>
+            </template>
+          </vxe-column> -->
           <vxe-column field="shiyanTime" title="生成时间" :edit-render="{autofocus: '.vxe-input--inner'}">
             <template #edit="{ row }">
-              <vxe-input v-model="row.shiyanTime" type="text"></vxe-input>
+              <vxe-input v-model="row.shiyanTime" type="text" placeholder="输入生成时间"></vxe-input>
+              <!-- <vxe-input v-model="row.shiyanTime" type="time" placeholder="选择生成时间" clearable label-format="HH:mm" valueFormat="HH:mm"></vxe-input> -->
             </template>
           </vxe-column>
           <vxe-column field="shiyanWendu" title="温度" :edit-render="{autofocus: '.vxe-input--inner'}">
@@ -151,6 +162,7 @@
 <script>
 import { mixinDevice } from '@/utils/mixin'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import {initDictOptions, filterDictText} from '@/components/dict/JDictSelectUtil'
 import { getWeituoClientList, getWeituoInfoListByClient, getWeituoRq, getWeituoGdh, listSj, saveSj } from '@/api/api'
 import VXETable from 'vxe-table'
 export default {
@@ -172,13 +184,10 @@ export default {
             shiyanKaishitime: '',
             shiyanJieshutime: '',
             pinci: '',
-
             // url: {
             //     list: '/itdmgomgongdanshuju/ItdmGongdanshuju/list',
             // },
             dataSource: [],
-
-
             tableMenu: {
                 body: {
                 options: [
@@ -190,11 +199,13 @@ export default {
                 ]
                 }
             },
+            // shiiyanTypeOptions: []
 
         }
     },
     created() {
         this.getClientList();
+        // this.initDictConfig()
     },
     methods: {
         // 获取委托单位下拉列表
@@ -275,41 +286,44 @@ export default {
             this.dataSource = []
         },
         // vex-table
-          async insertEvent () {
+        async insertEvent () {
             const $table = this.$refs.xTable
             const record = {
-              sex: '1'
+                shiyanType: '',
+                shiyanTime: '',
+                shiyanWendu: '',
+                shiyanShidu: ''
             }
             const { row: newRow } = await $table.insertAt(record)
-            await $table.setActiveCell(newRow, 'name')
-          },
-          getInsertEvent () {
+            console.log(this.$refs.xTable)
+            await $table.setActiveCell(newRow, 'shiyanType')
+        },
+        getInsertEvent () {
             const $table = this.$refs.xTable
             const insertRecords = $table.getInsertRecords()
             VXETable.modal.alert(insertRecords.length)
-          },
-          getSelectionEvent () {
+        },
+        getSelectionEvent () {
             const $table = this.$refs.xTable
             const selectRecords = $table.getCheckboxRecords()
             VXETable.modal.alert(selectRecords.length)
-          },
+        },
 
-            // 提交
-            submitSJ(){
-                console.log(this.dataSource)
-                saveSj(this.dataSource).then((res) => {
-                })
-            },
+        // 提交
+        submitSJ(){
+            this.dataSource = this.$refs.xTable.afterFullData
+            // console.log(this.dataSource)
+            saveSj(this.dataSource).then((res) => {
+            })
+            
+        },
         create() {
 
             var select = this.queryParam
             select.shiyanKaishitime = this.shiyanKaishitime
             select.shiyanJieshutime = this.shiyanJieshutime
             select.pinci = this.pinci
-
-
-
-
+          
             httpAction('/itdmgomgongdanshuju/ItdmGongdanshuju/create',select, 'post').then((res) => {
                 if (res.success) {
                 console.log(res)
@@ -321,7 +335,24 @@ export default {
                 this.searchReset()
             })
 
-        }
+        },
+        // // 获取字典数据-试验类型
+        // initDictConfig() {
+        //   initDictOptions('shiiyan_type').then((res) => {
+        //     if (res.success) {
+        //         this.shiiyanTypeOptions = res.result;
+        //     }
+        //   });
+        // },
+        // // 试验类型显示
+        // formatShiyanType (value) {
+        //   var typeLabel
+        //   var typeObj = this.shiiyanTypeOptions.find(res => res.value === value)
+        //   if(typeObj){
+        //     typeLabel = typeObj.label
+        //   }
+        //   return typeLabel
+        // },
     }
     
 }