Explorar o código

Merge branch '深圳三院' of http://119.23.210.103:3000/wy/zdqy_firm_former into 深圳三院

cfort hai 1 ano
pai
achega
f60ebd1bea

+ 35 - 38
src/views/component/device/deviceDialog.vue

@@ -24,19 +24,8 @@
                         <el-row type="flex" justify="center" :gutter="20">
                             <el-col :span="16">
                                 <el-row :gutter="20">
-                                    <el-col v-if="isEdit" :span="8">
-                                        <el-form-item label="设备名称:" prop="sheBeiMingCheng">
-                                            <template slot="label">
-                                                <span class="required">设备名称:</span>
-                                            </template>
-                                            <el-input v-model="form.sheBeiMingCheng" size="mini" />
-                                        </el-form-item>
-                                    </el-col>
-                                    <el-col v-if="!isEdit" :span="8">
-                                        <el-form-item label="设备名称:" prop="sheBeiMingChen">
-                                            <template slot="label">
-                                                <span class="required">设备名称:</span>
-                                            </template>
+                                    <el-col :span="8">
+                                        <el-form-item label="设备验收记录:" prop="sheBeiMingChen">
                                             <ibps-custom-dialog
                                                 v-model="form.sheBeiMingChen"
                                                 size="mini"
@@ -47,9 +36,18 @@
                                                 placeholder="请选择"
                                                 icon="el-icon-search"
                                                 style="width:100%"
+                                                @change-link-data="sheBeiMingChenChange"
                                             />
                                         </el-form-item>
                                     </el-col>
+                                    <el-col :span="8">
+                                        <el-form-item label="设备名称:" prop="sheBeiMingCheng">
+                                            <template slot="label">
+                                                <span class="required">设备名称:</span>
+                                            </template>
+                                            <el-input v-model="form.sheBeiMingCheng" size="mini" />
+                                        </el-form-item>
+                                    </el-col>
                                 </el-row>
                                 <el-row :gutter="20">
                                     <el-col :span="8">
@@ -112,7 +110,7 @@
                                                     <i class="el-icon-question question-icon">:</i>
                                                 </el-tooltip>
                                             </template>
-                                            <span>{{ form.sheBeiShiBieH }}</span>
+                                            <span>{{ form.sheBeiShiBieH || '/' }}</span>
                                         </el-form-item>
                                     </el-col>
                                     <el-col :span="8">
@@ -882,9 +880,6 @@ export default {
                 sheBeiMingCheng: [
                     { required: true, message: '设备名称不能为空', trigger: 'blur' }
                 ],
-                sheBeiShiBieH: [
-                    { required: true, message: '设备编号不能为空', trigger: 'blur' }
-                ],
                 yuanSheBeiBian: [
                     { required: true, message: '原设备编号不能为空', trigger: 'blur' }
                 ],
@@ -918,9 +913,6 @@ export default {
                 shiFouXiaoZhun: [
                     { required: true, message: '是否校准不能为空', trigger: 'blur' }
                 ],
-                sheBeiMingChen: [
-                    { required: true, message: '请选择设备', trigger: 'blur' }
-                ],
                 chuChangRiQi: [
                     { required: true, message: '出厂日期不能为空', trigger: 'blur' }
                 ]
@@ -968,20 +960,6 @@ export default {
                 this.form.cunFangDiDian = data[0].fang_jian_ming_ha
             }
         },
-        'form.sheBeiMingChen': {
-            async handler (val) {
-                if (this.isEdit) return
-                const sql = `select * from t_yqsbysb where id_='${val}'`
-                const { variables: { data }} = await this.$common.request('sql', sql)
-                if (data.length > 0) {
-                    this.form.sheBeiMingCheng = data[0].ming_cheng_str_
-                    this.form.guiGeXingHao = data[0].xing_hao_gui_ge_
-                    this.form.jiShenXuHao = data[0].chu_chang_bian_ha
-                    this.form.changShang = data[0].sheng_chan_chang_
-                    this.form.yuanSheBeiBian = data[0].she_bei_bian_hao_
-                }
-            }
-        },
         // 根据编制部门动态获取对应文件存放处数据
         // 'form.bianZhiBuMen': {
         //     handler (value) {
@@ -1019,6 +997,13 @@ export default {
         this.init()
     },
     methods: {
+        sheBeiMingChenChange (key, data) {
+            this.form.sheBeiMingCheng = data.ming_cheng_str_
+            this.form.guiGeXingHao = data.xing_hao_gui_ge_
+            this.form.jiShenXuHao = data.chu_chang_bian_ha
+            this.form.changShang = data.sheng_chan_chang_
+            this.form.yuanSheBeiBian = data.she_bei_bian_hao_
+        },
         // 根据供应商自动带出供应商名称和电话
         shiFouQiJianHChange (key, data) {
             this.form.lianXiFangShi = data.lian_xi_dian_hua_
@@ -1139,6 +1124,7 @@ export default {
         async goAdd () {
             try {
                 this.loading = true
+                this.form.sheBeiShiBieH = await this.getNextAlias()
                 await saveEquipmentCard(this.form)
                 this.$message.success('添加成功')
                 this.closeDialog(true)
@@ -1223,6 +1209,17 @@ export default {
         generateRandomString () {
             return `JYK-${Math.floor(Math.random() * 88888) + 10000}`
         },
+        getNextAlias () {
+            return new Promise((resolve, reject) => {
+                this.$common.getNextIdByAlias({
+                    'alias': 'sbbh'
+                }).then(response => {
+                    resolve(response.data)
+                }).catch((error) => {
+                    reject(error)
+                })
+            })
+        },
         async init () {
             this.loading = true
             this.isEdit = !!(this.params && this.params.id)
@@ -1251,10 +1248,10 @@ export default {
                 this.isFirstbianZhiBuMen = false
                 this.isFirstyiXiaoRiQi = false
                 // 随机生成一个不重复的设备编号
-                this.form.sheBeiShiBieH = this.generateRandomString()
-                for (; await this.checkIsRepeat(this.form.sheBeiShiBieH);) {
-                    this.form.sheBeiShiBieH = this.generateRandomString()
-                }
+                // this.form.sheBeiShiBieH = this.generateRandomString()
+                // for (; await this.checkIsRepeat(this.form.sheBeiShiBieH);) {
+                //     this.form.sheBeiShiBieH = this.generateRandomString()
+                // }
                 this.form.jieShouRiQi = dayjs().format('YYYY-MM-DD')
                 this.form.qiYongRiQi = dayjs().format('YYYY-MM-DD')
                 this.form.xiaoZhunWuCha = '否'

+ 40 - 13
src/views/component/device/index.vue

@@ -509,41 +509,42 @@ export default {
             deviceColumns: {
                 bianZhiBuMen: '部门',
                 sheBeiMingCheng: '设备名称',
-                sheBeiShiBieH: '设备编号(导入无需填写)',
+                // sheBeiShiBieH: '设备编号(导入无需填写)',
                 yuanSheBeiBian: '原设备编号(必填,且不可重复)',
                 sheBeiZhuangTa: '设备状态(合格/停用/限用)',
                 sheBeiLeiXing: '设备类型(检验系统/通用设备/软件/信息系统)',
+                shiFouWeiHu: '是否维护(是/否)',
+                shiFouXiaoZhun: '是否校准(是/否)',
+                weiHuFangShi: '设备分组',
                 guiGeXingHao: '规格型号',
-                cunFangDiDian: '存放地点',
+                cunFangDiDian: '存放地点(格式:房间号+空格+房间名)',
                 guanLiRen: '保管人',
                 ziChanBianHao: '资产编号',
                 gongYingShang: '供应商',
                 lianXiFangShi: '联系方式',
                 changShang: '厂商',
-                chuChangRiQi: '出厂日期',
                 jiShenXuHao: '机身序号',
                 zhuCeZhengHao: '注册证号',
-                ceLiangGongZuo: '测量范围',
-                huanJingYaoQiu: '环境要求',
-                dianYuanYaoQiu: '电源要求',
+                chuChangRiQi: '出厂日期',
                 yanShouRiQi: '验收日期',
                 jieShouRiQi: '接收日期',
-                jieShouZhuangTai: '接收时状态(新设备/二手或翻新设备)',
                 qiYongRiQi: '投入日期',
-                shiFouXiaoZhun: '是否校准(是/否)',
                 yiXiaoRiQi: '已校日期',
                 xiaoZhunZQ: '检定/校准周期(以月为单位)',
                 xiaoZhunYouXia: '校准有效期至',
+                shiYongKeShi: '检定/校准单位',
+                ceLiangGongZuo: '测量/工作范围',
+                huanJingYaoQiu: '环境要求',
+                dianYuanYaoQiu: '电源要求',
+                jieShouZhuangTai: '接收时状态(新设备/二手或翻新设备)',
                 jianDingXiao: '检定/校准参数',
                 zuiDaYunCha: 'U/精确度/最大允差',
                 zhengShuBianHa: '证书编号',
                 xiuZhengZhiXiu: '修正值/修正因子',
-                // wenDuYingYong:'温度应用修正值',
-                // shiDuYingYong:'湿度应用修正值',
-                shiFouWeiHu: '是否维护(是/否)',
+                wenDuYingYong: '温度应用修正值',
+                shiDuYingYong: '湿度应用修正值',
                 biXuDeHuanJin: '核查人',
                 biXuSheShi: '核查日期',
-                weiHuFangShi: '设备分组',
                 heChaXiaoZhun: '使用年限(年)'
             },
             projectColums: {
@@ -959,7 +960,9 @@ export default {
         },
         async switchExportData (data) {
             const deviceGroupSql = `select id_,wei_hu_gang_wei_ from t_sbwhgwpzb` // 设备分组信息
+            const supplierSql = `select id_,gong_ying_shang_m from t_gysxxb` // 供应商信息
             const { variables: { data: deviceGroupData }} = await this.$common.request('sql', deviceGroupSql)
+            const { variables: { data: gysData }} = await this.$common.request('sql', supplierSql)
             const exportData = JSON.parse(JSON.stringify(data))
             for (let i = 0; i < exportData.length; i++) {
                 const item = exportData[i]
@@ -967,6 +970,10 @@ export default {
                 item.guanLiRen = this.switchIdToUserName(item.guanLiRen.split(',')[0])
                 item.biXuDeHuanJin = this.switchIdToUserName(item.biXuDeHuanJin.split(',')[0])
                 item.weiHuFangShi = this.switchDeviceIdToName(item.weiHuFangShi, deviceGroupData)
+                item.shiYongKeShi = this.switchGYSIdToName(item.shiYongKeShi, gysData)
+                if (this.stateList[item.sheBeiZhuangTa]) {
+                    item.sheBeiZhuangTa = this.stateList[item.sheBeiZhuangTa]
+                }
             }
             return exportData
         },
@@ -977,6 +984,11 @@ export default {
             valList.forEach(item => result.push((deviceGroupList?.find(i => i.id_ === item)?.wei_hu_gang_wei_) || ''))
             return result.join(',')
         },
+        // 供应商id 转 供应商名称 检定/校准单位
+        switchGYSIdToName (val, gysList) {
+            const result = gysList.find(item => item.id_ === val)?.gong_ying_shang_m || ''
+            return result
+        },
         // 部门id 转 部门名称
         switchIdToDept (id) {
             const { deptList } = this.$store.getters
@@ -1294,6 +1306,17 @@ export default {
                 } else {
                     element.shiFouQiJianH = ''
                 }
+
+                if (element.shiYongKeShi.trim()) {
+                    const supplier = supplierList.find(i => i.gong_ying_shang_m === element.shiYongKeShi.trim())
+                    if (supplier) {
+                        element.shiYongKeShi = supplier.id_
+                    } else {
+                        element.shiYongKeShi = ''
+                    }
+                } else {
+                    element.shiYongKeShi = ''
+                }
             })
         },
         /**
@@ -1363,7 +1386,11 @@ export default {
             let importData = this.switchDeviceObj(data, this.deviceColumns)
             importData.forEach(i => {
                 delete i.sheBeiShiBieH // 设备编号需自动生成
-                i.sheBeiZhuangTa = '合格'
+                // i.sheBeiZhuangTa = '合格'
+                const keyFound = Object.entries(this.stateList).find(([key, value]) => value === i.sheBeiZhuangTa)
+                if (keyFound) {
+                    i.sheBeiZhuangTa = keyFound[0]
+                }
             })
             const currentPosition = this.level
             const { userList = [], deptList = [] } = this.$store.getters || {}

+ 175 - 0
src/views/component/sop/pcr.vue

@@ -0,0 +1,175 @@
+<template>
+    <div class="pcr">
+        <el-tabs v-model="activeName">
+            <el-tab-pane v-for="item in tableList" :key="item.peiZhiId" :label="item.quYuMing" :name="item.peiZhiId">
+                <div class="user">
+                    <span style="width:70px">操作者:</span>
+                    <ibps-user-selector
+                        v-model="item.bianZhiRen"
+                        type="user"
+                        readonly-text="text"
+                        :disabled="readonly"
+                        :multiple="false"
+                        size="mini"
+                        style="width:60%"
+                        :filter="filter"
+                        filtrate
+                    />
+                </div>
+                <div v-for="row in item.lieBiaoShuJu" :key="row.row">
+                    <template v-if="row.type==='text'">
+                        <span style="white-space: pre-wrap;">{{ row.content }}</span>
+                    </template>
+                    <template v-if="row.type==='group'">
+                        <span v-for="(col,index) in row.children" :key="index">
+                            <template v-if="col.type==='checkbox'">
+                                <span class="col-item"><el-checkbox v-model="col.value" :disabled="readonly" size="mini" /></span>
+                            </template>
+                            <template v-if="col.type==='text'">
+                                <span class="col-item" style="white-space: pre-wrap;">{{ col.content }}</span>
+                            </template>
+                            <template v-if="col.type==='input'">
+                                <span class="col-item">
+                                    <el-input v-if="!readonly" v-model="col.value" size="mini" style="width:120px" />
+                                    <template v-else>{{ col.value }}</template>
+                                </span>
+                            </template>
+                        </span>
+                    </template>
+                </div>
+            </el-tab-pane>
+        </el-tabs>
+    </div>
+</template>
+
+<script>
+import ibpsUserSelector from '@/business/platform/org/selector'
+export default {
+    components: {
+        ibpsUserSelector
+    },
+    props: {
+        formData: {
+            type: Object,
+            default: () => ({})
+        },
+        readonly: {
+            type: Boolean,
+            default: false
+        }
+    },
+    data () {
+        return {
+            activeName: '1',
+            tableList: [],
+            isFirst: true,
+            filter: [{
+                descVal: '1',
+                includeSub: true,
+                old: 'position',
+                partyId: this.$store.getters.userInfo.employee.positions,
+                partyName: '',
+                scriptContent: '',
+                type: 'user',
+                userType: 'position'
+            }]
+        }
+    },
+    computed: {
+    },
+    watch: {
+        'formData.PCRjygzrzxqb': {
+            handler (val) {
+                if (val && val.length && this.isFirst) {
+                    this.isFirst = false
+                    this.activeName = val[0].peiZhiId
+                    this.tableList = val.map(item => ({
+                        ...item,
+                        lieBiaoShuJu: JSON.parse(item.lieBiaoShuJu)
+                    }))
+                }
+            }
+        },
+        tableList: {
+            async handler (val) {
+                // console.log('tableList', val)
+                this.$emit('change-data', 'PCRjygzrzxqb', val.map(item => ({
+                    ...item,
+                    lieBiaoShuJu: JSON.stringify(item.lieBiaoShuJu),
+                    lieBiaoWenBen: this.formatContent(item.lieBiaoShuJu, item.quYuMing)
+                })))
+            },
+            deep: true
+        }
+    },
+    mounted () {
+        // console.log('init', this.formData)
+        this.getData()
+    },
+    methods: {
+        formatContent (content, title) {
+            let str = ''
+            str += title + '\n'
+            content.forEach(row => {
+                if (row.type === 'text') {
+                    str += row.content
+                }
+                if (row.type === 'group') {
+                    row.children.forEach(col => {
+                        if (col.type === 'text') {
+                            str += col.content || ''
+                        }
+                        if (col.type === 'checkbox') {
+                            str += col.value ? '☑' : '□'
+                        }
+                        if (col.type === 'input') {
+                            str += col.value || ''
+                        }
+                    })
+                }
+                str += '\n'
+            })
+            return str
+        },
+        async getData () {
+            const sql = `select * from t_pcrjygzrzpzb`
+            let { variables: { data = [] } = {}} = await this.$common.request('sql', sql)
+            if (!this.isFirst) return
+            data = data.filter(item => item.lei_xing_ === this.formData.leiXing)
+            data.length > 0 && (this.activeName = data[0].id_)
+            this.tableList = data.map(item => {
+                let t = []
+                if (item.lie_biao_shu_ju_) {
+                    item.lie_biao_shu_ju_ = JSON.parse(item.lie_biao_shu_ju_)
+                    item.lie_biao_shu_ju_.forEach(i => {
+                        i.value = i.default || ''
+                        i.children?.forEach(ii => {
+                            ii.value = ii.default || ''
+                        })
+                    })
+                    t = item.lie_biao_shu_ju_
+                }
+                return {
+                    quYuMing: item.qu_yu_ming_,
+                    lieBiaoShuJu: t,
+                    peiZhiId: item.id_,
+                    bianZhiRen: ''
+                }
+            })
+            // console.log('add', this.tableList)
+        }
+    }
+}
+</script>
+
+<style lang="scss">
+.pcr{
+    padding: 20px 0 20px 20px;
+    .user{
+        display: flex;
+    }
+    .col-item{
+        margin: 2px 5px 2px 5px;
+    }
+}
+</style>

+ 1 - 1
src/views/platform/cat/type/manage.vue

@@ -225,7 +225,7 @@ export default {
             })
         },
         handleTreeAction (command, position, selection, data) {
-            if (data.sn === 0 && data.name === '文件分类') {
+            if (data?.sn === 0 && data?.name === '文件分类') {
                 const object = {
                     diDian: this.level,
                     buMen: '',

+ 6 - 2
src/views/platform/examination/questionBank/edit.vue

@@ -638,8 +638,12 @@ export default {
         handleSubmit () {
             this.$refs.form.validate((valid) => {
                 if (valid) {
-                    // 表单验证通过,提交表单
-                    this.submitForm()
+                    if (this.form.suo_shu_fan_wei_ === '组级' && !this.form.bian_zhi_bu_men_) {
+                        this.$message.warning('所属范围为组级,请选择对应的专业组!')
+                    } else {
+                        // 表单验证通过,提交表单
+                        this.submitForm()
+                    }
                 } else {
                     ActionUtils.saveErrorMessage()
                 }