Browse Source

八联管的质检样本检测结果自定义组件

shenqilong 1 year ago
parent
commit
2ddcffe2fc
1 changed files with 268 additions and 0 deletions
  1. 268 0
      src/views/component/zybdblgzj.vue

+ 268 - 0
src/views/component/zybdblgzj.vue

@@ -0,0 +1,268 @@
+
+<template>
+    <div class="dynamic-form-table__inner panel panel-info">
+        <div>
+            <div class="ibps-fl dynamic-form-table__label">样本检测结果</div>
+            <div class="ibps-fr hidden-print">
+                <el-button-group v-if="!readonly&&!disable">
+                    <el-button
+                        type="primary"
+                        @click="handleActionEvent('jsjg')"
+                    >
+                        计算结果
+                    </el-button>
+
+                </el-button-group>
+            </div>
+
+        </div>
+
+        <div class="cytopathologicalDiagnostic">
+
+            <el-table
+
+                :data="tableData"
+
+                :span-method="objectSpanMethod"
+                border
+                style="width: 100%; margin-top: 20px"
+            >
+
+                <el-table-column
+                    align="center"
+                    prop="yangBenBianHao"
+                    label="样本编号"
+                >
+                    <template slot-scope="scope">
+
+                        <div v-if="readonly||scope.row.ul10Duan=='3'||scope.row.ul10Duan=='6'||scope.row.ul10Duan=='9'||disable">{{ scope.row.yangBenBianHao }}</div>
+                        <el-input v-else v-model="scope.row.yangBenBianHao" placeholder="请输入内容" />
+
+                    </template>
+
+                </el-table-column>
+                <el-table-column
+                    align="center"
+                    prop="ul1000"
+                    label="旧批号八联管Y"
+                >
+                    <template slot-scope="scope">
+
+                        <div v-if="readonly||scope.row.ul10Duan=='3'||scope.row.ul10Duan=='6'||scope.row.ul10Duan=='9'||disable">{{ scope.row.ul1000 }}</div>
+                        <el-input v-else v-model="scope.row.ul1000" type="number" placeholder="请输入内容" />
+
+                    </template>
+
+                </el-table-column>
+                <el-table-column
+                    align="center"
+                    prop="ul100"
+                    label="新批号八联管X"
+                >
+                    <template slot-scope="scope">
+                        <div v-if="readonly||scope.row.ul10Duan=='3'||scope.row.ul10Duan=='6'||scope.row.ul10Duan=='9'||disable">{{ scope.row.ul100 }}</div>
+                        <el-input v-else v-model="scope.row.ul100" type="number" placeholder="请输入内容" />
+                    </template>
+                </el-table-column>
+                <el-table-column
+                    align="center"
+                    prop="ul10Chang"
+                    label="偏倚 (≤±0.4log)"
+                >
+                    <template slot-scope="scope">
+                        <div v-if="readonly||scope.row.ul10Duan=='3'||scope.row.ul10Duan=='6'||scope.row.ul10Duan=='9'||disable">{{ scope.row.ul10Chang }}</div>
+                        <el-input v-else v-model="scope.row.ul10Chang" placeholder="请输入内容" />
+                    </template>
+                </el-table-column>
+
+            </el-table>
+
+        </div>
+    </div>
+</template>
+
+<script>
+export default {
+    components: {
+        IbpsCustomDialog: () => import('@/business/platform/data/templaterender/custom-dialog')
+    },
+    props: {
+        formData: {
+            type: Object,
+            default: () => ({})
+        },
+        params: {
+            type: Object,
+            default: () => {}
+        },
+        readonly: {
+            type: Boolean,
+            default: false
+        }
+    },
+    data () {
+        return {
+            disable: this.params.nodeId === 'Activity_0dlmh3s',
+
+            tableData: [
+                {
+
+                    yangBenBianHao: '',
+                    ul1000: '',
+                    ul100: '',
+                    ul10Chang: '',
+                    ul10Duan: '1'
+                },
+                {
+                    yangBenBianHao: '',
+                    ul1000: '',
+                    ul100: '',
+                    ul10Chang: '',
+                    ul10Duan: '2'
+                },
+                {
+                    yangBenBianHao: '均值(对数)',
+                    ul1000: '',
+                    ul100: '',
+                    ul10Chang: '',
+                    ul10Duan: '3'
+                },
+                {
+                    yangBenBianHao: '',
+                    ul1000: '',
+                    ul100: '',
+                    ul10Chang: '',
+                    ul10Duan: '4'
+                },
+                {
+                    yangBenBianHao: '',
+                    ul1000: '',
+                    ul100: '',
+                    ul10Chang: '',
+                    ul10Duan: '5'
+                },
+                {
+                    yangBenBianHao: '均值(对数)',
+                    ul1000: '',
+                    ul100: '',
+                    ul10Chang: '',
+                    ul10Duan: '6'
+                },
+                {
+                    yangBenBianHao: '',
+                    ul1000: '',
+                    ul100: '',
+                    ul10Chang: '',
+                    ul10Duan: '7'
+                },
+                {
+                    yangBenBianHao: '',
+                    ul1000: '',
+                    ul100: '',
+                    ul10Chang: '',
+                    ul10Duan: '8'
+                },
+                {
+                    yangBenBianHao: '均值(对数)',
+                    ul1000: '',
+                    ul100: '',
+                    ul10Chang: '',
+                    ul10Duan: '9'
+                }
+            ],
+            ruleForm: {
+                yangBenBianHao: '',
+                ul1000: '',
+                ul100: '',
+                ul10Chang: ''
+            },
+            rules: {
+                yangBenBianHao: [
+                    { required: true, message: '样本编号', trigger: 'blur' }
+                ],
+                ul1000: [
+                    { required: true, message: '旧批号八联管Y', trigger: 'blur' }
+                ],
+                ul100: [
+                    { required: true, message: '新批号八联管X', trigger: 'blur' }
+                ],
+                ul10Chang: [
+                    { required: true, message: '偏倚 (≤±0.4log)', trigger: 'blur' }
+                ]
+
+            }
+
+        }
+    },
+    computed: {
+
+    },
+    watch: {
+        tableData: {
+            handler (val) {
+                this.$emit('change-data', 'hczjjg', val)
+            },
+            deep: true
+        },
+        'formData.hczjjg': {
+            handler (val) {
+                this.tableData = val
+            },
+            immediate: true
+        }
+    },
+    created () {
+        // console.log(this.formData, this.params, this.readonly)
+    },
+    mounted () {
+
+    },
+    methods: {
+        objectSpanMethod ({ row, column, rowIndex, columnIndex }) {
+            if (columnIndex === 3) {
+                if (rowIndex !== 2 && rowIndex !== 5 && rowIndex !== 8) {
+                    return [0, 0]
+                }
+            }
+        },
+        // headFirst ({ row, colunm, rowIndex, columnIndex }) {
+        //     return 'background:#f5f7fa'
+        // }
+        handleActionEvent (val) {
+            // this.tableData[2].ul1000 = ((Number(this.tableData[0].ul1000) + Number(this.tableData[1].ul1000)) / 2).toFixed(2) + ''
+            // this.tableData[5].ul1000 = ((Number(this.tableData[3].ul1000) + Number(this.tableData[4].ul1000)) / 2).toFixed(2) + ''
+            // this.tableData[8].ul1000 = ((Number(this.tableData[6].ul1000) + Number(this.tableData[7].ul1000)) / 2).toFixed(2) + ''
+            // this.tableData[2].ul100 = ((Number(this.tableData[0].ul100) + Number(this.tableData[1].ul100)) / 2).toFixed(2) + ''
+            // this.tableData[5].ul100 = ((Number(this.tableData[3].ul100) + Number(this.tableData[4].ul100)) / 2).toFixed(2) + ''
+            // this.tableData[8].ul100 = ((Number(this.tableData[6].ul100) + Number(this.tableData[7].ul100)) / 2).toFixed(2) + ''
+
+            // this.tableData[2].ul100 = ((Number(this.tableData[2].ul1000) - Number(this.tableData[2].ul100)) / 2).toFixed(2) + ''
+            // this.tableData[5].ul100 = ((Number(this.tableData[5].ul1000) - Number(this.tableData[5].ul100)) / 2).toFixed(2) + ''
+            // this.tableData[8].ul100 = ((Number(this.tableData[8].ul1000) - Number(this.tableData[8].ul100)) / 2).toFixed(2) + ''
+            this.tableData[2].ul1000 = (Number(this.tableData[0].ul1000) * 1000000 + Number(this.tableData[1].ul1000) * 1000000) / 2000000 + ''
+            this.tableData[5].ul1000 = (Number(this.tableData[3].ul1000) * 1000000 + Number(this.tableData[4].ul1000) * 1000000) / 2000000 + ''
+            this.tableData[8].ul1000 = (Number(this.tableData[6].ul1000) * 1000000 + Number(this.tableData[7].ul1000) * 1000000) / 2000000 + ''
+            this.tableData[2].ul100 = (Number(this.tableData[0].ul100) * 1000000 + Number(this.tableData[1].ul100) * 1000000) / 2000000 + ''
+            this.tableData[5].ul100 = (Number(this.tableData[3].ul100) * 1000000 + Number(this.tableData[4].ul100) * 1000000) / 2000000 + ''
+            this.tableData[8].ul100 = (Number(this.tableData[6].ul100) * 1000000 + Number(this.tableData[7].ul100) * 1000000) / 2000000 + ''
+
+            this.tableData[2].ul10Chang = Math.abs((Number(this.tableData[2].ul1000) * 1000000 - Number(this.tableData[2].ul100) * 1000000)) / 1000000 + ''
+            this.tableData[5].ul10Chang = Math.abs((Number(this.tableData[5].ul1000) * 1000000 - Number(this.tableData[5].ul100) * 1000000)) / 1000000 + ''
+            this.tableData[8].ul10Chang = Math.abs((Number(this.tableData[8].ul1000) * 1000000 - Number(this.tableData[8].ul100) * 1000000)) / 1000000 + ''
+        }
+
+    }
+}
+</script>
+
+<style lang="scss">
+.cytopathologicalDiagnostic{
+  .el-table th {
+      background-color: #84d5cf !important;
+      font-size: 14px;
+      color: #000000;
+  }
+}
+
+</style>
+