Browse Source

物质页面调整

lining 7 years ago
parent
commit
32fd1d15e1

+ 178 - 0
src/dashoo.cn/frontend_web/src/pages/lims/wzjys/reportdrillcollar/_opera/datahistory.vue

@@ -0,0 +1,178 @@
+<template>
+  <el-dialog title="历史数据录入信息" :visible.sync="dialogTableVisible">
+    <!--<br />-->
+    <!--<el-alert title="" description="您可以选择相同模板输入的历史数据,加入您的数据中再做相应修改" type="success" :closable="false">-->
+    <!--</el-alert>-->
+    <!--<br />-->
+    <el-card class="box-card">
+      <el-table :data="dataentryhistorylist" :stripe="true">
+        <el-table-column label="操作" width="100">
+          <template slot-scope="scope">
+            <el-button @click="handleselectentry(scope.row)" type="primary" plain size="mini" title="选择">
+              选择</el-button>
+          </template>
+        </el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="DataEntryCode" label="委托单号"></el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="CustomerName" label="委托单位"></el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="DocType" label="文档名称"></el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="CreatedTime" label="生成时间">
+          <template slot-scope="scope">
+            <p>{{jstimehandle(scope.row.CreatedTime)}}</p>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-pagination @current-change="historyhandleCurrentChange" :current-page="historycurrentPage"
+                     :page-sizes="[10, 15, 20, 25]" :page-size="historysize" layout="total, sizes, prev, pager, next, jumper" :total="historycurrentItemCount">
+      </el-pagination>
+    </el-card>
+  </el-dialog>
+</template>
+<script>
+  import { mapGetters } from 'vuex'
+  import api from '@/api/lims/dataEntry'
+
+  export default {
+    computed: {
+      ...mapGetters({
+        authUser: 'authUser'
+      })
+    },
+    name: 'limsdrillcollarHistory',
+    data () {
+      return {
+        PositionCheckId: '',
+        TestDepartId: '',
+        CustomerId: '',
+        MId: '',
+        tbid: '',
+        EId: '',
+        DataEntryId: '',
+        datadocId: '',
+        historycurrentItemCount: 0,
+        historycurrentPage: 1,
+        historysize: 10,
+        dialogTableVisible: false,
+        dataentryhistorylist: []
+      }
+    },
+    created () {
+    },
+    methods: {
+      OpenOrignDataInput (values) {
+        this.dataentryhistorylist = []
+        this.tbid = values.TaskBalanceId
+        this.EId = values.EId
+        this.DataEntryId = values.DataEntryId
+        this.datadocId = values.DataDocId
+        this.MId = values.Id
+        const params = {
+          _currentPage: this.historycurrentPage,
+          _size: this.historysize,
+          datadocId: this.datadocId,
+          testdetailId: values.TestDepartId,
+          postioncheckId: values.PositionCheckId,
+          customerId: values.EntrustCorp
+        }
+        let entryId = values.Id
+        api.getDataEntryReportList(params, entryId, this.$axios)
+          .then(res => {
+            this.dataentryhistorylist = res.data.item
+            this.historycurrentItemCount = res.data.currentItemCount
+          }).catch(err => {
+            console.error(err)
+          })
+      },
+
+      handleselectentry (val) {
+        let params = {
+          eid: this.EId,
+          tbid: this.tbid,
+          deid: this.DataEntryId,
+          datadocId: this.datadocId
+        }
+        api.dataEntryhistory(params, val.Id, this.$axios)
+          .then(res => {
+            if (res.data.code === 0) {
+              this.dialogTableVisible = false
+              this.$emit('initDatas')
+            } else {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          }).catch(err => {
+            console.error(err)
+          })
+      },
+
+      historyhandleCurrentChange (value) {
+        this.historycurrentPage = value
+        this.refreshdataentrydata()
+      },
+
+      historyhandleSizeChange (value) {
+        this.historysize = value
+        this.historycurrentPage = 1
+        this.refreshdataentrydata()
+      },
+
+      // 选择页码刷新历史数据
+      refreshdataentrydata () {
+        const params = {
+          _currentPage: this.historycurrentPage,
+          _size: this.historysize,
+          datadocId: this.datadocId,
+          testdetailId: this.TestDepartId,
+          postioncheckId: this.PositionCheckId,
+          customerId: this.CustomerId
+        }
+        let entryId = this.MId
+        api.getDataEntryReportList(params, entryId, this.$axios)
+          .then(res => {
+            this.dataentryhistorylist = res.data.item
+            this.historycurrentItemCount = res.data.currentItemCount
+          }).catch(err => {
+            console.error(err)
+          })
+      },
+
+      jstimehandle (val) {
+        if (val === '') {
+          return '----'
+        } else if (val === '0001-01-01T08:00:00+08:00') {
+          return '----'
+        } else if (val === '5000-01-01T23:59:59+08:00') {
+          return '永久'
+        } else {
+          val = val.replace('T', ' ')
+          return val.substring(0, 10)
+        }
+      },
+
+      formatDateTime (date) {
+        var y = date.getFullYear()
+        var m = date.getMonth() + 1
+        m = m < 10 ? ('0' + m) : m
+        var d = date.getDate()
+        d = d < 10 ? ('0' + d) : d
+        var h = date.getHours()
+        var minute = date.getMinutes()
+        minute = minute < 10 ? ('0' + minute) : minute
+        return y + '-' + m + '-' + d + ' ' + h + ':' + minute
+      },
+
+      in_array_positionname (stringToSearch, arrayToSearch) {
+        for (let s = 0; s < arrayToSearch.length; s++) {
+          let thisEntry = arrayToSearch[s].PositionName
+          if (thisEntry === stringToSearch) {
+            return true
+          }
+        }
+        return false
+      }
+
+    }
+  }
+</script>
+

+ 113 - 52
src/dashoo.cn/frontend_web/src/pages/lims/wzjys/reportdrillcollar/_opera/datalist.vue

@@ -118,7 +118,7 @@
       </el-card>
       <el-card>
         <el-table :data="entityList" border height="calc(100vh - 250px)" highlight-current-row style="width: 100%"
-          @sort-change="orderby">
+          @sort-change="orderby" @current-change="saveTableRow" @row-dblclick="dbTableRow">
           <el-table-column v-if="this.DataStatus==0||this.DataStatus==5||this.DataStatus==3" label="操作" min-width="190"
             align="center" fixed>
             <template slot-scope="scope">
@@ -144,58 +144,58 @@
             </template>
           </el-table-column>
           <el-table-column label="紧密距(mm)" align="center">
-            <el-table-column prop="CloseDistanceOut" sortable min-width="90" label="外螺纹" align="center"
+            <el-table-column prop="CloseDistanceOut" sortable min-width="110" label="外螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.CloseDistanceOut" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.CloseDistanceOut" style="width: 100%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="CloseDistanceIn" sortable min-width="90" label="内螺纹" align="center"
+            <el-table-column prop="CloseDistanceIn" sortable min-width="110" label="内螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.CloseDistanceIn" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.CloseDistanceIn" style="width: 100%"></el-input>
               </template>
             </el-table-column>
           </el-table-column>
           <el-table-column label="锥度公差·10-3(in/in)" align="center">
-            <el-table-column prop="TaperToleranceOut" sortable min-width="140" label="外螺纹" align="center"
+            <el-table-column prop="TaperToleranceOut" sortable min-width="220" label="外螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.TaperToleranceOut1" style="width: 50%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.TaperToleranceOut1" style="width: 50%"></el-input>
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                          v-model="scope.row.TaperToleranceOut2" style="width: 50%"></el-input>
+                          type="number" step="0.01" v-model.number="scope.row.TaperToleranceOut2" style="width: 50%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="TaperToleranceIn" sortable min-width="140" label="内螺纹" align="center"
+            <el-table-column prop="TaperToleranceIn" sortable min-width="220" label="内螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.TaperToleranceIn1" style="width: 50%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.TaperToleranceIn1" style="width: 50%"></el-input>
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                          v-model="scope.row.TaperToleranceIn2" style="width: 50%"></el-input>
+                          type="number" step="0.01" v-model.number="scope.row.TaperToleranceIn2" style="width: 50%"></el-input>
               </template>
             </el-table-column>
           </el-table-column>
           <el-table-column label="螺距公差·10-3(in/in)" align="center">
-            <el-table-column prop="PitchToleranceOut" sortable min-width="140" label="外螺纹" align="center"
+            <el-table-column prop="PitchToleranceOut" sortable min-width="220" label="外螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.PitchToleranceOut1" style="width: 50%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.PitchToleranceOut1" style="width: 50%"></el-input>
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                          v-model="scope.row.PitchToleranceOut2" style="width: 50%"></el-input>
+                          type="number" step="0.01" v-model.number="scope.row.PitchToleranceOut2" style="width: 50%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="PitchToleranceIn" sortable min-width="140" label="内螺纹" align="center"
+            <el-table-column prop="PitchToleranceIn" sortable min-width="220" label="内螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.PitchToleranceIn1" style="width: 50%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.PitchToleranceIn1" style="width: 50%"></el-input>
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                          v-model="scope.row.PitchToleranceIn2" style="width: 50%"></el-input>
+                          type="number" step="0.01" v-model.number="scope.row.PitchToleranceIn2" style="width: 50%"></el-input>
               </template>
             </el-table-column>
           </el-table-column>
@@ -204,121 +204,121 @@
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.ShoulderSurface" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.ShoulderSurface" style="width: 100%"></el-input>
               </template>
             </el-table-column>
             <el-table-column prop="EndFace" sortable min-width="150" label="与端面垂直度" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.EndFace" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.EndFace" style="width: 100%"></el-input>
               </template>
             </el-table-column>
           </el-table-column>
           <el-table-column sortable min-width="160" label="管体外径(mm)" align="center" show-overflow-tooltip>
-            <el-table-column prop="MajorAxis" sortable min-width="150" label="长轴" align="center" show-overflow-tooltip>
+            <el-table-column prop="MajorAxis" sortable min-width="110" label="长轴" align="center" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.MajorAxis" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.MajorAxis" style="width: 100%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="ShortAxis" sortable min-width="150" label="短轴" align="center" show-overflow-tooltip>
+            <el-table-column prop="ShortAxis" sortable min-width="110" label="短轴" align="center" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.ShortAxis" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.ShortAxis" style="width: 100%"></el-input>
               </template>
             </el-table-column>
           </el-table-column>
-          <el-table-column prop="OutDiaDif" sortable min-width="130" label="外径差(mm)" align="center"
+          <el-table-column prop="OutDiaDif" sortable min-width="150" label="外径差(mm)" align="center"
             show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.OutDiaDif" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.OutDiaDif" style="width: 100%"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="DF" sortable min-width="120" label="DF(mm)" align="center" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.DF" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.DF" style="width: 100%"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="QC" sortable min-width="125" label="QC(mm)" align="center" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.QC" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.QC" style="width: 100%"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="DRG" sortable min-width="140" label="DRG(mm)" align="center" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.DRG" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.DRG" style="width: 100%"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="LPC" sortable min-width="130" label="LPC(mm)" align="center" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.LPC" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.LPC" style="width: 100%"></el-input>
             </template>
           </el-table-column>
           <el-table-column sortable min-width="350" label="壁厚(mm)" align="center" show-overflow-tooltip>
-            <el-table-column prop="WallDif1" sortable min-width="100" label="t大" align="center" show-overflow-tooltip>
+            <el-table-column prop="WallDif1" sortable min-width="110" label="t大" align="center" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.WallDif1" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.WallDif1" style="width: 100%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="ExDiameterM1" sortable min-width="100" label="t小" align="center"
+            <el-table-column prop="ExDiameterM1" sortable min-width="110" label="t小" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.ExDiameterM1" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.ExDiameterM1" style="width: 100%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="WallDifference1" sortable min-width="100" label="△" align="center"
+            <el-table-column prop="WallDifference1" sortable min-width="110" label="△" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.WallDifference1" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.WallDifference1" style="width: 100%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="WallDif2" sortable min-width="100" label="t大" align="center" show-overflow-tooltip>
+            <el-table-column prop="WallDif2" sortable min-width="110" label="t大" align="center" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.WallDif2" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.WallDif2" style="width: 100%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="ExDiameterM2" sortable min-width="100" label="t小" align="center"
+            <el-table-column prop="ExDiameterM2" sortable min-width="110" label="t小" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.ExDiameterM2" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.ExDiameterM2" style="width: 100%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="WallDifference2" sortable min-width="100" label="△" align="center"
+            <el-table-column prop="WallDifference2" sortable min-width="110" label="△" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.WallDifference2" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.WallDifference2" style="width: 100%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="WallDif3" sortable min-width="100" label="t大" align="center" show-overflow-tooltip>
+            <el-table-column prop="WallDif3" sortable min-width="110" label="t大" align="center" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.WallDif3" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.WallDif3" style="width: 100%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="ExDiameterM3" sortable min-width="100" label="t小" align="center"
+            <el-table-column prop="ExDiameterM3" sortable min-width="110" label="t小" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.ExDiameterM3" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.ExDiameterM3" style="width: 100%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="WallDifference3" sortable min-width="100" label="△" align="center"
+            <el-table-column prop="WallDifference3" sortable min-width="110" label="△" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.WallDifference3" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.WallDifference3" style="width: 100%"></el-input>
               </template>
             </el-table-column>
           </el-table-column>
@@ -326,14 +326,14 @@
             show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.InterDiameter" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.InterDiameter" style="width: 100%"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="TubeLength" sortable min-width="150" label="管体长度(m)" align="center"
             show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.TubeLength" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.TubeLength" style="width: 100%"></el-input>
             </template>
           </el-table-column>
 
@@ -516,7 +516,7 @@
     </el-dialog>
     <data-opera ref="DataoperaCompoment" :DataEntryId="DataEntryId+''" :TaskBalanceId="TaskBalanceId+''" :EId="EId+''"
       @init-data="initDatas"></data-opera>
-
+    <data-history ref="historyDataCompoment" @init-datalist="initDatas"></data-history>
   </div>
 </template>
 <script>
@@ -525,6 +525,8 @@
   } from 'vuex'
   import api from '@/api/wzjys/limsdrillcollar'
   import DataOpera from './operation.vue'
+  import DataHistory from './datahistory.vue'
+  import cmp from '@/utils/strings.js'
 
   export default {
     computed: {
@@ -534,7 +536,8 @@
     },
     name: 'limsdrillcollar',
     components: {
-      DataOpera
+      DataOpera,
+      DataHistory
     },
     data () {
       return {
@@ -562,6 +565,9 @@
         },
         formDataMain: {
           Id: '',
+          EId: '',
+          DocId: '',
+          TaskId: '',
           Product: '',
           Spec: '',
           SamplingBase: '',
@@ -630,6 +636,14 @@
           SuccessStatus: 2,
           AuditorRemark: '',
           DataEntryId: 0
+        },
+        rowHistory: {},
+        params: {
+          Id: '',
+          EId: '',
+          DataDocId: '',
+          TaskBalanceId: '',
+          DataEntryId: ''
         }
       }
     },
@@ -674,14 +688,25 @@
       getDataEntry () {
         this.$axios.get('/limsdataentry/getdataentry/' + this.DataEntryId).then(res => {
           this.formDataMain = res.data
+          if (!this.formDataMain.InspectionDate || this.formDataMain.InspectionDate.indexOf('0001-01-01') !== -1) {
+            this.formDataMain.InspectionDate = new Date()
+          }
           // this.params.Id = res.data.Id
         }).catch(error => {
           console.log(error)
         })
       },
-      getDataHistory () {
 
+      getDataHistory () {
+        this.params.DataDocId = this.formDataMain.DocId
+        this.params.TaskBalanceId = this.formDataMain.TaskId
+        this.params.EId = this.formDataMain.EId
+        this.params.DataEntryId = this.formDataMain.Id
+        this.params.Id = this.formDataMain.Id
+        this.$refs['historyDataCompoment'].dialogTableVisible = true
+        this.$refs['historyDataCompoment'].OpenOrignDataInput(this.params)
       },
+
       initDatas () {
         // 分页及列表条件
         let params = {
@@ -833,6 +858,42 @@
         })
       },
 
+      dbTableRow (row) {
+        if (this.entityList.length === 1) {
+          this.updateTableRow(row)
+        }
+      },
+      saveTableRow (row, oldRow) {
+        let noChange = true
+        if (oldRow && row) {
+          let tmpRow = {}
+          Object.assign(tmpRow, oldRow)
+          noChange = cmp(this.rowHistory, tmpRow)
+        }
+        if (oldRow && oldRow.Id > 0 && !noChange) {
+          this.updateTableRow(oldRow)
+        }
+        Object.assign(this.rowHistory, row)
+      },
+      updateTableRow (row) {
+        api.updateEntity(row.Id, row, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            // 保存成功后,初始化数据,变成修改
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+
       searchCommand (command) {
         if (command === 'search') {
           this.dialogVisible = true

+ 181 - 0
src/dashoo.cn/frontend_web/src/pages/lims/wzjys/reportpetroleumpipe/_opera/datahistory.vue

@@ -0,0 +1,181 @@
+<template>
+  <el-dialog title="历史数据录入信息" :visible.sync="dialogTableVisible">
+    <!--<br />-->
+    <!--<el-alert title="" description="您可以选择相同模板输入的历史数据,加入您的数据中再做相应修改" type="success" :closable="false">-->
+    <!--</el-alert>-->
+    <!--<br />-->
+    <el-card class="box-card">
+      <el-table :data="dataentryhistorylist" :stripe="true">
+        <el-table-column label="操作" width="100">
+          <template slot-scope="scope">
+            <el-button @click="handleselectentry(scope.row)" type="primary" plain size="mini" title="选择">
+              选择</el-button>
+          </template>
+        </el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="DataEntryCode" label="委托单号"></el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="CustomerName" label="委托单位"></el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="DocType" label="文档名称"></el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="CreatedTime" label="生成时间">
+          <template slot-scope="scope">
+            <p>{{jstimehandle(scope.row.CreatedTime)}}</p>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-pagination @current-change="historyhandleCurrentChange" :current-page="historycurrentPage"
+                     :page-sizes="[10, 15, 20, 25]" :page-size="historysize" layout="total, sizes, prev, pager, next, jumper" :total="historycurrentItemCount">
+      </el-pagination>
+    </el-card>
+  </el-dialog>
+</template>
+<script>
+  import { mapGetters } from 'vuex'
+  import api from '@/api/lims/dataEntry'
+
+  export default {
+    computed: {
+      ...mapGetters({
+        authUser: 'authUser'
+      })
+    },
+    name: 'limspetroleumpipeHistory',
+    data () {
+      return {
+        PositionCheckId: '',
+        TestDepartId: '',
+        CustomerId: '',
+        MId: '',
+        tbid: '',
+        EId: '',
+        DataEntryId: '',
+        datadocId: '',
+        historycurrentItemCount: 0,
+        historycurrentPage: 1,
+        historysize: 10,
+        dialogTableVisible: false,
+        dataentryhistorylist: []
+      }
+    },
+    created () {
+    },
+    methods: {
+      OpenOrignDataInput (values) {
+        this.dataentryhistorylist = []
+        this.tbid = values.TaskBalanceId
+        this.EId = values.EId
+        this.DataEntryId = values.DataEntryId
+        this.datadocId = values.DataDocId
+        this.TestDepartId = values.TestDepartId
+        this.PositionCheckId = values.PositionCheckId
+        this.CustomerId = values.EntrustCorp
+        this.MId = values.Id
+        const params = {
+          _currentPage: this.historycurrentPage,
+          _size: this.historysize,
+          datadocId: this.datadocId,
+          testdetailId: values.TestDepartId,
+          postioncheckId: values.PositionCheckId,
+          customerId: values.EntrustCorp
+        }
+        let entryId = values.Id
+        api.getDataEntryReportList(params, entryId, this.$axios)
+          .then(res => {
+            this.dataentryhistorylist = res.data.item
+            this.historycurrentItemCount = res.data.currentItemCount
+          }).catch(err => {
+            console.error(err)
+          })
+      },
+
+      handleselectentry (val) {
+        let params = {
+          eid: this.EId,
+          tbid: this.tbid,
+          deid: this.DataEntryId,
+          datadocId: this.datadocId
+        }
+        api.dataEntryhistory(params, val.Id, this.$axios)
+          .then(res => {
+            if (res.data.code === 0) {
+              this.dialogTableVisible = false
+              this.$emit('init-datalist')
+            } else {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          }).catch(err => {
+            console.error(err)
+          })
+      },
+
+      historyhandleCurrentChange (value) {
+        this.historycurrentPage = value
+        this.refreshdataentrydata()
+      },
+
+      historyhandleSizeChange (value) {
+        this.historysize = value
+        this.historycurrentPage = 1
+        this.refreshdataentrydata()
+      },
+
+      // 选择页码刷新历史数据
+      refreshdataentrydata () {
+        const params = {
+          _currentPage: this.historycurrentPage,
+          _size: this.historysize,
+          datadocId: this.datadocId,
+          testdetailId: this.TestDepartId,
+          postioncheckId: this.PositionCheckId,
+          customerId: this.CustomerId
+        }
+        let entryId = this.MId
+        api.getDataEntryReportList(params, entryId, this.$axios)
+          .then(res => {
+            this.dataentryhistorylist = res.data.item
+            this.historycurrentItemCount = res.data.currentItemCount
+          }).catch(err => {
+            console.error(err)
+          })
+      },
+
+      jstimehandle (val) {
+        if (val === '') {
+          return '----'
+        } else if (val === '0001-01-01T08:00:00+08:00') {
+          return '----'
+        } else if (val === '5000-01-01T23:59:59+08:00') {
+          return '永久'
+        } else {
+          val = val.replace('T', ' ')
+          return val.substring(0, 10)
+        }
+      },
+
+      formatDateTime (date) {
+        var y = date.getFullYear()
+        var m = date.getMonth() + 1
+        m = m < 10 ? ('0' + m) : m
+        var d = date.getDate()
+        d = d < 10 ? ('0' + d) : d
+        var h = date.getHours()
+        var minute = date.getMinutes()
+        minute = minute < 10 ? ('0' + minute) : minute
+        return y + '-' + m + '-' + d + ' ' + h + ':' + minute
+      },
+
+      in_array_positionname (stringToSearch, arrayToSearch) {
+        for (let s = 0; s < arrayToSearch.length; s++) {
+          let thisEntry = arrayToSearch[s].PositionName
+          if (thisEntry === stringToSearch) {
+            return true
+          }
+        }
+        return false
+      }
+
+    }
+  }
+</script>
+

+ 101 - 43
src/dashoo.cn/frontend_web/src/pages/lims/wzjys/reportpetroleumpipe/_opera/datalist.vue

@@ -118,7 +118,7 @@
       </el-card>
       <el-card>
         <el-table :data="entityList" border height="calc(100vh - 250px)" highlight-current-row style="width: 100%"
-          @sort-change="orderby">
+          @sort-change="orderby" @current-change="saveTableRow" @row-dblclick="dbTableRow">
           <el-table-column v-if="this.DataStatus==0||this.DataStatus==5||this.DataStatus==3" label="操作" min-width="190"
             align="center" fixed>
             <template slot-scope="scope">
@@ -144,82 +144,78 @@
             </template>
           </el-table-column>
           <el-table-column label="紧密距(mm)" align="center">
-            <el-table-column prop="CloseDistanceOut" sortable min-width="140" label="外螺纹" align="center"
+            <el-table-column prop="CloseDistanceOut" sortable min-width="110" label="外螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.CloseDistanceOut1" style="width: 50%"></el-input>
-                <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                          v-model="scope.row.CloseDistanceOut2" style="width: 50%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.CloseDistanceOut" style="width: 100%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="CloseDistanceIn" sortable min-width="140" label="内螺纹" align="center"
+            <el-table-column prop="CloseDistanceIn" sortable min-width="110" label="内螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.CloseDistanceIn1" style="width: 50%"></el-input>
-                <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                          v-model="scope.row.CloseDistanceIn2" style="width: 50%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.CloseDistanceIn" style="width: 100%"></el-input>
               </template>
             </el-table-column>
           </el-table-column>
           <el-table-column label="锥度公差·10-3(in/in)" align="center">
-            <el-table-column prop="TaperToleranceOut" sortable min-width="140" label="外螺纹" align="center"
+            <el-table-column prop="TaperToleranceOut" sortable min-width="220" label="外螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.TaperToleranceOut1" style="width: 50%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.TaperToleranceOut1" style="width: 50%"></el-input>
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                          v-model="scope.row.TaperToleranceOut2" style="width: 50%"></el-input>
+                          type="number" step="0.01" v-model.number="scope.row.TaperToleranceOut2" style="width: 50%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="TaperToleranceIn" sortable min-width="140" label="内螺纹" align="center"
+            <el-table-column prop="TaperToleranceIn" sortable min-width="220" label="内螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.TaperToleranceIn1" style="width: 50%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.TaperToleranceIn1" style="width: 50%"></el-input>
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                          v-model="scope.row.TaperToleranceIn2" style="width: 50%"></el-input>
+                          type="number" step="0.01" v-model.number="scope.row.TaperToleranceIn2" style="width: 50%"></el-input>
               </template>
             </el-table-column>
           </el-table-column>
           <el-table-column label="螺距公差·10-3(in/in)" align="center">
-            <el-table-column prop="PitchToleranceOut" sortable min-width="140" label="外螺纹" align="center"
+            <el-table-column prop="PitchToleranceOut" sortable min-width="220" label="外螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.PitchToleranceOut1" style="width: 50%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.PitchToleranceOut1" style="width: 50%"></el-input>
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                          v-model="scope.row.PitchToleranceOut2" style="width: 50%"></el-input>
+                          type="number" step="0.01" v-model.number="scope.row.PitchToleranceOut2" style="width: 50%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="PitchToleranceIn" sortable min-width="140" label="内螺纹" align="center"
+            <el-table-column prop="PitchToleranceIn" sortable min-width="220" label="内螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.PitchToleranceIn1" style="width: 50%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.PitchToleranceIn1" style="width: 50%"></el-input>
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                          v-model="scope.row.PitchToleranceIn2" style="width: 50%"></el-input>
+                          type="number" step="0.01" v-model.number="scope.row.PitchToleranceIn2" style="width: 50%"></el-input>
               </template>
             </el-table-column>
           </el-table-column>
           <el-table-column label="齿高公差·10-3(in)" align="center">
-            <el-table-column prop="DepthToleranceOut" sortable min-width="140" label="外螺纹" align="center"
+            <el-table-column prop="DepthToleranceOut" sortable min-width="220" label="外螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.DepthToleranceOut1" style="width: 50%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.DepthToleranceOut1" style="width: 50%"></el-input>
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                          v-model="scope.row.DepthToleranceOut2" style="width: 50%"></el-input>
+                          type="number" step="0.01" v-model.number="scope.row.DepthToleranceOut2" style="width: 50%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="DepthToleranceIn" sortable min-width="140" label="内螺纹" align="center"
+            <el-table-column prop="DepthToleranceIn" sortable min-width="220" label="内螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.DepthToleranceIn1" style="width: 50%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.DepthToleranceIn1" style="width: 50%"></el-input>
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                          v-model="scope.row.DepthToleranceIn2" style="width: 50%"></el-input>
+                          type="number" step="0.01" v-model.number="scope.row.DepthToleranceIn2" style="width: 50%"></el-input>
               </template>
             </el-table-column>
           </el-table-column>
@@ -227,50 +223,50 @@
             show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.EdgeWidth" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.EdgeWidth" style="width: 100%"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="DiagonalWidth" sortable min-width="150" label="对角宽(mm)" align="center"
             show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.DiagonalWidth" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.DiagonalWidth" style="width: 100%"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="LPC" sortable min-width="130" label="LPC(mm)" align="center" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.LPC" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.LPC" style="width: 100%"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="DF" sortable min-width="120" label="DF(mm)" align="center" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.DF" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.DF" style="width: 100%"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="QC" sortable min-width="125" label="QC(mm)" align="center" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.QC" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.QC" style="width: 100%"></el-input>
             </template>
           </el-table-column>
-          <el-table-column prop="WallThickness" sortable min-width="210" label="壁厚(mm)" align="center"
+          <el-table-column prop="WallThickness" sortable min-width="330" label="壁厚(mm)" align="center"
             show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.WallThickness1" style="width: 33%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.WallThickness1" style="width: 33%"></el-input>
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                        v-model="scope.row.WallThickness2" style="width: 33%"></el-input>
+                        type="number" step="0.01" v-model.number="scope.row.WallThickness2" style="width: 33%"></el-input>
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                        v-model="scope.row.WallThickness3" style="width: 34%"></el-input>
+                        type="number" step="0.01" v-model.number="scope.row.WallThickness3" style="width: 34%"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="JointInDiameter" sortable min-width="160" label="接头内径(mm)" align="center"
             show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.JointInDiameter" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.JointInDiameter" style="width: 100%"></el-input>
             </template>
           </el-table-column>
           <el-table-column label="接头外径(mm)" align="center">
@@ -278,14 +274,14 @@
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.ExDiameterF" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.ExDiameterF" style="width: 100%"></el-input>
               </template>
             </el-table-column>
             <el-table-column prop="JointDiameterF" sortable min-width="100" label="母端" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.ExDiameterM" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.ExDiameterM" style="width: 100%"></el-input>
               </template>
             </el-table-column>
           </el-table-column>
@@ -293,7 +289,7 @@
             show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.TubeLength" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.TubeLength" style="width: 100%"></el-input>
             </template>
           </el-table-column>
 
@@ -485,7 +481,7 @@
     </el-dialog>
     <data-opera ref="DataoperaCompoment" :DataEntryId="DataEntryId+''" :TaskBalanceId="TaskBalanceId+''" :EId="EId+''"
       @init-data="initDatas"></data-opera>
-
+    <data-history ref="historyDataCompoment" @init-datalist="initDatas"></data-history>
   </div>
 </template>
 <script>
@@ -494,6 +490,8 @@
   } from 'vuex'
   import api from '@/api/wzjys/limspetroleumpipe'
   import DataOpera from './operation.vue'
+  import DataHistory from './datahistory.vue'
+  import cmp from '@/utils/strings.js'
 
   export default {
     computed: {
@@ -503,7 +501,8 @@
     },
     name: 'limspetroleumpipe',
     components: {
-      DataOpera
+      DataOpera,
+      DataHistory
     },
     data () {
       return {
@@ -531,6 +530,9 @@
         },
         formDataMain: {
           Id: '',
+          EId: '',
+          DocId: '',
+          TaskId: '',
           Product: '',
           Spec: '',
           SamplingBase: '',
@@ -594,6 +596,17 @@
           SuccessStatus: 2,
           AuditorRemark: '',
           DataEntryId: 0
+        },
+        rowHistory: {},
+        params: {
+          Id: '',
+          EId: '',
+          DataDocId: '',
+          TestDepartId: '',
+          PositionCheckId: '',
+          TaskBalanceId: '',
+          DataEntryId: '',
+          EntrustCorp: ''
         }
       }
     },
@@ -639,13 +652,22 @@
       getDataEntry () {
         this.$axios.get('/limsdataentry/getdataentry/' + this.DataEntryId).then(res => {
           this.formDataMain = res.data
+          if (!this.formDataMain.InspectionDate || this.formDataMain.InspectionDate.indexOf('0001-01-01') !== -1) {
+            this.formDataMain.InspectionDate = new Date()
+          }
           // this.params.Id = res.data.Id
         }).catch(error => {
           console.log(error)
         })
       },
       getDataHistory () {
-
+        this.params.DataDocId = this.formDataMain.DocId
+        this.params.TaskBalanceId = this.formDataMain.TaskId
+        this.params.EId = this.formDataMain.EId
+        this.params.DataEntryId = this.formDataMain.Id
+        this.params.Id = this.formDataMain.Id
+        this.$refs['historyDataCompoment'].dialogTableVisible = true
+        this.$refs['historyDataCompoment'].OpenOrignDataInput(this.params)
       },
       initDatas () {
         // 分页及列表条件
@@ -798,6 +820,42 @@
         })
       },
 
+      dbTableRow (row) {
+        if (this.entityList.length === 1) {
+          this.updateTableRow(row)
+        }
+      },
+      saveTableRow (row, oldRow) {
+        let noChange = true
+        if (oldRow && row) {
+          let tmpRow = {}
+          Object.assign(tmpRow, oldRow)
+          noChange = cmp(this.rowHistory, tmpRow)
+        }
+        if (oldRow && oldRow.Id > 0 && !noChange) {
+          this.updateTableRow(oldRow)
+        }
+        Object.assign(this.rowHistory, row)
+      },
+      updateTableRow (row) {
+        api.updateEntity(row.Id, row, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            // 保存成功后,初始化数据,变成修改
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+
       searchCommand (command) {
         if (command === 'search') {
           this.dialogVisible = true

+ 7 - 13
src/dashoo.cn/frontend_web/src/pages/lims/wzjys/reportpetroleumpipe/_opera/operation.vue

@@ -1,17 +1,11 @@
 <template>
   <div>
-    <el-dialog title="漏电保护信息" :visible.sync="dialogVisible" width="80%">
+    <el-dialog title="石油专用管材方钻杆" :visible.sync="dialogVisible" width="80%">
       <el-card class="box-card">
         <div slot="header">
           <span>
             <i class="icon icon-table2"></i> 编辑
           </span>
-          <span style="float: right;">
-            <el-button type="primary" size="mini" @click="saveEntity">保存</el-button>
-            <router-link :to="'/lims/wzjys/reportpetroleumpipe/datalist'">
-              <el-button type="primary" size="mini" style="margin-left: 8px">返回</el-button>
-            </router-link>
-          </span>
         </div>
         <el-form label-width="110px" ref="EntityForm" :model="formData">
           <el-row>
@@ -22,14 +16,14 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="紧密距外螺纹" label-width="120px">
-                <el-input type="number" step="0.01" v-model.number="formData.CloseDistanceOut" style="width:50%" placeholder="请输入">
+                <el-input type="number" step="0.01" v-model.number="formData.CloseDistanceOut" style="width:100%" placeholder="请输入">
                 </el-input>
               </el-form-item>
             </el-col>
 
             <el-col :span="6">
               <el-form-item label="紧密距内螺纹" label-width="120px">
-                <el-input type="number" step="0.01" v-model.number="formData.CloseDistanceIn" style="width:50%" placeholder="请输入">
+                <el-input type="number" step="0.01" v-model.number="formData.CloseDistanceIn" style="width:100%" placeholder="请输入">
                 </el-input>
               </el-form-item>
             </el-col>
@@ -137,15 +131,15 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="接头外径公端" label-width="130px">
-                <el-input type="number" step="0.01" v-model.number="formData.ExDiameterF1" style="width:100%" placeholder="请输入"></el-input>
-                <el-input type="number" step="0.01" v-model.number="formData.ExDiameterF2" style="width:100%" placeholder="请输入"></el-input>
+                <el-input type="number" step="0.01" v-model.number="formData.ExDiameterF1" style="width:50%" placeholder="请输入"></el-input>
+                <el-input type="number" step="0.01" v-model.number="formData.ExDiameterF2" style="width:50%" placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
 
             <el-col :span="6">
               <el-form-item label="接头外径母端" label-width="130px">
-                <el-input type="number" step="0.01" v-model.number="formData.ExDiameterM1" style="width:100%" placeholder="请输入"></el-input>
-                <el-input type="number" step="0.01" v-model.number="formData.ExDiameterM2" style="width:100%" placeholder="请输入"></el-input>
+                <el-input type="number" step="0.01" v-model.number="formData.ExDiameterM1" style="width:50%" placeholder="请输入"></el-input>
+                <el-input type="number" step="0.01" v-model.number="formData.ExDiameterM2" style="width:50%" placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="6">

+ 181 - 0
src/dashoo.cn/frontend_web/src/pages/lims/wzjys/reportpipedrillpipe/_opera/datahistory.vue

@@ -0,0 +1,181 @@
+<template>
+  <el-dialog title="历史数据录入信息" :visible.sync="dialogTableVisible">
+    <!--<br />-->
+    <!--<el-alert title="" description="您可以选择相同模板输入的历史数据,加入您的数据中再做相应修改" type="success" :closable="false">-->
+    <!--</el-alert>-->
+    <!--<br />-->
+    <el-card class="box-card">
+      <el-table :data="dataentryhistorylist" :stripe="true">
+        <el-table-column label="操作" width="100">
+          <template slot-scope="scope">
+            <el-button @click="handleselectentry(scope.row)" type="primary" plain size="mini" title="选择">
+              选择</el-button>
+          </template>
+        </el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="DataEntryCode" label="委托单号"></el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="CustomerName" label="委托单位"></el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="DocType" label="文档名称"></el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="CreatedTime" label="生成时间">
+          <template slot-scope="scope">
+            <p>{{jstimehandle(scope.row.CreatedTime)}}</p>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-pagination @current-change="historyhandleCurrentChange" :current-page="historycurrentPage"
+                     :page-sizes="[10, 15, 20, 25]" :page-size="historysize" layout="total, sizes, prev, pager, next, jumper" :total="historycurrentItemCount">
+      </el-pagination>
+    </el-card>
+  </el-dialog>
+</template>
+<script>
+  import { mapGetters } from 'vuex'
+  import api from '@/api/lims/dataEntry'
+
+  export default {
+    computed: {
+      ...mapGetters({
+        authUser: 'authUser'
+      })
+    },
+    name: 'limspipedrillpipeHistory',
+    data () {
+      return {
+        PositionCheckId: '',
+        TestDepartId: '',
+        CustomerId: '',
+        MId: '',
+        tbid: '',
+        EId: '',
+        DataEntryId: '',
+        datadocId: '',
+        historycurrentItemCount: 0,
+        historycurrentPage: 1,
+        historysize: 10,
+        dialogTableVisible: false,
+        dataentryhistorylist: []
+      }
+    },
+    created () {
+    },
+    methods: {
+      OpenOrignDataInput (values) {
+        this.dataentryhistorylist = []
+        this.tbid = values.TaskBalanceId
+        this.EId = values.EId
+        this.DataEntryId = values.DataEntryId
+        this.datadocId = values.DataDocId
+        this.TestDepartId = values.TestDepartId
+        this.PositionCheckId = values.PositionCheckId
+        this.CustomerId = values.EntrustCorp
+        this.MId = values.Id
+        const params = {
+          _currentPage: this.historycurrentPage,
+          _size: this.historysize,
+          datadocId: this.datadocId,
+          testdetailId: values.TestDepartId,
+          postioncheckId: values.PositionCheckId,
+          customerId: values.EntrustCorp
+        }
+        let entryId = values.Id
+        api.getDataEntryReportList(params, entryId, this.$axios)
+          .then(res => {
+            this.dataentryhistorylist = res.data.item
+            this.historycurrentItemCount = res.data.currentItemCount
+          }).catch(err => {
+            console.error(err)
+          })
+      },
+
+      handleselectentry (val) {
+        let params = {
+          eid: this.EId,
+          tbid: this.tbid,
+          deid: this.DataEntryId,
+          datadocId: this.datadocId
+        }
+        api.dataEntryhistory(params, val.Id, this.$axios)
+          .then(res => {
+            if (res.data.code === 0) {
+              this.dialogTableVisible = false
+              this.$emit('init-datalist')
+            } else {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          }).catch(err => {
+            console.error(err)
+          })
+      },
+
+      historyhandleCurrentChange (value) {
+        this.historycurrentPage = value
+        this.refreshdataentrydata()
+      },
+
+      historyhandleSizeChange (value) {
+        this.historysize = value
+        this.historycurrentPage = 1
+        this.refreshdataentrydata()
+      },
+
+      // 选择页码刷新历史数据
+      refreshdataentrydata () {
+        const params = {
+          _currentPage: this.historycurrentPage,
+          _size: this.historysize,
+          datadocId: this.datadocId,
+          testdetailId: this.TestDepartId,
+          postioncheckId: this.PositionCheckId,
+          customerId: this.CustomerId
+        }
+        let entryId = this.MId
+        api.getDataEntryReportList(params, entryId, this.$axios)
+          .then(res => {
+            this.dataentryhistorylist = res.data.item
+            this.historycurrentItemCount = res.data.currentItemCount
+          }).catch(err => {
+            console.error(err)
+          })
+      },
+
+      jstimehandle (val) {
+        if (val === '') {
+          return '----'
+        } else if (val === '0001-01-01T08:00:00+08:00') {
+          return '----'
+        } else if (val === '5000-01-01T23:59:59+08:00') {
+          return '永久'
+        } else {
+          val = val.replace('T', ' ')
+          return val.substring(0, 10)
+        }
+      },
+
+      formatDateTime (date) {
+        var y = date.getFullYear()
+        var m = date.getMonth() + 1
+        m = m < 10 ? ('0' + m) : m
+        var d = date.getDate()
+        d = d < 10 ? ('0' + d) : d
+        var h = date.getHours()
+        var minute = date.getMinutes()
+        minute = minute < 10 ? ('0' + minute) : minute
+        return y + '-' + m + '-' + d + ' ' + h + ':' + minute
+      },
+
+      in_array_positionname (stringToSearch, arrayToSearch) {
+        for (let s = 0; s < arrayToSearch.length; s++) {
+          let thisEntry = arrayToSearch[s].PositionName
+          if (thisEntry === stringToSearch) {
+            return true
+          }
+        }
+        return false
+      }
+
+    }
+  }
+</script>
+

+ 109 - 50
src/dashoo.cn/frontend_web/src/pages/lims/wzjys/reportpipedrillpipe/_opera/datalist.vue

@@ -118,7 +118,7 @@
       </el-card>
       <el-card>
         <el-table :data="entityList" border height="calc(100vh - 250px)" highlight-current-row style="width: 100%"
-          @sort-change="orderby">
+          @sort-change="orderby" @current-change="saveTableRow" @row-dblclick="dbTableRow">
           <el-table-column v-if="this.DataStatus==0||this.DataStatus==5||this.DataStatus==3" label="操作" min-width="190"
             align="center" fixed>
             <template slot-scope="scope">
@@ -144,58 +144,58 @@
             </template>
           </el-table-column>
           <el-table-column label="紧密距(mm)" align="center">
-            <el-table-column prop="CloseDistanceOut" sortable min-width="90" label="外螺纹" align="center"
+            <el-table-column prop="CloseDistanceOut" sortable min-width="110" label="外螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.CloseDistanceOut" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.CloseDistanceOut" style="width: 100%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="CloseDistanceIn" sortable min-width="90" label="内螺纹" align="center"
+            <el-table-column prop="CloseDistanceIn" sortable min-width="110" label="内螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.CloseDistanceIn" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.CloseDistanceIn" style="width: 100%"></el-input>
               </template>
             </el-table-column>
           </el-table-column>
           <el-table-column label="锥度公差·10-3(in/in)" align="center">
-            <el-table-column prop="TaperToleranceOut" sortable min-width="170" label="外螺纹" align="center"
+            <el-table-column prop="TaperToleranceOut" sortable min-width="220" label="外螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.TaperToleranceOut1" style="width: 50%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.TaperToleranceOut1" style="width: 50%"></el-input>
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                          v-model="scope.row.TaperToleranceOut2" style="width: 50%"></el-input>
+                          type="number" step="0.01" v-model.number="scope.row.TaperToleranceOut2" style="width: 50%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="TaperToleranceIn" sortable min-width="170" label="内螺纹" align="center"
+            <el-table-column prop="TaperToleranceIn" sortable min-width="220" label="内螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.TaperToleranceIn1" style="width: 50%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.TaperToleranceIn1" style="width: 50%"></el-input>
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                          v-model="scope.row.TaperToleranceIn2" style="width: 50%"></el-input>
+                          type="number" step="0.01" v-model.number="scope.row.TaperToleranceIn2" style="width: 50%"></el-input>
               </template>
             </el-table-column>
           </el-table-column>
           <el-table-column label="螺距公差·10-3(in/in)" align="center">
-            <el-table-column prop="PitchToleranceOut" sortable min-width="170" label="外螺纹" align="center"
+            <el-table-column prop="PitchToleranceOut" sortable min-width="220" label="外螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.PitchToleranceOut1" style="width: 50%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.PitchToleranceOut1" style="width: 50%"></el-input>
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                          v-model="scope.row.PitchToleranceOut2" style="width: 50%"></el-input>
+                          type="number" step="0.01" v-model.number="scope.row.PitchToleranceOut2" style="width: 50%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="PitchToleranceIn" sortable min-width="170" label="内螺纹" align="center"
+            <el-table-column prop="PitchToleranceIn" sortable min-width="220" label="内螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.PitchToleranceIn1" style="width: 50%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.PitchToleranceIn1" style="width: 50%"></el-input>
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                          v-model="scope.row.PitchToleranceIn2" style="width: 50%"></el-input>
+                          type="number" step="0.01" v-model.number="scope.row.PitchToleranceIn2" style="width: 50%"></el-input>
               </template>
             </el-table-column>
           </el-table-column>
@@ -203,128 +203,128 @@
             <el-table-column sortable min-width="150" label="与台肩面垂直度" align="center" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.ShoulderSurface" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.ShoulderSurface" style="width: 100%"></el-input>
               </template>
             </el-table-column>
             <el-table-column prop="EndFace" sortable min-width="150" label="与端面垂直度" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.EndFace" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.EndFace" style="width: 100%"></el-input>
               </template>
             </el-table-column>
           </el-table-column>
-          <el-table-column prop="TubeDiameter" sortable min-width="170" label="管体外径(mm)" align="center"
+          <el-table-column prop="TubeDiameter" sortable min-width="220" label="管体外径(mm)" align="center"
             show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.TubeDiameter" style="width: 50%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.TubeDiameter" style="width: 50%"></el-input>
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                        v-model="scope.row.TubeDiameter" style="width: 50%"></el-input>
+                        type="number" step="0.01" v-model.number="scope.row.TubeDiameter" style="width: 50%"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="LPC" sortable min-width="130" label="LPC(mm)" align="center" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.LPC" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.LPC" style="width: 100%"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="DF" sortable min-width="120" label="DF(mm)" align="center" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.DF" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.DF" style="width: 100%"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="QC" sortable min-width="125" label="QC(mm)" align="center" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.QC" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.QC" style="width: 100%"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="LPB" sortable min-width="140" label="LPB(mm)" align="center" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.LPB" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.LPB" style="width: 100%"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="LB" sortable min-width="120" label="LB(mm)" align="center" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.LB" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.LB" style="width: 100%"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="TubeLength" sortable min-width="150" label="管体长度(m)" align="center"
             show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.TubeLength" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.TubeLength" style="width: 100%"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="InnerDiameter" sortable min-width="160" label="接头内径(mm)" align="center"
             show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.InnerDiameter" style="width: 100%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.InnerDiameter" style="width: 100%"></el-input>
             </template>
           </el-table-column>
-          <el-table-column prop="WallThickness" sortable min-width="210" label="壁厚(mm)" align="center"
+          <el-table-column prop="WallThickness" sortable min-width="330" label="壁厚(mm)" align="center"
             show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                v-model="scope.row.WallThickness" style="width: 33%"></el-input>
+                type="number" step="0.01" v-model.number="scope.row.WallThickness" style="width: 33%"></el-input>
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                        v-model="scope.row.WallThickness" style="width: 33%"></el-input>
+                        type="number" step="0.01" v-model.number="scope.row.WallThickness" style="width: 33%"></el-input>
               <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                        v-model="scope.row.WallThickness" style="width: 34%"></el-input>
+                        type="number" step="0.01" v-model.number="scope.row.WallThickness" style="width: 34%"></el-input>
             </template>
           </el-table-column>
           <el-table-column label="接头外径(mm)" align="center">
-            <el-table-column prop="JointDiameterM" sortable min-width="170" label="公端" align="center"
+            <el-table-column prop="JointDiameterM" sortable min-width="220" label="公端" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.JointDiameterM1" style="width: 50%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.JointDiameterM1" style="width: 50%"></el-input>
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                          v-model="scope.row.JointDiameterM2" style="width: 50%"></el-input>
+                          type="number" step="0.01" v-model.number="scope.row.JointDiameterM2" style="width: 50%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="JointDiameterF" sortable min-width="170" label="母端" align="center"
+            <el-table-column prop="JointDiameterF" sortable min-width="220" label="母端" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.JointDiameterF1" style="width: 50%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.JointDiameterF1" style="width: 50%"></el-input>
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                          v-model="scope.row.JointDiameterF2" style="width: 50%"></el-input>
+                          type="number" step="0.01" v-model.number="scope.row.JointDiameterF2" style="width: 50%"></el-input>
               </template>
             </el-table-column>
           </el-table-column>
           <el-table-column label="焊接不同轴度(mm)" align="center">
-            <el-table-column prop="WallDifF" sortable min-width="100" label="公端" align="center" show-overflow-tooltip>
+            <el-table-column prop="WallDifF" sortable min-width="110" label="公端" align="center" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.WallDifF" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.WallDifF" style="width: 100%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="WallDifM" sortable min-width="100" label="母端" align="center" show-overflow-tooltip>
+            <el-table-column prop="WallDifM" sortable min-width="110" label="母端" align="center" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.WallDifM" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.WallDifM" style="width: 100%"></el-input>
               </template>
             </el-table-column>
           </el-table-column>
           <el-table-column label="外径偏心度(mm)" align="center">
-            <el-table-column prop="OuterDiameterF" sortable min-width="100" label="公端" align="center"
+            <el-table-column prop="OuterDiameterF" sortable min-width="110" label="公端" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.OuterDiameterF" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.OuterDiameterF" style="width: 100%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="OuterDiameterM" sortable min-width="100" label="母端" align="center"
+            <el-table-column prop="OuterDiameterM" sortable min-width="110" label="母端" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.OuterDiameterM" style="width: 100%"></el-input>
+                  type="number" step="0.01" v-model.number="scope.row.OuterDiameterM" style="width: 100%"></el-input>
               </template>
             </el-table-column>
           </el-table-column>
@@ -557,7 +557,7 @@
     </el-dialog>
     <data-opera ref="DataoperaCompoment" :DataEntryId="DataEntryId+''" :TaskBalanceId="TaskBalanceId+''" :EId="EId+''"
       @init-data="initDatas"></data-opera>
-
+    <data-history ref="historyDataCompoment" @init-datalist="initDatas"></data-history>
   </div>
 </template>
 <script>
@@ -566,6 +566,8 @@
   } from 'vuex'
   import api from '@/api/wzjys/limspipedrillpipe'
   import DataOpera from './operation.vue'
+  import DataHistory from './datahistory.vue'
+  import cmp from '@/utils/strings.js'
 
   export default {
     computed: {
@@ -575,7 +577,8 @@
     },
     name: 'limspipedrillpipe',
     components: {
-      DataOpera
+      DataOpera,
+      DataHistory
     },
     data () {
       return {
@@ -603,6 +606,9 @@
         },
         formDataMain: {
           Id: '',
+          EId: '',
+          DocId: '',
+          TaskId: '',
           Product: '',
           Spec: '',
           SamplingBase: '',
@@ -672,6 +678,17 @@
           SuccessStatus: 2,
           AuditorRemark: '',
           DataEntryId: 0
+        },
+        rowHistory: {},
+        params: {
+          Id: '',
+          EId: '',
+          DataDocId: '',
+          TestDepartId: '',
+          PositionCheckId: '',
+          TaskBalanceId: '',
+          DataEntryId: '',
+          EntrustCorp: ''
         }
       }
     },
@@ -726,7 +743,13 @@
         })
       },
       getDataHistory () {
-
+        this.params.DataDocId = this.formDataMain.DocId
+        this.params.TaskBalanceId = this.formDataMain.TaskId
+        this.params.EId = this.formDataMain.EId
+        this.params.DataEntryId = this.formDataMain.Id
+        this.params.Id = this.formDataMain.Id
+        this.$refs['historyDataCompoment'].dialogTableVisible = true
+        this.$refs['historyDataCompoment'].OpenOrignDataInput(this.params)
       },
       initDatas () {
         // 分页及列表条件
@@ -880,6 +903,42 @@
         })
       },
 
+      dbTableRow (row) {
+        if (this.entityList.length === 1) {
+          this.updateTableRow(row)
+        }
+      },
+      saveTableRow (row, oldRow) {
+        let noChange = true
+        if (oldRow && row) {
+          let tmpRow = {}
+          Object.assign(tmpRow, oldRow)
+          noChange = cmp(this.rowHistory, tmpRow)
+        }
+        if (oldRow && oldRow.Id > 0 && !noChange) {
+          this.updateTableRow(oldRow)
+        }
+        Object.assign(this.rowHistory, row)
+      },
+      updateTableRow (row) {
+        api.updateEntity(row.Id, row, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            // 保存成功后,初始化数据,变成修改
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+
       searchCommand (command) {
         if (command === 'search') {
           this.dialogVisible = true