Просмотр исходного кода

Merge branch 'master' of http://119.23.210.103:3000/wy/lh_firm_former

zhangjingyuan 2 лет назад
Родитель
Сommit
dca8c15a9f

+ 12 - 0
src/api/detection/universalCRUD.js

@@ -204,3 +204,15 @@ function reqData(params){
   let md5 = sig(params) //加密, 获取md5密文
   return params.slice(0,1)+'"sig":"'+md5+'",'+params.slice(1) //结果拼接
 }
+
+
+/*
+检测报告归档接口
+*/
+export function selectDetectionFile(params) {
+    return request({
+      url: '/business/v3/sys/universal/selectDetectionFile',
+      method: 'post',
+      data: params
+    })
+  }

+ 12 - 0
src/api/platform/form/seal.js

@@ -50,4 +50,16 @@ export const docxToPdfAndSign = params => {
         isLoading: true,
         params
     })
+}
+/**
+ * 转pdf,文件新增修订
+ * @param {*} params
+ */
+export const transferPDF = params => {
+    return request({
+        url: FORM_URL() + '/sys/esspdf/onlyOfficeToPdf',
+        method: 'post',
+        isLoading: true,
+        params
+    })
 }

+ 18 - 16
src/business/platform/bpmn/form/action.js

@@ -37,11 +37,7 @@ export default {
                     } else {
                         this.setData()
                     }
-                    // if (this.isHide()) {
                     this.handleDirectActionEvent(actionName)
-                    // } else {
-                    //     this.agreeDialogVisible = true
-                    // }
                     break
                 case 'oppose':// 反对
                     this_.$confirm(
@@ -53,12 +49,8 @@ export default {
                             type: "warning"
                         }
                     ).then(() => {
-                        // if (this.isHide()) {
                         this.setData("未同意")
                         this.handleDirectActionEvent(actionName)
-                        // } else {
-                        //     this.agreeDialogVisible = true
-                        // }
                     }).catch(() => { })
                     break
                 case 'abandon':// 弃权
@@ -107,11 +99,6 @@ export default {
                 case 'rejectToStart':// 驳回发起人
                 case 'reject':// 驳回
                     this.setData("已退回")
-                    // if (this.isBpmOpinionHide && actionName === 'rejectToPrevious') {
-                    //     this.handleDirectActionEvent(actionName)
-                    // } else {
-                    //     this.rejectDialogVisible = true
-                    // }
                     this.rejectDialogVisible = true
                     break
                 case 'delegate':// 转办
@@ -127,7 +114,7 @@ export default {
                     this.addSignTaskDialogVisible = true
                     break
                 case 'endProcess':// 终止流程
-                    this.setData("2")
+                    this.setData("已终止")
                     this.handleEndProcess()
                     break
                 case 'print':// 打印
@@ -388,8 +375,23 @@ export default {
                     type: 'warning'
                 }).then(() => {
                     const opinion = this.hasFormOpinion() ? this.getFormOpinionData() : ''
-                    this.handleDoEndProcess({
-                        opinion: opinion
+                    const formData = this.getFormData()
+                    const loading = this.$loading({
+                        lock: true,
+                        text: this.$t('common.saving')
+                    })
+                    if (!formData) return
+                    bpmTaskSave({
+                        taskId: this.taskId,
+                        data: JSON.stringify(formData)
+                    }).then(response => {
+                        this.handleDoEndProcess({
+                            opinion: opinion
+                        }).then(() => {
+                            loading.close()
+                        })
+                    }).catch(error => {
+                        loading.close()
                     })
                 }).catch(() => { })
             } else {

+ 17 - 2
src/business/platform/data/templaterender/components/print.vue

@@ -19,7 +19,7 @@
                     <template v-for="(o, i) in modelList">
                         <div v-if="item[o.value]" :class="$style.item" :style="`width: ${o.width};`">
                             <span :class="$style.name">{{ o.label }}:</span>
-                            <span :class="$style.value">{{ item[o.value] }}</span>
+                            <span :class="$style.value">{{ item[o.value] | dateFormat(o) }}</span>
                         </div>
                     </template>
                     <vue-barcode
@@ -51,7 +51,7 @@
             },
             title: {
                 type: String,
-                default: '标签打印'
+                default: '标签打印(实际效果以打印页面为准)'
             },
             list: {
                 type: Array,
@@ -62,6 +62,15 @@
                 default: '物料'
             }
         },
+        filters: {
+            dateFormat (v, o) {
+                const s = ['daoKuRiQi', 'youXiaoQi']
+                if (s.includes(o.value)) {
+                    return v.replace(/-/g, '.')
+                }
+                return v
+            }
+        },
         components: {
             vueEasyPrint: () => import('vue-easy-print'),
             VueBarcode: () => import('vue-barcode')
@@ -156,11 +165,17 @@
                 }
             }
             .barcode {
+                width: 100%;
                 position: absolute;
                 text-align: center;
                 bottom: 4px;
                 left: 0;
                 right: 0;
+                :global {
+                    .vue-barcode-element {
+                        width: 100% !important;
+                    }
+                }
             }
             &:last-child {
                 margin-bottom: 0;

+ 9 - 1
src/business/platform/file/attachment/selector.vue

@@ -57,7 +57,7 @@
     import { TRANSFER_DATA } from '@/constant'
     import fView from './editFile/fView.vue'
     import { SYSTEM_URL, BASE_API } from '@/api/baseUrl'
-
+    const specialField = ['报告文件', '报告文档', '已盖章报告']
     export default {
         components: {
             IbpsFileAttachmentSelector,
@@ -195,6 +195,13 @@
                     lineHeight: `${height}px`,
                     display: 'inline'
                 }
+            },
+            pdfPreviewType() {
+                const t = specialField.some(i => this.elFormItem.label && this.elFormItem.label.includes(i))
+                if (this.elFormItem.label && t) {
+                    return 'PDFH5'
+                }
+                return 'ONLYOFFICE'
             }
         },
         watch: {
@@ -522,6 +529,7 @@
                 this.optionFileView.fileType = this.attachment.ext // 类型
                 this.optionFileView.data = this.attachment // 记录编制的位置,需要替换。
                 this.optionFileView.data.index = index
+                this.optionFileView.previewType = this.pdfPreviewType
                 this.filePreviewVisible = true
             },
             /**

+ 4 - 1
src/business/platform/form/utils/JForm.js

@@ -27,9 +27,10 @@ import pinyin4js from 'pinyin4js';
 import store from '@/store'
 import router from '@/router'
 import { save } from '@/api/platform/message/innerMessage'
+import { get as getUserById } from '@/api/platform/org/user'
 
 import {
-    goSeal, wordToPdf, sealByKeywords, docxToPdfAndSign
+    goSeal, wordToPdf, sealByKeywords, docxToPdfAndSign,transferPDF
 } from '@/api/platform/form/seal' // ca电子签章接口
 
 
@@ -66,10 +67,12 @@ _.extend(JForm, {
         this.$save = save   // 文件发放通知
         this.$goSeal = goSeal  // ca电子签章接口
         this.$wordToPdf = wordToPdf  // word转pdf
+        this.$transferPDF = transferPDF  // 转pdf,文件新增修订
         this.$sealByKeywords = sealByKeywords // 关键字盖章
         this.$getFileByte = getFileByte // 获取文件流
         this.$uploadFile = uploadFile   // 文件上传接口
         this.$sign = docxToPdfAndSign
+        this.$getUserById = getUserById
         this._ = _
         this.$store = store
         this._isInitialization = true

+ 15 - 18
src/business/platform/org/employee/panel.vue

@@ -222,24 +222,21 @@ export default {
     showTree: {
       handler: function(val, oldVal) {
         this.lazyTree = this.partyType === 'org'
-       /* if (val === false) { */
-          this.listConfig.searchForm.forms = [
-            { prop: 'name', label: '姓名' }
-          ]
-          this.listConfig.columns = [
-            { prop: 'name', label: '姓名'},
-            { prop: 'createTime', label: '创建时间' ,width:200}
-          ]
-        /* } else {
-          this.listConfig.searchForm.forms = [
-            { prop: 'Q^NAME_^SL', label: '姓名', itemWidth: '200' },
-            { prop: 'Q^ACCOUNT_^SL', label: '帐号', itemWidth: '200' }
-          ]
-          this.listConfig.columns = [
-            { prop: 'name', label: '姓名' },
-            { prop: 'status', label: '状态' }
-          ]
-        } */
+        if (val === false) {
+            this.listConfig.searchForm.forms = [
+                { prop: 'name', label: '姓名' }
+            ]
+            this.listConfig.columns = [
+                { prop: 'name', label: '姓名'},
+            ]
+         } else {
+            this.listConfig.searchForm.forms = [
+                { prop: 'Q^NAME_^SL', label: '姓名', itemWidth: '200' }
+            ]
+            this.listConfig.columns = [
+                { prop: 'name', label: '姓名' }
+            ]
+        }
       },
       immediate: true
     },

+ 4 - 2
src/components/ibps-file-viewer/index.vue

@@ -125,7 +125,8 @@
                 return PopupManager.getZIndex()
             },
             loadViewer() {
-                var flag = true;
+                console.log(this.optionFile.previewType)
+                var flag = true
                 if (/Mobi|Android|iPhone|iPad/i.test(navigator.userAgent)) {
                     flag = false
                 }
@@ -134,7 +135,8 @@
                     this.zIndex = this.fixZIndex()
                     this.fileUrl = this.url
                     this.fileType = 'image'
-                } else if(flag && pdfType.includes(this.fileExt)){
+                } else if(flag && pdfType.includes(this.fileExt) && this.optionFile.previewType === 'PDFH5'){
+                    // 仅特定字段的PDF文件用PDFh5预览,其余PDF文件使用onlyoffice预览
                     this.fileType = 'pdf'
                     this.$nextTick(() => {
                         this.$refs.viewer.load(this.url)

+ 18 - 11
src/views/platform/bpmn/bpmInstHis/oldFilesUploadList.vue

@@ -23,6 +23,7 @@
                :pagination="pagination"
                :selection-row="selection"
                @action-event="handleAction"
+               @sort-change="handleSortChange"
                @pagination-change="handlePaginationChange">
 
       <template slot="wenjinachayue"
@@ -123,7 +124,7 @@ export default {
       },
       paginations: 20,
       page: 1,
-      sorts: {},
+      sorts: {NIAN_DU_: "desc"},
       depth: '', // 分类栏层级
       treeData: [], // 分类栏数据
       guanJian: '',
@@ -151,11 +152,11 @@ export default {
         },
         // 表格字段配置
         columns: [
+          { prop: 'nian_du_', label: '年度', width: 80, dateFormat: 'yyyy', sortable: 'custom' },
           { prop: 'fen_lei_', label: '记录表单分类', width: 120 },
           { prop: 'biao_dan_ming_che', label: '表单名称', width: 350 },
           { prop: 'shi_wu_shuo_ming_', label: '事务说明', width: 350 },
 
-          { prop: 'nian_du_', label: '年度', width: 80 },
           { prop: 'bian_zhi_shi_jian', label: '上传时间', width: 100 },
           //   { prop: 'bm_name', label: '上传部门', width: 120 },
           { prop: 'ry_name', label: '上传人', width: 100 },
@@ -212,14 +213,14 @@ export default {
       if (this.depth == '0') {
 
         let nianduWhere = this.niandu ? (
-          startTimeWhere ? ` where  nian_du_ = '${this.niandu}' and` + startTimeWhere : ` where  nian_du_ = '${this.niandu}'`
+          startTimeWhere ? ` where  nian_du_ like '%${this.niandu}%' and` + startTimeWhere : ` where  nian_du_ like '%${this.niandu}%'`
         ) : (
           startTimeWhere ? ' where ' + startTimeWhere : ''
         )
-        let where = nianduWhere?(this.guanJian ? nianduWhere + ` and (biao_dan_ming_che like '%${this.guanJian}%' or shi_wu_shuo_ming_ like '%${this.guanJian}%')` : nianduWhere):(
-            this.guanJian? ` where biao_dan_ming_che like '%${this.guanJian}%' or shi_wu_shuo_ming_ like '%${this.guanJian}%'`:''
+        let where = nianduWhere ? (this.guanJian ? nianduWhere + ` and (biao_dan_ming_che like '%${this.guanJian}%' or shi_wu_shuo_ming_ like '%${this.guanJian}%')` : nianduWhere) : (
+          this.guanJian ? ` where biao_dan_ming_che like '%${this.guanJian}%' or shi_wu_shuo_ming_ like '%${this.guanJian}%'` : ''
         )
-        let sql = 'select * FROM t_ywyxjlb jl  LEFT JOIN lh_bm_ry ry ON ry.ry_id  = jl.bian_zhi_ren_' + where + ' order by bian_zhi_shi_jian desc'
+        let sql = 'select * FROM t_ywyxjlb jl  LEFT JOIN lh_bm_ry ry ON ry.ry_id  = jl.bian_zhi_ren_' + where + ` order by nian_du_ ${this.sorts.NIAN_DU_}, bian_zhi_shi_jian desc`
         curdPost('sql', sql).then(response => {
           let tableDatas = response.variables.data
           if (tableDatas.length !== 0) {
@@ -262,7 +263,7 @@ export default {
         }
 
         let nianduWhere = this.niandu ? (
-          startTimeWhere ? ` where  nian_du_ = '${this.niandu}' and` + startTimeWhere : ` where  nian_du_ = '${this.niandu}'`
+          startTimeWhere ? ` where  nian_du_ like '%${this.niandu}%' and` + startTimeWhere : ` where  nian_du_ like '%${this.niandu}%'`
         ) : (
           startTimeWhere ? ' where ' + startTimeWhere : ''
         )
@@ -271,10 +272,10 @@ export default {
         ) : (
           nianduWhere ? nianduWhere : ``
         )
-        let where = idwhere?(this.guanJian ? idwhere + ` and (biao_dan_ming_che like '%${this.guanJian}%' or shi_wu_shuo_ming_ like '%${this.guanJian}%')` : idwhere):(
-            this.guanJian? ` where biao_dan_ming_che like '%${this.guanJian}%' or shi_wu_shuo_ming_ like '%${this.guanJian}%'`:''
+        let where = idwhere ? (this.guanJian ? idwhere + ` and (biao_dan_ming_che like '%${this.guanJian}%' or shi_wu_shuo_ming_ like '%${this.guanJian}%')` : idwhere) : (
+          this.guanJian ? ` where biao_dan_ming_che like '%${this.guanJian}%' or shi_wu_shuo_ming_ like '%${this.guanJian}%'` : ''
         )
-        let sql = `select * FROM t_ywyxjlb jl  LEFT JOIN lh_bm_ry ry ON ry.ry_id  = jl.bian_zhi_ren_   ` + where + ` order by bian_zhi_shi_jian desc`
+        let sql = `select * FROM t_ywyxjlb jl  LEFT JOIN lh_bm_ry ry ON ry.ry_id  = jl.bian_zhi_ren_   ` + where + ` order by nian_du_ ${this.sorts.NIAN_DU_},bian_zhi_shi_jian desc`
         console.log('22222')
 
         curdPost('sql', sql).then(response => {
@@ -450,7 +451,13 @@ export default {
           break
       }
     },
-
+/**
+     * 处理排序
+     */
+    handleSortChange(sort) {
+      ActionUtils.setSorts(this.sorts, sort)
+      this.loadData()
+    },
     handleNodeClick(typeId, typeName, treeData) {
       this.tableTitle = typeName.name
       this.typeId = typeId

+ 358 - 398
src/views/platform/bpmn/bpmInstHis/record/component/testingRecord.vue

@@ -3,7 +3,7 @@
         <div class="header">{{ info.title }}</div>
         <div class="search-box">
             <template v-for="(item, index) in searchList">
-                <span class="label">{{item.label}}</span>
+                <span class="label">{{ item.label }}</span>
                 <el-input
                     v-if="item.value !== 'sampleTime'"
                     v-model="searchParam[item.value]"
@@ -12,72 +12,61 @@
                     placeholder="请输入内容"
                     clearable
                     @keyup.enter.native="search"
-                ></el-input>
+                    @change="search"
+                />
                 <el-date-picker
                     v-else
                     v-model="searchParam[item.value]"
                     type="daterange"
+                    value-format="yyyy-MM-dd"
                     size="mini"
                     unlink-panels
                     range-separator="-"
                     start-placeholder="开始日期"
                     end-placeholder="结束日期"
-                    style="width: 220px;"
-                ></el-date-picker>
+                    style="width: 220px"
+                    @change="search"
+                />
             </template>
-            <el-button class="btn" type="primary" @click="search">
-                <i class="ibps-icon-search"></i>查询
-            </el-button>
+            <el-button class="btn" type="primary" @click="search"> <i class="ibps-icon-search"></i>查询 </el-button>
         </div>
         <div class="table-container">
             <el-table
                 :data="tableData"
                 :stripe="true"
-                style="width: 100%;"
+                style="width: 100%"
                 height="75vh"
+                border
                 max-height="100%"
                 header-cell-class-name="table-header"
+                @sort-change="sortChange"
             >
                 <!-- <el-table-column type="selection" width="55"></el-table-column> -->
-                <el-table-column prop="he_tong_id_" label="合同编号" width="100">
-                    <template slot-scope="scope">{{ scope.row.he_tong_id_ | getID(contractList) }}</template>
-                </el-table-column>
-                <el-table-column prop="wei_tuo_id_" label="委托单号" width="110">
-                    <template slot-scope="scope">{{ scope.row.wei_tuo_id_ | getID(trustList) }}</template>
-                </el-table-column>
-                <el-table-column prop="bao_gao_bian_hao_" label="报告编号" width="110"></el-table-column>
-                <el-table-column prop="run_qian_lu_jing_" label="版本号" width="80"></el-table-column>
+                <el-table-column prop="he_tong_bian_hao_" label="合同编号" sortable width="110"></el-table-column>
+                <el-table-column prop="wei_tuo_bian_hao_" label="委托单号" sortable width="110"></el-table-column>
+                <el-table-column prop="bao_gao_bian_hao_" label="报告编号" sortable width="120"></el-table-column>
+                <el-table-column prop="run_qian_lu_jing_" label="版本号" width="100"></el-table-column>
                 <!-- <el-table-column prop="wei_tuo_fang_" label="委托单位"></el-table-column> -->
                 <!-- <el-table-column prop="wan_cheng_shi_jia" label="委托日期" width="100"></el-table-column> -->
-                <el-table-column prop="yang_pin_bian_hao" label="样品编号" width="110"></el-table-column>
-                <el-table-column prop="yang_pin_ming_che" label="样品名称" width="150"></el-table-column>
+                <el-table-column prop="yang_pin_bian_hao" label="样品编号" sortable width="120"></el-table-column>
+                <el-table-column prop="yang_pin_ming_che" label="样品名称" sortable width="150"></el-table-column>
                 <el-table-column prop="song_jian_" label="送检单位" width="150"></el-table-column>
-                <el-table-column prop="song_jian_shi_jia" label="送检日期" width="100"></el-table-column>
+                <el-table-column prop="song_jian_shi_jia" label="送检日期" sortable width="120"></el-table-column>
                 <el-table-column label="检测时间" width="100">
                     <template slot-scope="scope">{{ getTestTime(scope.row) }}</template>
                 </el-table-column>
-                <el-table-column prop="gai_zhang_jian_pd" label="检测项目"></el-table-column>
-
+                <el-table-column prop="gai_zhang_jian_pd" label="检测项目" minWidth="200"></el-table-column>
                 <el-table-column label="操作" align="left" width="100">
                     <template slot-scope="scope">
                         <el-popover placement="left" width="200" trigger="click">
-                            <div slot="reference" class="more">
-                                <i class="el-icon-caret-bottom"></i>查阅
-                            </div>
-                            <template v-for="(item ,index) in reportList">
+                            <div slot="reference" class="more"><i class="el-icon-caret-bottom"></i>查阅</div>
+                            <template v-for="(item, index) in reportList">
                                 <!-- 检测记录 -->
                                 <div v-if="item.key === 'testing'">
                                     <el-popover placement="left" width="200" trigger="click">
-                                        <div class="operate-item" slot="reference" @click="getTesting(scope.row)">
-                                            <i class="el-icon-s-order"></i> {{item.name}}
-                                        </div>
+                                        <div slot="reference" class="operate-item" @click="getTesting(scope.row)"><i class="el-icon-s-order"></i> {{ item.name }}</div>
                                         <div class="three-item">
-                                            <div
-                                                v-for="i in testingList"
-                                                :key="i.id"
-                                                class="operate-item"
-                                                @click="consult(i)"
-                                            >
+                                            <div v-for="i in testingList" :key="i.id" class="operate-item" @click="consult(i)">
                                                 {{ i.projectName }}
                                             </div>
                                         </div>
@@ -85,29 +74,16 @@
                                 </div>
                                 <div v-else-if="item.key === 'file'">
                                     <el-popover placement="left" width="300" trigger="click">
-                                        <div class="operate-item" slot="reference" @click="getFile(scope.row, item.field)">
-                                            <i class="el-icon-s-order"></i> {{item.name}}
-                                        </div>
+                                        <div slot="reference" class="operate-item" @click="getFile(scope.row, item.field)"><i class="el-icon-s-order"></i> {{ item.name }}</div>
                                         <div class="three-item">
-                                            <div
-                                                v-for="i in fileList"
-                                                :key="i.id"
-                                                class="operate-item"
-                                            >
-                                                <span @click="preview(i)"><i class="el-icon-tickets" ></i>{{ i.fileName }}.{{ i.ext }}</span>
+                                            <div v-for="i in fileList" :key="i.id" class="operate-item">
+                                                <span @click="preview(i)"><i class="el-icon-tickets"></i>{{ i.fileName }}.{{ i.ext }}</span>
                                                 <i class="el-icon-download" @click="download(i)"></i>
                                             </div>
                                         </div>
                                     </el-popover>
                                 </div>
-                                <div
-                                    v-else
-                                    :key="index"
-                                    class="operate-item"
-                                    @click="alertReport(item.path, scope.row[item.key])"
-                                >
-                                    <i class="el-icon-s-order"></i> {{item.name}}
-                                </div>
+                                <div v-else :key="index" class="operate-item" @click="alertReport(item.path, scope.row[item.key])"><i class="el-icon-s-order"></i> {{ item.name }}</div>
                             </template>
                         </el-popover>
                     </template>
@@ -128,15 +104,14 @@
         </el-dialog>
         <div class="pagination">
             <el-pagination
-                @size-change="handleSizeChange"
-                @current-change="handleCurrentChange"
                 :current-page.sync="currentPage"
                 :page-sizes="[10, 20, 50, 100]"
-                :page-size="20"
+                :page-size="pageSize"
                 layout="total, sizes, prev, pager, next, jumper"
                 :total="total"
-            >
-            </el-pagination>
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+            ></el-pagination>
         </div>
         <image-viewer
             v-if="fileType === 'image'"
@@ -148,374 +123,359 @@
 </template>
 
 <script>
-    import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
-    import { previewFile } from '@/api/platform/file/attachment'
-    import { downloadFile } from '@/business/platform/file/utils'
-    import PopupManager from '@/utils/popup'
-    import { SYSTEM_URL, BASE_API } from '@/api/baseUrl'
-    const searchList = [
-        {
-            label: '报告编号',
-            value: 'report'
+import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
+import { previewFile } from '@/api/platform/file/attachment'
+import { downloadFile } from '@/business/platform/file/utils'
+import PopupManager from '@/utils/popup'
+import { SYSTEM_URL, BASE_API } from '@/api/baseUrl'
+import { selectDetectionFile } from '@/api/detection/universalCRUD'
+const searchList = [
+    {
+        label: '报告编号',
+        value: 'report'
+    },
+    {
+        label: '样品编号',
+        value: 'sampleId'
+    },
+    {
+        label: '样品名称',
+        value: 'sampleName'
+    },
+    {
+        label: '检测项目',
+        value: 'projectName'
+    },
+    {
+        label: '送检日期',
+        value: 'sampleTime'
+    }
+]
+const reportList = [
+    // {
+    //     name: '合同',
+    //     key: 'he_tong_id_',
+    //     path: '',
+    //     hasItem: false
+    // },
+    {
+        name: '检测委托单',
+        key: 'wei_tuo_id_',
+        path: '43罗湖/LHXBJY-QP-7.1-01-FQ-05 检测委托单.rpx',
+        hasItem: false
+    },
+    // {
+    //     name: '检测报告审批表',
+    //     key: 'id_',
+    //     path: '43罗湖/检测报告审批表.rpx',
+    //     hasItem: false
+    // },
+    {
+        name: '检测记录',
+        key: 'testing',
+        path: '43罗湖/LHXBJY 检测实验记录',
+        hasItem: true
+    },
+    {
+        name: '附件',
+        key: 'file',
+        path: '',
+        field: 'suo_you_yuan_shi_,fu_jian_yi_',
+        hasItem: true
+    },
+    {
+        name: '检测报告',
+        key: 'file',
+        path: '43罗湖/LHXBJY 检测报告',
+        field: 'bao_gao_pdf_',
+        hasItem: false
+    }
+]
+// 检测实验记录报表路径
+const testingPath = {
+    Process_140upmu: '43罗湖/LHXBJY 检测实验记录',
+    Process_0idt26n: '43罗湖/LHXBJY-JC-SOP-001-FQ-01 无菌检测记录表.rpx',
+    Process_1rwhy1r: '43罗湖/LHXBJY-JC-SOP-002-FQ-01 支原体检测(培养法).rpx',
+    Process_05lkhio: '43罗湖/LHXBJY-JC-SOP-003-FQ-01 细菌内毒素检查记录表.rpx'
+}
+
+const imageType = ['jpg', 'jpeg', 'bmp', 'png', 'gif']
+export default {
+    filters: {
+        getID (v, arr) {
+            const result = arr.find((item) => item.id_ === v)
+            return result ? result.name_ : v
         },
-        {
-            label: '样品编号',
-            value: 'sampleId'
+        getYear (v) {
+            return v ? v.slice(0, 4) : ''
+        }
+    },
+    components: {
+        ImageViewer: () => import('@/components/ibps-file-viewer/image')
+    },
+    props: {
+        info: {
+            type: Object,
+            default: () => {}
+        }
+    },
+    data () {
+        return {
+            searchList,
+            reportList,
+            reportId: '',
+            total: 0,
+            pageSize: 20,
+            currentPage: 1,
+            visible: false,
+            searchParam: {
+                report: '',
+                sampleId: '',
+                sampleName: '',
+                projectName: '',
+                sampleTime: ''
+            },
+            tableData: [],
+            testingList: [],
+            fileList: [],
+            contractList: [],
+            trustList: [],
+            srcUrl: '',
+            globalSql: '',
+            fileUrl: '',
+            fileType: '',
+            zIndex: 2000,
+            fileOption: {
+                user: {}
+            },
+            prop: '',
+            order: '',
+            params: ''
+        }
+    },
+    created () {
+        this.loadData()
+    },
+    beforeDestroy () {
+        this.fileType = ''
+    },
+    methods: {
+        // 请求表格数据函数
+        loadData () {
+            console.log(this.searchParam.sampleTime)
+            this.tableData = []
+            const params = {
+                zhuang_tai_: "'已完成','待发放'",
+                bao_gao_lei_bie_: this.info.type,
+                bao_gao_bian_hao_: this.searchParam.report ? `%${this.searchParam.report}%` : null,
+                yang_pin_bian_hao: this.searchParam.sampleId ? `%${this.searchParam.sampleId}%` : null,
+                yang_pin_ming_che: this.searchParam.sampleName ? `%${this.searchParam.sampleName}%` : null,
+                gai_zhang_jian_pd: this.searchParam.projectName ? `%${this.searchParam.projectName}%` : null,
+                start_: this.searchParam.sampleTime ? this.searchParam.sampleTime[0] : '',
+                end_: this.searchParam.sampleTime ? this.searchParam.sampleTime[1] : '',
+                sort: this.prop,
+                limit: this.pageSize,
+                pageNo: this.currentPage,
+                order: this.order
+            }
+            selectDetectionFile(params).then((res) => {
+                const data = res.data
+                const { dataResult, pageResult } = data
+                // console.log(pageResult)
+                this.tableData = dataResult
+                this.total = pageResult.totalCount
+            })
         },
-        {
-            label: '样品名称',
-            value: 'sampleName'
+        getTestTime ({ jian_ce_kai_shi_s, jian_ce_jie_shu_s }) {
+            const start = jian_ce_kai_shi_s ? jian_ce_kai_shi_s.slice(0, 10) : ''
+            const end = jian_ce_jie_shu_s ? jian_ce_jie_shu_s.slice(0, 10) : ''
+            if (!start && !end) {
+                return ''
+            }
+            if (!end || start === end) {
+                return start
+            }
+            return `${start}至${end}`
         },
-        {
-            label: '检测项目',
-            value: 'projectName'
+        // 获取检测项目数据
+        getTesting (row) {
+            const { wei_tuo_id_, yang_pin_bian_hao, xiu_gai_bao_gao_b } = row
+            this.testingList = []
+            const sql = `select b.id_ as id, a.defkey_ as number, a.jian_ce_xiang_mu_ as projectName, max(b.create_time_) from t_mjjcnlfw a, t_lhjczb b where a.id_ = b.jian_ce_xiang_mu_ and b.wei_tuo_id_ = '${wei_tuo_id_}' and b.yang_pin_bian_hao = '${yang_pin_bian_hao}' and find_in_set(b.jian_ce_xiang_mu_, '${xiu_gai_bao_gao_b}') group by b.jian_ce_xiang_mu_`
+            curdPost('sql', sql).then((res) => {
+                this.testingList = res.variables && res.variables.data
+                // console.log(this.testingList)
+            })
         },
-        {
-            label: '送检日期',
-            value: 'sampleTime'
-        }
-    ]
-    let reportList = [
-        // {
-        //     name: '合同',
-        //     key: 'he_tong_id_',
-        //     path: '',
-        //     hasItem: false
-        // },
-        {
-            name: '检测委托单',
-            key: 'wei_tuo_id_',
-            path: '43罗湖/LHXBJY-QP-7.1-01-FQ-05 检测委托单.rpx',
-            hasItem: false
+        // 获取附件信息,报告表【bao_gao_pdf_, suo_you_yuan_shi_, fu_jian_yi_】字段
+        getFile (row, key) {
+            let files = ''
+            if (key.includes(',')) {
+                // 多字段
+                const a = row.suo_you_yuan_shi_ ? row.suo_you_yuan_shi_.split(',') : []
+                const b = row.fu_jian_yi_ ? row.fu_jian_yi_.split(',') : []
+                files = a.concat(b).join(',')
+            } else {
+                files = row[key]
+            }
+            this.fileList = []
+            const sql = `select id_ as id, file_name_ as fileName, ext_ as ext from ibps_file_attachment where find_in_set(id_, '${files}')`
+            curdPost('sql', sql).then((res) => {
+                this.fileList = res.variables && res.variables.data
+            })
         },
-        // {
-        //     name: '检测报告审批表',
-        //     key: 'id_',
-        //     path: '43罗湖/检测报告审批表.rpx',
-        //     hasItem: false
-        // },
-        {
-            name: '检测记录',
-            key: 'testing',
-            path: '43罗湖/LHXBJY 检测实验记录',
-            hasItem: true
+        consult (data) {
+            this.alertReport(testingPath[data.number], data.id)
         },
-        {
-            name: '附件',
-            key: 'file',
-            path: '',
-            field: 'suo_you_yuan_shi_,fu_jian_yi_',
-            hasItem: true
+        timeFormat (time) {
+            return new Date(time.getTime() + 28800000).toJSON().slice(0, 10)
         },
-        {
-            name: '检测报告',
-            key: 'file',
-            path: '43罗湖/LHXBJY 检测报告',
-            field: 'bao_gao_pdf_',
-            hasItem: false
-        }
-    ]
-    // 检测实验记录报表路径
-    const testingPath = {
-        'Process_140upmu': '43罗湖/LHXBJY 检测实验记录',
-        'Process_0idt26n': '43罗湖/LHXBJY-JC-SOP-001-FQ-01 无菌检测记录表.rpx',
-        'Process_1rwhy1r': '43罗湖/LHXBJY-JC-SOP-002-FQ-01 支原体检测(培养法).rpx',
-        'Process_05lkhio': '43罗湖/LHXBJY-JC-SOP-003-FQ-01 细菌内毒素检查记录表.rpx'
-    }
-    
-    const imageType = ['jpg', 'jpeg', 'bmp', 'png', 'gif']
-    export default {
-        filters: {
-            getID (v, arr) {
-                let result = arr.find(item => item.id_ === v)
-                return result ? result.name_ : v
-            },
-            getYear (v) {
-                return v ? v.slice(0, 4) : ''
-            }
+        // 组装查询SQL
+        search () {
+            this.loadData()
         },
-        components: {
-            ImageViewer: () => import('@/components/ibps-file-viewer/image')
+        handleSizeChange (value) {
+            this.currentPage = 1
+            this.pageSize = value
+            this.loadData()
         },
-        props: {
-            info: {
-                type: Object,
-                default: () => {}
-            }
+        handleCurrentChange (value) {
+            this.currentPage = value
+            this.loadData()
+        },
+        alertReport (path, id) {
+            this.srcUrl = `${this.$reportPash.replace('show', 'pdf')}${path}&id_=${id}`
+            this.visible = true
         },
-        data () {
-            return {
-                searchList,
-                reportList,
-                reportId: '',
-                total: null,
-                currentPage: 1,
-                visible: false,
-                searchParam: {
-                    report: '',
-                    sampleId: '',
-                    sampleName: '',
-                    projectName: '',
-                    sampleTime: ''
-                },
-                tableData: [],
-                testingList: [],
-                fileList: [],
-                contractList: [],
-                trustList: [],
-                srcUrl: '',
-                globalSql: '',
-                fileUrl: '',
-                fileType: '',
-                zIndex: 2000,
-                fileOption: {
-                    user: {}
-                }
+        // 文件预览
+        preview (file) {
+            if (imageType.includes(file.ext)) {
+                this.zIndex = PopupManager.getZIndex()
+                this.fileUrl = previewFile(file.id)
+                this.fileType = 'image'
+            } else {
+                this.getOption(file)
+                this.openWindow()
+                this.fileType = ''
             }
         },
-        created () {
-            // 全部检测档案type为空
-            const args = this.info.type ? ` and bao_gao_lei_bie_ = '${this.info.type}'` : ''
-            this.globalSql = `select * from t_lhjcbgb where zhuang_tai_ in ('已完成', '待发放')${args}`
-            // this.globalSql = `select * from t_lhjcbgb where bao_gao_lei_bie_ = '${this.info.type}'`
-            const sql = `${this.globalSql} order by create_time_ desc limit 0,20`
-            this.loadData(sql)
-            const sumsql = `select count(*) as total  from t_lhjcbgb where zhuang_tai_ in ('已完成', '待发放')${args}`
-            curdPost('sql', sumsql).then((response) => {
-                this.total = response.variables.data[0].total
+        getOption (file) {
+            this.fileOption.user.id = this.$store.getters.userId
+            this.fileOption.user.name = this.$store.getters.name
+            this.fileOption.url = BASE_API() + SYSTEM_URL() + `/file/download?attachmentId=${file.id}`
+            this.fileOption.editUrl = BASE_API() + SYSTEM_URL() + `/file/editCallback?fileName=${file.fileName}&fileType=${file.ext}&id=${file.id}`
+            this.fileOption.title = file.fileName
+            this.fileOption.fileType = file.ext
+            console.log(this.fileOption)
+        },
+        openWindow () {
+            const routeData = this.$router.resolve({
+                path: '/fileView',
+                query: this.fileOption
             })
+            window.open(routeData.href)
         },
-        beforeDestroy () {
-            this.fileType = ''
+        download (file) {
+            downloadFile(file)
         },
-        methods: {
-            // 请求表格数据函数
-            loadData (sql) {
-                this.tableData = []
-                curdPost('sql', sql).then((res) => {
-                    const { data } = res.variables
-                    if (!data || !data.length) {
-                        return
-                    }
-
-                    this.tableData = data
-                    let ids = {
-                        contract: [],
-                        trust: []
-                    }
-                    data.forEach(item => {
-                        ids.contract.push(item.he_tong_id_)
-                        ids.trust.push(item.wei_tuo_id_)
-                    })
-                    // 获取合同及委托单数据用于转换ID
-                    const sql1 = `select id_, he_tong_bian_hao_ as name_ from t_bjd where find_in_set(id_, '${ids.contract.join(',')}')`
-                    const sql2 = `select id_, wei_tuo_bian_hao_ as name_ from t_lhwtsqb where find_in_set(id_, '${ids.trust.join(',')}')`
-                    // console.log(sql1, sql2)
-                    curdPost('sql', sql1).then(res1 => {
-                        this.contractList = res1.variables && res1.variables.data
-                    })
-                    curdPost('sql', sql2).then(res2 => {
-                        this.trustList = res2.variables && res2.variables.data
-                    })
-                })
-            },
-            getTestTime ({jian_ce_kai_shi_s, jian_ce_jie_shu_s}) {
-                const start = jian_ce_kai_shi_s ? jian_ce_kai_shi_s.slice(0, 10) : ''
-                const end = jian_ce_jie_shu_s ? jian_ce_jie_shu_s.slice(0, 10) : ''
-                if (!start && !end) {
-                    return ''
-                }
-                if (!end || start === end) {
-                    return start
-                }
-                return `${start}至${end}`
-            },
-            // 获取检测项目数据
-            getTesting (row) {
-                const { wei_tuo_id_, yang_pin_bian_hao, xiu_gai_bao_gao_b } = row
-                this.testingList = []
-                const sql = `select b.id_ as id, a.defkey_ as number, a.jian_ce_xiang_mu_ as projectName, max(b.create_time_) from t_mjjcnlfw a, t_lhjczb b where a.id_ = b.jian_ce_xiang_mu_ and b.wei_tuo_id_ = '${wei_tuo_id_}' and b.yang_pin_bian_hao = '${yang_pin_bian_hao}' and find_in_set(b.jian_ce_xiang_mu_, '${xiu_gai_bao_gao_b}') group by b.jian_ce_xiang_mu_`
-                curdPost('sql', sql).then(res => {
-                    this.testingList = res.variables && res.variables.data
-                    // console.log(this.testingList)
-                })
-            },
-            // 获取附件信息,报告表【bao_gao_pdf_, suo_you_yuan_shi_, fu_jian_yi_】字段
-            getFile (row, key) {
-                let files = ''
-                if (key.includes(',')) {
-                    // 多字段
-                    let a = row.suo_you_yuan_shi_ ? row.suo_you_yuan_shi_.split(',') : []
-                    let b = row.fu_jian_yi_ ? row.fu_jian_yi_.split(',') : []
-                    files = a.concat(b).join(',')
-                } else {
-                    files = row[key]
-                }
-                this.fileList = []
-                const sql = `select id_ as id, file_name_ as fileName, ext_ as ext from ibps_file_attachment where find_in_set(id_, '${files}')`
-                curdPost('sql', sql).then(res => {
-                    this.fileList = res.variables && res.variables.data
-                })
-            },
-            consult (data) {
-                this.alertReport(testingPath[data.number], data.id)
-            },
-            timeFormat (time) {
-                return new Date(time.getTime() + 28800000).toJSON().slice(0, 10)
-            },
-            // 组装查询SQL
-            search () {
-                const { report, sampleId, sampleName, projectName, sampleTime } = this.searchParam
-                const start = sampleTime && sampleTime.length ? this.timeFormat(sampleTime[0]) : ''
-                const end = sampleTime && sampleTime.length ? this.timeFormat(sampleTime[1]) : ''
-                var t = ''
-                if (start === end) {
-                    t = `like '%${start}%'`
-                } else {
-                    t = `between '${start}' and '${end}'`
-                }
-                const paramsList = {
-                    report: ` and bao_gao_bian_hao_ like '%${report}%'`,
-                    sampleId: ` and yang_pin_bian_hao like '%${sampleId}%'`,
-                    sampleName: ` and yang_pin_ming_che like '%${sampleName}%'`,
-                    projectName: ` and gai_zhang_jian_pd like '%${projectName}%'`,
-                    sampleTime: ` and song_jian_shi_jia ${t}`
-                }
-                let params = ''
-                Object.keys(this.searchParam).forEach(item => {
-                    if (this.searchParam[item]) {
-                        params += paramsList[item]
-                    }
-                })
-                const sql = `${this.globalSql}${params} order by create_time_ desc limit 0,20`
-                // console.log(sql)
-                this.loadData(sql)
-            },
-            handleSizeChange (value) {
-                this.currentPage = 1
-                const sql = `${this.globalSql} order by create_time_ desc limit 0,${value}`
-                this.loadData(sql)
-            },
-            handleCurrentChange (value) {
-                const sql = `${this.globalSql} order by create_time_ desc limit ${value},20`
-                this.loadData(sql)
-            },
-            alertReport (path, id) {
-                this.srcUrl = `${this.$reportPash.replace('show', 'pdf')}${path}&id_=${id}`
-                this.visible = true
-            },
-            // 文件预览
-            preview (file) {
-                if (imageType.includes(file.ext)) {
-                    this.zIndex = PopupManager.getZIndex()
-                    this.fileUrl = previewFile(file.id)
-                    this.fileType = 'image'
-                } else {
-                    this.getOption(file)
-                    this.openWindow()
-                    this.fileType = ''
-                }
-            },
-            getOption (file) {
-                this.fileOption.user.id = this.$store.getters.userId
-                this.fileOption.user.name = this.$store.getters.name
-                this.fileOption.url = BASE_API() + SYSTEM_URL() + `/file/download?attachmentId=${file.id}`
-                this.fileOption.editUrl = BASE_API() + SYSTEM_URL() + `/file/editCallback?fileName=${file.fileName}&fileType=${file.ext}&id=${file.id}`
-                this.fileOption.title = file.fileName
-                this.fileOption.fileType = file.ext
-                console.log(this.fileOption)
-            },
-            openWindow () {
-                let routeData = this.$router.resolve({
-                    path: '/fileView',
-                    query: this.fileOption
-                })
-                window.open(routeData.href);
-            },
-            download (file) {
-                downloadFile(file)
+        sortChange (params) {
+            console.log(params)
+            const { prop, order } = params
+            this.prop = prop
+            switch (order) {
+                case 'descending':
+                    this.order = 'desc'
+                    break
+                case 'ascending':
+                    this.order = 'asc'
+                    break
+                default:
+                    this.prop = ''
+                    this.order = ''
             }
+            this.loadData()
         }
     }
+}
 </script>
 
 <style lang="scss">
-    .content {
-        .header {
-            margin-top: 5px;
-            width: 100%;
-            height: 25px;
-            text-align: center;
-            font-weight: 700;
-            background-color: #f9ffff;
-            font-size: 18px;
-        }
-        .search-box {
-            height: 30px;
-            margin-bottom: 20px;
-            .label {
-                margin: 0 6px 0 6px;
-                color: #916266;
-                font-size: 12px;
-            }
-            .input {
-                width: 150px;
-                font-size: 12px;
-                height: 28px !important;
-                line-height: 28px;
-                color: #606266;
-            }
-            .btn {
-                margin-left: 10px;
-                background-color: #409eff;
-                border-color: #409eff;
-                font-size: 12px;
-                border-radius: 3px;
-                padding: 7px 15px;
-            }
-        }
-        .table-container{
-            width: 100%;
-            height: calc(100vh - 220px);
-        }
-        .pagination{
-            height: 35px;
-            padding: 5px 2px;
-        }
-        .el-table__header .table-header{
-            color: #000;
-            font-size: 14px;
-            padding: 6px 6px;
-            background: #a7d6f8 !important
-        }
-        // .tableRowClassName {
-        //     backface-visibility: #d9eefd;
-        // }
-        // .el-table .warning-row {
-        //     background: #d9eefd;
-        // }
-        .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell {
-            background: #d9eefd;
-        }
-        .more {
-            cursor: pointer;
-            color: #409eff;
+.content {
+    .header {
+        margin-top: 5px;
+        width: 100%;
+        height: 25px;
+        text-align: center;
+        font-weight: 700;
+        background-color: #f9ffff;
+        font-size: 18px;
+    }
+    .search-box {
+        height: 30px;
+        margin-bottom: 20px;
+        .label {
+            margin: 0 6px 0 6px;
+            color: #916266;
+            font-size: 12px;
         }
-        .el-dropdown-link {
-            cursor: pointer;
-            color: #409eff;
+        .input {
+            width: 150px;
+            font-size: 12px;
+            height: 28px !important;
+            line-height: 28px;
+            color: #606266;
         }
-        .el-icon-arrow-down {
+        .btn {
+            margin-left: 10px;
+            background-color: #409eff;
+            border-color: #409eff;
             font-size: 12px;
+            border-radius: 3px;
+            padding: 7px 15px;
         }
     }
-    .operate-item {
+    .table-container {
+        width: 100%;
+        height: calc(100vh - 220px);
+    }
+    .pagination {
+        height: 35px;
+        padding: 5px 2px;
+    }
+    .el-table__header .table-header {
+        color: #000;
+        font-size: 12px;
+        padding: 6px 6px;
+        background: #a7d6f8 !important;
+    }
+    // .tableRowClassName {
+    //     backface-visibility: #d9eefd;
+    // }
+    // .el-table .warning-row {
+    //     background: #d9eefd;
+    // }
+    .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell {
+        background: #d9eefd;
+    }
+    .more {
         cursor: pointer;
-        color: #85ce61;
-        .el-icon-download {
-            float: right;
-            font-size: 16px;
-            color: #409eff;
-        }
+        color: #409eff;
+    }
+    .el-dropdown-link {
+        cursor: pointer;
+        color: #409eff;
+    }
+    .el-icon-arrow-down {
+        font-size: 12px;
+    }
+}
+.operate-item {
+    cursor: pointer;
+    color: #85ce61;
+    .el-icon-download {
+        float: right;
+        font-size: 16px;
+        color: #409eff;
     }
+}
 </style>

+ 25 - 36
src/views/scientificPayoffs/index.vue

@@ -27,7 +27,7 @@
                 <scientificBoxVue class="contentBorderBox" :bottomBorder="false" v-if="indexData == 1 && SCIwztjbDataShow && SCIwztjbListShow" :listShow="SCIwztjbListShow" :dataShow="SCIwztjbDataShow" :dataItem="SCIwztjbData"></scientificBoxVue>
                 <scientificBoxVue class="contentBorderBox" v-if="indexData == 2 && zwlwListShow && zwlwDataShow" :listShow="zwlwListShow" :dataShow="zwlwDataShow" :dataItem="zwlwData"></scientificBoxVue>
                 <scientificBoxVue class="contentBorderBox" :bottomBorder="false" v-if="indexData == 2 && zhuZuoListShow && zhuZuoDataShow" :listShow="zhuZuoListShow" :dataShow="zhuZuoDataShow" :dataItem="zhuZuoData"></scientificBoxVue>
-                <scientificBoxVue class="contentBorderBox"  v-if="indexData == 3 && zhuanLiListShow && zhuanLiDataShow" :listShow="zhuanLiListShow" :dataShow="zhuanLiDataShow" :dataItem="zhuanLiData"></scientificBoxVue>
+                <scientificBoxVue class="contentBorderBox" v-if="indexData == 3 && zhuanLiListShow && zhuanLiDataShow" :listShow="zhuanLiListShow" :dataShow="zhuanLiDataShow" :dataItem="zhuanLiData"></scientificBoxVue>
                 <scientificBoxVue class="contentBorderBox" :bottomBorder="false" v-if="indexData == 3 && jxjyxmxshdListShow && jxjyxmxshdDataShow" :listShow="jxjyxmxshdListShow" :dataShow="jxjyxmxshdDataShow" :dataItem="jxjyxmxshdData"></scientificBoxVue>
 
                 <scientificBoxVue class="contentBorderBox" :bottomBorder="false" v-if="indexData == 4 && kjhjcgDataShow && kjhjcgListShow" :listShow="kjhjcgListShow" :dataShow="kjhjcgDataShow" :dataItem="kjhjcgData"></scientificBoxVue>
@@ -83,8 +83,7 @@ export default {
                 dataCount: {},
                 config: {
                     header: '',
-                    data: [],
-
+                    data: []
                 }
             },
 
@@ -135,6 +134,8 @@ export default {
                     data: []
                 }
             },
+
+            likeParams: "ie.STATUS_= 'actived' and ie.ID_ != '1' and ie.ID_ != '-1' and ie.ID_ != '702117247933480960' and ie.ID_ != '1115242459127873536' and ie.ID_ != '1115242765924433920' and ie.GROUP_ID_ not like '%1041786072788369408%' GROUP BY ie.id_"
         }
     },
     created() {
@@ -147,7 +148,6 @@ export default {
             this.getInit()
         }, 600000)
         this.getCreate()
-
     },
     beforeDestroy() {
         if (screenfull.isFullscreen) {
@@ -155,7 +155,6 @@ export default {
         }
         clearInterval(this.timer)
         clearInterval(this.timer2)
-
     },
     methods: {
         //初始化数据
@@ -165,10 +164,10 @@ export default {
             this.month = month
             this.updateAll(month)
         },
-        getCreate(){
+        getCreate() {
             this.timer2 = setInterval(() => {
                 this.next()
-            }, 30000)  //180000
+            }, 10000) //180000
         },
         allView() {
             // 默认显示全屏
@@ -198,31 +197,29 @@ export default {
         },
         //时间
         updateAll(e) {
-            if(this.indexData == 1){
+            if (this.indexData == 1) {
                 this.getKyxmDataAndList(e)
                 this.getSCIwztjbDataAndList(e)
             }
-            if(this.indexData == 2){
+            if (this.indexData == 2) {
                 this.getZwlwDataAndList(e)
                 this.getZhuZuoDataAndList(e)
             }
-            if(this.indexData == 3){
+            if (this.indexData == 3) {
                 this.getZhuanLiDataAndList(e)
                 this.getJxjyxmxshdDataAndList(e)
             }
-            if(this.indexData == 4){
+            if (this.indexData == 4) {
                 this.getKjhjcgDataAndList(e)
-
             }
         },
 
         //接口
         //科研项目
         getKyxmDataAndList(month) {
-            // let sql1 = `select tk.*,ie.NAME_,tk2.xiang_mu_bian_hao as xiangMuBianHao from t_kyxm tk  left join t_kyxm tk2 on tk.xiang_mu_bian_hao = tk2.id_ left join ibps_party_employee ie on ie.ID_ = tk.xing_ming_ and ie.STATUS_= 'actived' and ie.ID_ != '1' and ie.ID_ != '-1' and ie.ID_ != '702117247933480960' and ie.ID_ not like '%1041786072788369408%' where tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' order by tk.create_time_ desc`
             let sql1 = `select * from t_kyxm where lei_xing_ = '统计' and create_time_ like '%${month}%' order by create_time_ desc`
-            let sql2 = `select ie.NAME_,count(tk.id_) as count from ibps_party_employee ie left join t_kyxm tk on ie.ID_ = tk.xing_ming_ and tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' where ie.STATUS_= 'actived' and ie.ID_ != '1' and ie.ID_ != '-1' and ie.ID_ != '702117247933480960' and ie.GROUP_ID_ not like '%1041786072788369408%' GROUP BY ie.id_`
-            Promise.all([curdPost('sql', sql1), curdPost('sql', sql2)]).then(([res1,res2]) => {
+            let sql2 = `select ie.NAME_,count(tk.id_) as count from ibps_party_employee ie left join t_kyxm tk on ie.ID_ = tk.xing_ming_ and tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' where ${this.likeParams}`
+            Promise.all([curdPost('sql', sql1), curdPost('sql', sql2)]).then(([res1, res2]) => {
                 if (res1.state == 200) {
                     let datas = res1.variables.data
                     let config = indexFile.getKyxmList(datas)
@@ -240,10 +237,9 @@ export default {
 
         //科技获奖成果
         getKjhjcgDataAndList(month) {
-            //let sql1 = `select tk.*,ie.NAME_,tk2.jiang_li_xiang_mu as jiangLiXiangMu  from t_kjhjcg tk left join t_kjhjcg tk2 on  tk.dan_wei_ = tk2.id_ left join ibps_party_employee ie on ie.ID_ = tk.xing_ming_ and ie.STATUS_= 'actived' and ie.ID_ != '1' and ie.ID_ != '-1' and ie.ID_ != '702117247933480960' and ie.ID_ not like '%1041786072788369408%' where tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' order by tk.create_time_ desc`
             let sql1 = `select * from t_kjhjcg where lei_xing_ = '统计' and create_time_ like '%${month}%' order by create_time_ desc`
-            let sql2 = `select ie.NAME_,count(tk.id_) as count from ibps_party_employee ie left join t_kjhjcg tk on ie.ID_ = tk.xing_ming_ and tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' where ie.STATUS_= 'actived' and ie.ID_ != '1' and ie.ID_ != '-1' and ie.ID_ != '702117247933480960' and ie.GROUP_ID_ not like '%1041786072788369408%' GROUP BY ie.id_`
-            Promise.all([curdPost('sql', sql1), curdPost('sql', sql2)]).then(([res1,res2]) => {
+            let sql2 = `select ie.NAME_,count(tk.id_) as count from ibps_party_employee ie left join t_kjhjcg tk on ie.ID_ = tk.xing_ming_ and tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' where ${this.likeParams}`
+            Promise.all([curdPost('sql', sql1), curdPost('sql', sql2)]).then(([res1, res2]) => {
                 if (res1.state == 200) {
                     let datas = res1.variables.data
                     let config = indexFile.getkjhjcgList(datas)
@@ -259,13 +255,11 @@ export default {
             })
         },
 
-
         //SCI文章统计表
         getSCIwztjbDataAndList(month) {
-            // let sql1 = `select tk.*,ie.NAME_,tk2.lun_wen_ti_mu_ as lunWenTiMu from t_SCIwztjb tk  left join t_SCIwztjb tk2 on  tk.lun_wen_ti_mu_ = tk2.id_ left join ibps_party_employee ie on ie.ID_ = tk.xing_ming_ and ie.STATUS_= 'actived' and ie.ID_ != '1' and ie.ID_ != '-1' and ie.ID_ != '702117247933480960' and ie.ID_ not like '%1041786072788369408%' where tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' order by tk.create_time_ desc`
             let sql1 = `select * from t_SCIwztjb where lei_xing_ = '统计' and create_time_ like '%${month}%' order by create_time_ desc`
-            let sql2 = `select ie.NAME_,count(tk.id_) as count from ibps_party_employee ie left join t_SCIwztjb tk on ie.ID_ = tk.xing_ming_ and tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' where ie.STATUS_= 'actived' and ie.ID_ != '1' and ie.ID_ != '-1' and ie.ID_ != '702117247933480960' and ie.GROUP_ID_ not like '%1041786072788369408%' GROUP BY ie.id_`
-            Promise.all([curdPost('sql', sql1), curdPost('sql', sql2)]).then(([res1,res2]) => {
+            let sql2 = `select ie.NAME_,count(tk.id_) as count from ibps_party_employee ie left join t_SCIwztjb tk on ie.ID_ = tk.xing_ming_ and tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' where ${this.likeParams}`
+            Promise.all([curdPost('sql', sql1), curdPost('sql', sql2)]).then(([res1, res2]) => {
                 if (res1.state == 200) {
                     let datas = res1.variables.data
                     let config = indexFile.getSCIwztjbList(datas)
@@ -283,10 +277,9 @@ export default {
 
         //中文论文
         getZwlwDataAndList(month) {
-            //let sql1 = `select tk.*,ie.NAME_,tk2.lun_wen_ti_mu_ as lunWenTiMu from t_zwlw tk left join t_zwlw tk2 on  tk.lun_wen_ti_mu_ = tk2.id_ left join ibps_party_employee ie on ie.ID_ = tk.xing_ming_ and ie.STATUS_= 'actived' and ie.ID_ != '1' and ie.ID_ != '-1' and ie.ID_ != '702117247933480960' and ie.ID_ not like '%1041786072788369408%' where tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' order by tk.create_time_ desc`
             let sql1 = `select * from t_zwlw where lei_xing_ = '统计' and create_time_ like '%${month}%' order by create_time_ desc`
-            let sql2 = `select ie.NAME_,count(tk.id_) as count from ibps_party_employee ie left join t_zwlw tk on ie.ID_ = tk.xing_ming_ and tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' where ie.STATUS_= 'actived' and ie.ID_ != '1' and ie.ID_ != '-1' and ie.ID_ != '702117247933480960' and ie.GROUP_ID_ not like '%1041786072788369408%' GROUP BY ie.id_`
-            Promise.all([curdPost('sql', sql1), curdPost('sql', sql2)]).then(([res1,res2]) => {
+            let sql2 = `select ie.NAME_,count(tk.id_) as count from ibps_party_employee ie left join t_zwlw tk on ie.ID_ = tk.xing_ming_ and tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' where ${this.likeParams}`
+            Promise.all([curdPost('sql', sql1), curdPost('sql', sql2)]).then(([res1, res2]) => {
                 if (res1.state == 200) {
                     let datas = res1.variables.data
                     let config = indexFile.getZwlwList(datas)
@@ -302,13 +295,11 @@ export default {
             })
         },
 
-
         //著作
         getZhuZuoDataAndList(month) {
-            //let sql1 = `select tk.*,ie.NAME_,tk2.zhuan_zhuo_ming_c as zhuanZhuoMingCheng from t_zz tk left join t_zz tk2 on  tk.zhuan_zhuo_ming_c = tk2.id_ left join ibps_party_employee ie on ie.ID_ = tk.xing_ming_ and ie.STATUS_= 'actived' and ie.ID_ != '1' and ie.ID_ != '-1' and ie.ID_ != '702117247933480960' and ie.ID_ not like '%1041786072788369408%' where tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' order by tk.create_time_ desc`
             let sql1 = `select * from t_zz where lei_xing_ = '统计' and create_time_ like '%${month}%' order by create_time_ desc`
-            let sql2 = `select ie.NAME_,count(tk.id_) as count from ibps_party_employee ie left join t_zz tk on ie.ID_ = tk.xing_ming_ and tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' where ie.STATUS_= 'actived' and ie.ID_ != '1' and ie.ID_ != '-1' and ie.ID_ != '702117247933480960' and ie.GROUP_ID_ not like '%1041786072788369408%' GROUP BY ie.id_`
-            Promise.all([curdPost('sql', sql1), curdPost('sql', sql2)]).then(([res1,res2]) => {
+            let sql2 = `select ie.NAME_,count(tk.id_) as count from ibps_party_employee ie left join t_zz tk on ie.ID_ = tk.xing_ming_ and tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' where ${this.likeParams}`
+            Promise.all([curdPost('sql', sql1), curdPost('sql', sql2)]).then(([res1, res2]) => {
                 if (res1.state == 200) {
                     let datas = res1.variables.data
                     let config = indexFile.getZhuZuoList(datas)
@@ -326,10 +317,9 @@ export default {
 
         //专利
         getZhuanLiDataAndList(month) {
-            //let sql1 = `select tk.*,ie.NAME_,tk2.zhuan_li_ming_che as zhuanLiMingCheng from t_zl tk left join t_zl tk2 on  tk.zhuan_li_ming_che = tk2.id_ left join ibps_party_employee ie on ie.ID_ = tk.xing_ming_ and ie.STATUS_= 'actived' and ie.ID_ != '1' and ie.ID_ != '-1' and ie.ID_ != '702117247933480960' and ie.ID_ not like '%1041786072788369408%' where tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' order by tk.create_time_ desc`
             let sql1 = `select * from t_zl where lei_xing_ = '统计' and create_time_ like '%${month}%' order by create_time_ desc`
-            let sql2 = `select ie.NAME_,count(tk.id_) as count from ibps_party_employee ie left join t_zl tk on ie.ID_ = tk.xing_ming_ and tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' where ie.STATUS_= 'actived' and ie.ID_ != '1' and ie.ID_ != '-1' and ie.ID_ != '702117247933480960' and ie.GROUP_ID_ not like '%1041786072788369408%' GROUP BY ie.id_`
-            Promise.all([curdPost('sql', sql1), curdPost('sql', sql2)]).then(([res1,res2]) => {
+            let sql2 = `select ie.NAME_,count(tk.id_) as count from ibps_party_employee ie left join t_zl tk on ie.ID_ = tk.xing_ming_ and tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' where ${this.likeParams}`
+            Promise.all([curdPost('sql', sql1), curdPost('sql', sql2)]).then(([res1, res2]) => {
                 if (res1.state == 200) {
                     let datas = res1.variables.data
                     let config = indexFile.getZhuanLiList(datas)
@@ -347,10 +337,9 @@ export default {
 
         //继续教育项目/学术活动
         getJxjyxmxshdDataAndList(month) {
-            //let sql1 = `select tk.*,ie.NAME_,tk2.xiang_mu_bian_hao as xiangmMuBianHao from t_jxjyxmxshd tk left join t_jxjyxmxshd tk2 on  tk.xiang_mu_bian_hao = tk2.id_  left join ibps_party_employee ie on ie.ID_ = tk.xing_ming_ and ie.STATUS_= 'actived' and ie.ID_ != '1' and ie.ID_ != '-1' and ie.ID_ != '702117247933480960' and ie.ID_ not like '%1041786072788369408%' where tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' order by tk.create_time_ desc`
             let sql1 = `select * from t_jxjyxmxshd where lei_xing_ = '统计' and create_time_ like '%${month}%' order by create_time_ desc`
-            let sql2 = `select ie.NAME_,count(tk.id_) as count from ibps_party_employee ie left join t_jxjyxmxshd tk on ie.ID_ = tk.xing_ming_ and tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' where ie.STATUS_= 'actived' and ie.ID_ != '1' and ie.ID_ != '-1' and ie.ID_ != '702117247933480960' and ie.GROUP_ID_ not like '%1041786072788369408%' GROUP BY ie.id_`
-            Promise.all([curdPost('sql', sql1), curdPost('sql', sql2)]).then(([res1,res2]) => {
+            let sql2 = `select ie.NAME_,count(tk.id_) as count from ibps_party_employee ie left join t_jxjyxmxshd tk on ie.ID_ = tk.xing_ming_ and tk.lei_xing_ = '个人' and tk.create_time_ like '%${month}%' where ${this.likeParams}`
+            Promise.all([curdPost('sql', sql1), curdPost('sql', sql2)]).then(([res1, res2]) => {
                 if (res1.state == 200) {
                     let datas = res1.variables.data
                     let config = indexFile.getJxjyxmxshdList(datas)
@@ -364,7 +353,7 @@ export default {
                     this.jxjyxmxshdDataShow = true
                 }
             })
-        },
+        }
     }
 }
 </script>

+ 11 - 6
src/views/statistics/index.vue

@@ -33,14 +33,19 @@
             line-height: 2.825rem;
             text-align:center;
             float: left;
-            margin: -3% 0 0 3%;
-            color: #000 !important;" >
+            margin: -3% 0 0 16%;
+            color: #fff !important;
+            display:flex" >
+            <div>
+              年份:
+            </div>
             <el-date-picker
               v-model="endDate"
               type="year"
               value-format="yyyy"
               @change="checkYear(endDate,'end')"
-              placeholder="选择年">
+              placeholder="选择年"
+              style="width:54%">
             </el-date-picker>
             <!-- <el-button type="primary" size="mini" plain @click="selectAll">
               查询
@@ -70,7 +75,7 @@
             line-height: 2.825rem;
             text-align:center;
             float: right;
-            margin: -3% 12% 0 0;" 
+            margin: -3% 17.1% 0 0;" 
             v-if="rollup">
             <dv-border-box-8>暂停</dv-border-box-8>
           </div>
@@ -81,7 +86,7 @@
             line-height: 2.825rem;
             text-align:center;
             float: right;
-            margin: -3% 12% 0 0;" 
+            margin: -3% 17.1% 0 0;" 
             v-else>
             <dv-border-box-8>继续</dv-border-box-8>
           </div>
@@ -92,7 +97,7 @@
             line-height: 2.825rem;
             text-align:center;
             float: right;
-            margin: -3% 3% 0 0;" >
+            margin: -3% 8.1% 0 0;" >
             <dv-border-box-8>返回</dv-border-box-8>
           </div>
           

+ 119 - 59
src/views/system/jbdHome/board/checkBoard.vue

@@ -4,23 +4,25 @@
             <!-- 头部内容 -->
             <div :class="$style.header">
                 <dv-decoration-8 :class="$style.left" />
-                <dv-decoration-5 :class="$style.center" />
+                <dv-decoration-5 :class="$style.center" :dur="5"/>
                 <dv-decoration-8 :class="$style.right" :reverse="true" />
                 <div :class="$style.title">{{ titleName }}</div>
                 <div :class="$style.time">
-                    <span>月份:</span>
-                    <el-date-picker
-                        v-model="month"
-                        type="month"
-                        value-format="yyyy-MM"
-                        format="yyyy-MM"
-                        placeholder="日期选择"
-                        style="width: 120px"
-                        :readonly="false"
-                        :editable="true"
-                        :clearable="false"
-                        @change="updateAll"
-                    />
+                    <!-- <span>月份:</span> -->
+                    <dv-border-box-8>
+                        <el-date-picker
+                            v-model="month"
+                            type="month"
+                            value-format="yyyy-MM"
+                            format="yyyy-MM"
+                            placeholder="日期选择"
+                            style="width: 120px"
+                            :readonly="false"
+                            :editable="true"
+                            :clearable="false"
+                            @change="updateAll"
+                        />
+                    </dv-border-box-8>
                 </div>
                 <div :class="$style.back" @click.prevent="goBack()">
                     <dv-border-box-8>返回</dv-border-box-8>
@@ -28,9 +30,9 @@
             </div>
             <dv-border-box-1>
                 <!-- topBar -->
-                <top-bar v-if="topBarData.length" :info="topBarData" />
+                <top-bar v-if="topBarData.length" :info="topBarData" :color="colors"/>
                 <!-- middleCard -->
-                <middle-card v-if="middleCardData.flag" :info="middleCardData" />
+                <middle-card v-if="middleCardData.flag" :info="middleCardData" :list="tableData"/>
                 <!-- bottomCard -->
                 <bottom-card v-if="bottomCardData.flag" :info="bottomCardData" />
             </dv-border-box-1>
@@ -40,7 +42,7 @@
 <script>
     import screenfull from 'screenfull'
     import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
-    import { acceptList } from './data.js'
+    import { colors, getRandomColor } from './data.js'
     export default {
         name: 'checkBoard',
         components: {
@@ -55,23 +57,23 @@
                 year: d.toJSON().slice(0, 4),
                 month: d.toJSON().slice(0, 7),
                 today: d.toJSON().slice(0, 10),
-                label: ['委托', '受理', '任务发放', '报告'],
+                colors: [],
                 topBarData: [],
+                tableData: {
+                    header: [
+                        '检测项目',
+                        '送检时间',
+                        '完成时间',
+                        // '状态',
+                        '检测员'
+                    ],
+                    data: [],
+                    rowNum: 7,
+                    // columnWidth: ['300','100','150','150','100']
+                    columnWidth: ['350','100','100','90'],
+                    waitTime: 1500
+                },
                 middleCardData: {
-                    tableData: {
-                        header: [
-                            '检测项目',
-                            '送检时间',
-                            '完成时间',
-                            // '状态',
-                            '检测员'
-                        ],
-                        data: [],
-                        rowNum: 7,
-                        // columnWidth: ['300','100','150','150','100']
-                        columnWidth: ['400','150','150','100'],
-                        waitTime: 1500
-                    },
                     acceptData:[],
                     taskData: [],
                     flag: false
@@ -95,15 +97,21 @@
                 this.allView()
             }
 
-            this.updateAll()
-
-            if (this.timer){
-                clearInterval(this.timer)
-            }
-
-            this.timer = setInterval(() => {
+            const sql = 'select lei_xing_ming_che from t_lhjclx'
+            curdPost('sql', sql).then(res => {
+                const { data = [] } = res.variables || {}
+                this.acceptList = data.map(i => i.lei_xing_ming_che)
                 this.updateAll()
-            },10 * 1000)
+    
+                if (this.timer){
+                    clearInterval(this.timer)
+                }
+                
+    
+                this.timer = setInterval(() => {
+                    this.updateAll()
+                }, 1000 * 30)
+            })
         },
         beforeDestroy() {
             if (screenfull.isFullscreen) {
@@ -120,6 +128,7 @@
                 this.$router.back(-1)
             },
             updateAll(e) {
+                this.colors = [...colors].sort(() => Math.random() - 0.5)
                 this.getTopBarData()
                 this.getMiddleData()
                 this.getBottomData()
@@ -137,7 +146,7 @@
                 // 获取委托数及受理数
                 const sql = `select wt.month as month, wt.accepted as accepted, wt2.today as today, wt2.week as week, wt2.quarter as quarter, jc.total as jcTotal, jc.finished as jcFinish, rw.task as task, rw.finished as rwFinish, bg.report as report, bg.process as process, bg.approval as approval, bg.finished as bgFinish
                 from
-                (select count(id_) as month, count(wei_tuo_zhuang_ta = '已结束' or null) as accepted from t_lhwtsqb where create_time_ LIKE '${this.month}%') wt,
+                (select count(id_) as month, count(wei_tuo_zhuang_ta = '已结束' or wei_tuo_zhuang_ta = '已完成' or null) as accepted from t_lhwtsqb where create_time_ LIKE '${this.month}%') wt,
                 (select count(create_time_ like '${this.today}' or null) as today, count(create_time_ between '${week.start}' and '${week.end}' or null) as week, count(create_time_ between '${quarter.start}' and '${quarter.end}' or null) as quarter from t_lhwtsqb) wt2,
                 (select count(id_) as total, count(zhuang_tai_ = '已完成' or null) as finished from t_lhjczb where create_time_ LIKE '${this.month}%') jc,
                 (select count(id_) as task, count(zhuang_tai_ = '已完成' or null) as finished from t_lhrwfpb where create_time_ LIKE '${this.month}%') rw,
@@ -171,10 +180,11 @@
                                         value: today
                                     },
                                     {
-                                        label: '受理',
+                                        label: '本月受理',
                                         value: accepted
                                     }
-                                ]
+                                ],
+                                unit: '单'
                             },
                             {
                                 title: '任务分配',
@@ -191,7 +201,8 @@
                                         label: '未完成',
                                         value: task - rwFinish
                                     }
-                                ]
+                                ],
+                                unit: '件'
                             },
                             {
                                 title: '检测',
@@ -208,7 +219,8 @@
                                         label: '未完成',
                                         value: jcTotal - jcFinish
                                     }
-                                ]
+                                ],
+                                unit: '项'
                             },
                             {
                                 title: '报告',
@@ -229,7 +241,8 @@
                                         label: '待审核',
                                         value: process
                                     }
-                                ]
+                                ],
+                                unit: '份'
                             }
                         ]
                         
@@ -244,11 +257,11 @@
                 // 获取检测数据
                 // const sql1 = `select tm.jian_ce_xiang_mu_, tm.jian_ce_lei_bie_, IFNULL(rw.qi_wang_wan_cheng, '') as qi_wang_wan_cheng, rw.zhuang_tai_, ipe.NAME_ from t_rwfpb rw, ibps_party_employee ipe, t_mjjcnlfw tm where rw.jian_ce_yuan_ = ipe.ID_ and rw.jian_ce_xiang_mu_ = tm.id_ and rw.create_time_ like '${this.month}%'`
                 // const sql1 = `select tm.jian_ce_xiang_mu_, tm.jian_ce_lei_bie_, IFNULL(rwz.create_time_, '') as qi_wang_wan_cheng, rw.zhuang_tai_, ipe.NAME_ from t_lhrwfpb rw, ibps_party_employee ipe, t_mjjcnlfw tm, t_mjrwfpzb rwz where rwz.jian_ce_yuan_ = ipe.ID_ and rwz.jian_ce_xiang_mu_ = tm.id_ and rw.id_ = rwz.wai_jian_ and rw.create_time_ like '${this.month}%'`
-                const sql1 = `select tm.jian_ce_xiang_mu_, IFNULL(jc.wan_cheng_shi_jia, '') as wan_cheng_shi_jia, IFNULL(jc.fu_he_ri_qi_, '') as fu_he_ri_qi_, ipe.NAME_ from ibps_party_employee ipe, t_mjjcnlfw tm, t_lhjczb jc where jc.jian_ce_yuan_ = ipe.ID_ and jc.jian_ce_xiang_mu_ = tm.id_ and jc.zhuang_tai_ = '已完成' and jc.create_time_ like '${this.month}%' order by jc.create_time_ desc`
+                const sql1 = `select tm.jian_ce_xiang_mu_, IFNULL(jc.wan_cheng_shi_jia, '') as startDate, IFNULL(jc.fu_he_ri_qi_, '') as endDate, ipe.NAME_ as names from ibps_party_employee ipe, t_mjjcnlfw tm, t_lhjczb jc where jc.jian_ce_yuan_ = ipe.ID_ and jc.jian_ce_xiang_mu_ = tm.id_ and jc.zhuang_tai_ = '已完成' and jc.create_time_ like '${this.month}%' order by jc.create_time_ desc`
                 // 获取检测受理类型数据
                 let sqlStr = ''
-                acceptList.forEach((item, index) => {
-                    sqlStr += `count(tm.jian_ce_lei_bie_ = '${item}' or null) as r${index}${index === acceptList.length - 1 ? '' : ', '}`
+                this.acceptList.forEach((item, index) => {
+                    sqlStr += `count(tm.jian_ce_lei_bie_ = '${item}' or null) as r${index}${index === this.acceptList.length - 1 ? '' : ', '}`
                 })
                 const sql2 = `select ${sqlStr} from t_lhjczb tj, t_mjjcnlfw tm where tj.jian_ce_xiang_mu_ = tm.id_ and tj.create_time_ like '${this.month}%'`
                 // console.log(sqlStr, sql2)
@@ -261,21 +274,29 @@
                     const data2 = res2.variables.data
                     // console.log(data1, data2)
 
-                    this.middleCardData.tableData.data = []
+                    this.tableData.data = []
                     data1.forEach(item => {
-                        this.middleCardData.tableData.data.push(Object.values(item))
+                        item.startDate = item.startDate ? item.startDate.slice(0, 10) : ''
+                        item.endDate = item.endDate ? item.endDate.slice(0, 10) : ''
+                        item.names = item.names ? this.replaceSecondLetter(item.names) : ''
+                        this.tableData.data.push(Object.values(item))
                     })
 
                     let result = []
                     let tempRes = Object.values(data2[0])
-                    acceptList.forEach((item, index) => {
+                    this.acceptList.forEach((item, index) => {
                         let o = {
                             name: item,
                             value: tempRes[index] ? tempRes[index] : null
                         }
                         result.push(o)
                     })
-                    this.middleCardData.acceptData = result
+		            // 对数据进行排序
+                    result.sort((a, b) => b.value - a.value)
+                    // 根据排序后数据重新生成图例
+                    const newRes = result.slice(0, 12).map(i => i.name)
+                    this.middleCardData.config = this.getOptions(newRes)
+                    this.middleCardData.acceptData = result.slice(0, 12)
                     this.middleCardData.flag = true
                 }).catch(error => {
                     console.log(error)
@@ -298,10 +319,10 @@
                     curdPost('sql', sql4)
                 ]).then(([ res1, res2, res3, res4]) => {
                     this.bottomCardData.flag = false
-                    const data1 = res1.variables.data
-                    const data2 = res2.variables.data
-                    const data3 = res3.variables.data
-                    const data4 = res4.variables.data
+                    const data1 = res1.variables.data || []
+                    const data2 = res2.variables.data || []
+                    const data3 = res3.variables.data || []
+                    const data4 = res4.variables.data || []
                     // console.log(data1, data2, data3, data4)
 
                     let trust = new Array(12).fill(0)
@@ -351,10 +372,13 @@
             // 获取本周和本季度的开始和结束日期,以对象形式返回
             getDateRange(type) {
                 let current = new Date()
-                if (type !== 'week' && type !== 'quarter') {
+                if (!['year', 'quarter', 'week'].includes(type)) {
                     console.log('type is error')
                     return
                 }
+                if (type === 'year') { 
+                    return current.getFullYear()
+                }
                 if (type === 'quarter') {
                     let year = current.getFullYear()
                     let month = current.getMonth()
@@ -387,6 +411,33 @@
                     week.end = new Date((temp / 1000 + 6 * 86400) * 1000).toJSON().slice(0, 10)
                     return week
                 }
+            },
+            // 隐藏人员名字
+            replaceSecondLetter (name) {
+                if (!name || name.length < 2) {
+                    return name
+                }
+                const [firstLetter, secondLetter, ...rest] = name
+                return `${firstLetter}*${rest.join('')}`
+            },
+            getOptions (data) {
+                let res = {
+                    option: [],
+                    colorList: []
+                }
+                const colorGenerator = getRandomColor(this.colors)
+                data.forEach(item => {
+                    let color = colorGenerator.next().value
+                    let obj = {
+                        name: item,
+                        textStyle: {
+                            color
+                        }
+                    }
+                    res.option.push(obj)
+                    res.colorList.push(color)
+                })
+                return res
             }
         }
     }
@@ -473,8 +524,17 @@
             .time {
                 display: flex;
                 justify-content: flex-end;
-                width: 20%;
+                // width: 20%;
                 right: 75%;
+		        :global {
+                    .el-input--small .el-input__inner {
+                        width: 100% !important;
+                        background: rgba(255, 255, 255, 0);
+                        border: none;
+                        color: #fff;
+                        font-size: 16px;
+                    }
+                }
             }
             .back {
                 left: 75%;

+ 26 - 2
src/views/system/jbdHome/board/component/middleCard.vue

@@ -21,7 +21,7 @@
                     :config="tableData"
                     style="width: 100%; height: 100%"
                 />
-                <div v-else :class="$style.no_data">本月暂无已完成的检测项目数据</div>
+                <div v-else :class="$style.no_data">当前月份暂无已完成的检测项目数据</div>
             </div>
         </div>
         <dv-decoration-10 :dur="15"/>
@@ -36,6 +36,10 @@
             info: {
                 type: Object,
                 default: {}
+            },
+            list: {
+                type: Object,
+                default: {}
             }
         },
         components: {},
@@ -45,6 +49,19 @@
                     this.init()
                 },
                 deep: true
+            },
+            list: {
+                handler(value) {
+                    console.log(value)
+                    if ((!this.tableData.data || (value.data.length !== this.tableData.data.length))) {
+                        if (this.tableData.data) {
+                            console.log(value.data.length, this.tableData.data.length)
+                        }
+                        this.tableData = JSON.parse(JSON.stringify(value))
+                    }
+                },
+                immediate: true,
+                deep: true
             }
         },
         data() {
@@ -65,8 +82,10 @@
                 
                 // 设置图表数据
                 acceptOption.series[0].data = this.info.acceptData
+                acceptOption.legend.data = this.info.config.option
+                acceptOption.color = this.info.config.colorList
                 taskOption.series[0].data = this.info.taskData
-                this.tableData = JSON.parse(JSON.stringify(this.info.tableData))
+                // this.tableData = JSON.parse(JSON.stringify(this.tableData))
 
                 //渲染
                 accept.setOption(acceptOption)
@@ -94,6 +113,11 @@
                 text-align: center;
                 margin-top: 20px;
             }
+            :global {
+                .header {
+                    background-color: #08153e !important;
+                }
+            }
         }
     }
     :global {

+ 11 - 27
src/views/system/jbdHome/board/component/topBar.vue

@@ -27,54 +27,38 @@
     </div>
 </template>
 <script>
+    import { getRandomColor } from '../data.js'
     export default {
         name: 'topBar',
         props: {
             info: {
                 type: Array,
                 default: []
+            },
+            color: {
+                type: Array,
+                default: []
             }
         },
         components: {},
         watch: {
             info(v) {
-                console.log(v)
                 this.update()
             }
         },
         data() {
             return {
-                topBarData: [],
-                fontColor: [
-                    '#d20962',
-                    '#f47721',
-                    '#7ac143',
-                    '#00a78e',
-                    '#00bce4',
-                    '#7d3f98',
-                    '#037ef3',
-                    '#f85a40',
-                    '#00c16e',
-                    '#ffd900',
-                    '#0cb9c1',
-                    '#7552cc'
-                ]
+                topBarData: []
             }
         },
         created() {
             this.update()
         },
         methods: {
-            //随机颜色
-            getRandom(minNum, maxNum) {
-                if (arguments.length === 1) {
-                    return parseInt(Math.random() * minNum + 1, 10)
-                } else {
-                    return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10)
-                }
-            },
             // 数据更新
             update() {
+                const fontColor = [...this.color].sort(() => Math.random() - 0.5)
+                const colorGenerator = getRandomColor(fontColor)
                 this.info.forEach(item => {
                     item.children.forEach(i => {
                         i.data = {
@@ -82,11 +66,11 @@
                             content: '{nt}',
                             textAlign: 'right',
                             style: {
-                                fill: this.fontColor[this.getRandom(0, 11)],
+                                fill: colorGenerator.next().value,
                                 fontWeight: 'bold'
                             }
                         }
-                        i.unit = '件'
+                        i.unit = item.unit
                     })
                 })
                 this.topBarData = JSON.parse(JSON.stringify(this.info))
@@ -124,7 +108,7 @@
             }
             .title {
                 text-align: center;
-                font-size: 18px;
+                font-size: 20px;
                 font-weight: bold;
                 margin-bottom: 20px;
             }

+ 34 - 46
src/views/system/jbdHome/board/data.js

@@ -39,6 +39,9 @@ export const acceptOption1 = {
         left: '50%',
         top: '20px'
     },
+    grid: {
+        top: '80px'
+    },
     xAxis: {
         type: 'category',
         data: ['理化', '微生物', '细胞活率', '残留检测', '细胞鉴别'],
@@ -125,30 +128,7 @@ export const acceptOption1 = {
     }
 }
 
-export const acceptList = [
-    '无菌检查',
-    '支原体检查',
-    '内毒素',
-    '细胞计数与活率',
-    '免疫评估',
-    '细胞标志蛋白检测',
-    '干细胞三项诱导分化',
-    '细胞外源病毒因子检测',
-    '干细胞生物学效力检测',
-    'CAR-T',
-    '残留物检测',
-    '干细胞成瘤性检测',
-    '干细胞的免疫学反应检测',
-    '核型分析',
-    '细胞形态',
-    '感染八项',
-    '衣原体检查',
-    '结核杆菌',
-    '新项目与方法',
-    '基础科研'
-]
-
-const colors = [
+export const colors = [
     '#d20962',
     '#f47721',
     '#7ac143',
@@ -158,30 +138,23 @@ const colors = [
     '#037ef3',
     '#f85a40',
     '#00c16e',
-    '#ffd900',
-    '#0cb9c1',
-    '#7552cc'
+    '#12CBC4',
+    '#b4a996',
+    '#7552cc',
+    '#67809f',
+    '#f19066'
 ]
 
-let colorList = []
-
-const getOptions = () => {
-    let res = []
-    colorList = []
-    acceptList.forEach(item => {
-        let random =  parseInt(Math.random() * 12)
-        let obj = {
-            name: item,
-            textStyle: {
-                color: colors[random]
-            }
-        }
-        res.push(obj)
-        colorList.push(colors[random])
-    })
-    return res
+export function* getRandomColor (shuffledColors) {
+    let index = 0
+    while (index < shuffledColors.length) {
+        yield shuffledColors[index]
+        index++
+    }
 }
 
+let colorList = []
+
 export const acceptOption = {
     title: {
         show: true,
@@ -202,12 +175,18 @@ export const acceptOption = {
         // left: 'center',
         // bottom: 10,
         right: 10,
-        top: 50,
+        formatter (params) {
+            let l = 7
+            if (params.length > l) {
+                return params.substring(0, l) + '\n' + params.substring(l)
+            }
+            return params
+        },
         z: 3,
         itemWidth: 25,
         itemHeight: 14,
         itemGap: 10,
-        data: getOptions()
+        data: []
     },
     series: [
         {
@@ -373,6 +352,9 @@ export const trustOption = {
         left: '50%',
         top: '20px'
     },
+    grid: {
+        top: '80px'
+    },
     xAxis: {
         type: 'category',
         data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
@@ -493,6 +475,9 @@ export const sampleOption = {
         left: '50%',
         top: '20px'
     },
+    grid: {
+        top: '80px'
+    },
     xAxis: {
         type: 'category',
         data: ['已委托未收样', '已收样', '已收不合格', '留样'],
@@ -590,6 +575,9 @@ export const monthOption = {
         left: '50%',
         top: '20px'
     },
+    grid: {
+        top: '80px'
+    },
     xAxis: {
         type: 'category',
         data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],

+ 2 - 2
src/views/system/jbdScan/goods/liuyangData.vue

@@ -197,9 +197,9 @@ export default {
   methods: {
     
     clearPosition(){
-        console.log('start')
+        // console.log('start')
         this.placeValue = null
-        console.log('end...'+this.placeValue)
+        // console.log('end...'+this.placeValue)
     },
     positionBtn() {
       this.loadQueryData();

+ 24 - 26
src/views/system/jbdScan/goods/manualConfirmation.vue

@@ -37,17 +37,17 @@
                             <el-row>
                                 <el-col :span="6">
                                     <el-form-item label="样品编号">
-                                        <el-input v-model="item.yang_pin_bian_hao" readonly="true"></el-input>
+                                        <el-input v-model="item.yang_pin_bian_hao"  readonly></el-input>
                                     </el-form-item>
                                 </el-col>
                                 <el-col :span="6">
                                     <el-form-item label="样品名称">
-                                        <el-input v-model="item.yang_pin_ming_che" readonly="true"></el-input>
+                                        <el-input v-model="item.yang_pin_ming_che"  readonly></el-input>
                                     </el-form-item>
                                 </el-col>
                                 <el-col :span="6">
                                     <el-form-item label="样品总数">
-                                        <el-input v-model="item.yang_pin_zong_shu" readonly="true"></el-input>
+                                        <el-input v-model="item.yang_pin_zong_shu"  readonly></el-input>
                                     </el-form-item>
                                 </el-col>
                                 <el-col :span="6">
@@ -83,7 +83,6 @@
 
                                     <el-col :span="8">
                                         <el-form-item label="样品运输条件(一)">
-                                            <!-- <el-input v-model="item.yang_ben_yun_shu_" ></el-input> -->
                                             <template slot-scope="scope">
                                                 <el-select v-model="item.yang_ben_yun_shu_" placeholder="请选择" filterable
                                                     allow-create>
@@ -157,9 +156,9 @@
                                     <el-col :span="8">
                                         <el-form-item label="留样存放位置(一)" required>
                                             <template slot-scope="scope">
-                                                <!-- <liuyangData v-model="item.liu_yang_wei_zhi_yi" ref="LyPositionOne"  /> -->
                                                 <liuyangData v-model="item.liu_yang_wei_zhi_yi" ref="LyPositionOne"  v-if="item.liu_yang_shu_lian_yi" />
-                                                <el-input v-model="item.liu_yang_shu_lian_yi" v-if="!item.liu_yang_shu_lian_yi" :disabled="true"></el-input>
+                                                <el-input v-if="!item.liu_yang_shu_lian_yi" :disabled="true">
+                                                </el-input>
                                             </template>
                                         </el-form-item>
                                     </el-col>
@@ -258,9 +257,8 @@
                                     <el-col :span="8">
                                         <el-form-item label="留样存放位置(二)" required>
                                             <template slot-scope="scope">
-                                                <!-- <liuyangData v-model="item.liu_yang_wei_zhi_er" ref="LyPositionTwo" /> -->
-                                                <liuyangData v-model="item.liu_yang_wei_zhi_yi" ref="LyPositionOne"  v-if="item.liu_yang_shu_lian_er" />
-                                                <el-input v-model="item.liu_yang_shu_lian_yi" v-if="!item.liu_yang_shu_lian_er" :disabled="true"></el-input>
+                                                <liuyangData v-model="item.liu_yang_wei_zhi_er" ref="LyPositionTwo"  v-if="item.liu_yang_shu_lian_er" />
+                                                <el-input  v-if="!item.liu_yang_shu_lian_er" :disabled="true"></el-input>
                                             </template>
                                         </el-form-item>
                                     </el-col>
@@ -360,9 +358,9 @@
                                     <el-col :span="8">
                                         <el-form-item label="留样存放位置(三)" required>
                                             <template slot-scope="scope">
-                                                <!-- <liuyangData v-model="item.liu_yang_wei_zhi_san" ref="LyPositionThree" /> -->
-                                                <liuyangData v-model="item.liu_yang_wei_zhi_yi" ref="LyPositionOne"  v-if="item.liu_yang_shu_lian_san" />
-                                                <el-input v-model="item.liu_yang_shu_lian_yi" v-if="!item.liu_yang_shu_lian_san" :disabled="true"></el-input>
+                                                <liuyangData v-model="item.liu_yang_wei_zhi_san" ref="LyPositionThree" 
+                                                 v-if="item.liu_yang_shu_lian_san" />
+                                                <el-input  v-if="!item.liu_yang_shu_lian_san" :disabled="true"></el-input>
                                             </template>
                                         </el-form-item>
                                     </el-col>
@@ -462,9 +460,9 @@
                                     <el-col :span="8">
                                         <el-form-item label="留样存放位置(四)" required>
                                             <template slot-scope="scope">
-                                                <!-- <liuyangData v-model="item.liu_yang_wei_zhi_si" ref="LyPositionFour" /> -->
-                                                <liuyangData v-model="item.liu_yang_wei_zhi_yi" ref="LyPositionOne"  v-if="item.liu_yang_shu_lian_si" />
-                                                <el-input v-model="item.liu_yang_shu_lian_yi" v-if="!item.liu_yang_shu_lian_si" :disabled="true"></el-input>
+                                                <liuyangData v-model="item.liu_yang_wei_zhi_si" ref="LyPositionFour"
+                                                  v-if="item.liu_yang_shu_lian_si" />
+                                                <el-input v-if="!item.liu_yang_shu_lian_si" :disabled="true"></el-input>
                                             </template>
                                         </el-form-item>
                                     </el-col>
@@ -484,7 +482,7 @@
                                         <template slot-scope="scope">
                                             <el-date-picker v-model="item.liu_yang_ri_qi_" type="date"
                                                 value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="请选择"
-                                                :readonly="false" :clearable="true" @change="liuyanRiQiChange(item, index)" />
+                                                :clearable="true" @change="liuyanRiQiChange(item, index)" />
                                         </template>
                                     </el-form-item>
                                 </el-col>
@@ -493,7 +491,7 @@
                                         <template slot-scope="scope">
                                             <el-date-picker v-model="item.liu_yang_qi_xian" type="date"
                                                 value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="请选择"
-                                                :readonly="false" :clearable="true" />
+                                                :clearable="true" />
                                         </template>
                                     </el-form-item>
                                 </el-col>
@@ -516,7 +514,7 @@
                                         <template slot-scope="scope">
                                             <el-date-picker v-model="item.fan_yang_ri_qi_" type="date"
                                                 value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="请选择"
-                                                :readonly="false" :clearable="true" />
+                                                :clearable="true" />
                                         </template>
                                     </el-form-item>
                                 </el-col>
@@ -524,14 +522,14 @@
                                     <el-form-item label="返样接样人">
                                         <template slot-scope="scope">
                                             <el-input v-model="item.fan_yang_jyr" placeholder="请输入" type="text"
-                                                :readonly="false" clearable />
+                                            clearable />
                                         </template>
                                     </el-form-item>
                                 </el-col>
 
                                 <el-col :span="8">
                                     <el-form-item label="是否加急">
-                                        <el-input v-model="item.chu_ju_bao_gao_ya" readonly="true" ></el-input>
+                                        <el-input v-model="item.chu_ju_bao_gao_ya"  readonly ></el-input>
                                     </el-form-item>
                                 </el-col>
                                
@@ -542,7 +540,7 @@
                                     <el-form-item label="姓名">
                                         <template slot-scope="scope">
                                             <el-input v-model="item.xing_ming_" placeholder="请输入" type="text"
-                                                :readonly="false" clearable />
+                                                clearable />
                                         </template>
                                     </el-form-item>
                                 </el-col>
@@ -561,7 +559,7 @@
                                     <el-form-item label="年龄">
                                         <template slot-scope="scope">
                                             <el-input v-model="item.nian_ling_" placeholder="请输入" type="text"
-                                                :readonly="false" clearable />
+                                                clearable />
                                         </template>
                                     </el-form-item>
                                 </el-col>
@@ -572,8 +570,8 @@
                                 <el-col :span="8">
                                     <el-form-item label="备注">
                                         <template slot-scope="scope">
-                                            <el-input v-model="item.bei_zhu_" placeholder="请输入" type="text"
-                                                :readonly="false" clearable />
+                                            <el-input v-model="item.bei_zhu_1_" placeholder="请输入" type="text"
+                                                 clearable />
                                         </template>
                                     </el-form-item>
                                 </el-col>
@@ -581,7 +579,7 @@
                                     <el-form-item label="送样要求">
                                         <template slot-scope="scope">
                                             <el-input v-model="item.song_yang_yao_qiu" placeholder="请输入" type="text"
-                                                :readonly="false" clearable />
+                                                 clearable />
                                         </template>
                                     </el-form-item>
                                 </el-col>
@@ -772,7 +770,7 @@ export default {
             let item = this.listData[index]
             let ifLYArgs = ['shi_fou_liu_yang_yi','shi_fou_liu_yang_er','shi_fou_liu_yang_san','shi_fou_liu_yang_si']
             let LYShuLiangArgs = ['liu_yang_shu_lian_yi','liu_yang_shu_lian_er','liu_yang_shu_lian_san','liu_yang_shu_lian_si']
-            let positionArgs = ['LyPositionOne','LyPositionTwo','LyPositionThree','LyPositionThree']
+            let positionArgs = ['LyPositionOne','LyPositionTwo','LyPositionThree','LyPositionFour']
             if (item[ifLYArgs[LYIndex]] == '否') {
                 item[LYShuLiangArgs[LYIndex]] = null
                 this.$refs[positionArgs[LYIndex]][0].clearPosition()

+ 29 - 23
src/views/system/jbdScan/goods/sampleConfirmation.vue

@@ -37,17 +37,17 @@
                             <el-row>
                                 <el-col :span="6">
                                     <el-form-item label="样品编号">
-                                        <el-input v-model="item.yang_pin_bian_hao" readonly="true"></el-input>
+                                        <el-input v-model="item.yang_pin_bian_hao"  readonly></el-input>
                                     </el-form-item>
                                 </el-col>
                                 <el-col :span="6">
                                     <el-form-item label="样品名称">
-                                        <el-input v-model="item.yang_pin_ming_che" readonly="true"></el-input>
+                                        <el-input v-model="item.yang_pin_ming_che"  readonly></el-input>
                                     </el-form-item>
                                 </el-col>
                                 <el-col :span="6">
                                     <el-form-item label="样品总数">
-                                        <el-input v-model="item.yang_pin_zong_shu" readonly="true"></el-input>
+                                        <el-input v-model="item.yang_pin_zong_shu"  readonly></el-input>
                                     </el-form-item>
                                 </el-col>
                                 <el-col :span="6">
@@ -83,7 +83,6 @@
 
                                     <el-col :span="8">
                                         <el-form-item label="样品运输条件(一)">
-                                            <!-- <el-input v-model="item.yang_ben_yun_shu_" ></el-input> -->
                                             <template slot-scope="scope">
                                                 <el-select v-model="item.yang_ben_yun_shu_" placeholder="请选择" filterable
                                                     allow-create>
@@ -150,14 +149,16 @@
                                     <el-col :span="8">
                                         <el-form-item label="留样数量(一)" required class="zzj">
                                             <template slot-scope="scope">
-                                                <el-input v-model="item.liu_yang_shu_lian_yi"></el-input>
+                                                <el-input v-model="item.liu_yang_shu_lian_yi" :disabled=!item.liu_yang_shu_lian_yi ></el-input>
                                             </template>
                                         </el-form-item>
                                     </el-col>
                                     <el-col :span="8">
                                         <el-form-item label="留样存放位置(一)" required>
                                             <template slot-scope="scope">
-                                                <liuyangData v-model="item.liu_yang_wei_zhi_yi" ref="LyPositionOne" />
+                                                <liuyangData v-model="item.liu_yang_wei_zhi_yi" ref="LyPositionOne"  v-if="item.liu_yang_shu_lian_yi" />
+                                                <el-input v-if="!item.liu_yang_shu_lian_yi" :disabled="true">
+                                                </el-input>
                                             </template>
                                         </el-form-item>
                                     </el-col>
@@ -249,14 +250,15 @@
                                     <el-col :span="8">
                                         <el-form-item label="留样数量(二)" required class="zzj">
                                             <template slot-scope="scope">
-                                                <el-input v-model="item.liu_yang_shu_lian_er"></el-input>
+                                                <el-input v-model="item.liu_yang_shu_lian_er" :disabled=!item.liu_yang_shu_lian_er></el-input>
                                             </template>
                                         </el-form-item>
                                     </el-col>
                                     <el-col :span="8">
                                         <el-form-item label="留样存放位置(二)" required>
                                             <template slot-scope="scope">
-                                                <liuyangData v-model="item.liu_yang_wei_zhi_er" ref="LyPositionTwo" />
+                                                <liuyangData v-model="item.liu_yang_wei_zhi_er" ref="LyPositionTwo"  v-if="item.liu_yang_shu_lian_er" />
+                                                <el-input  v-if="!item.liu_yang_shu_lian_er" :disabled="true"></el-input>
                                             </template>
                                         </el-form-item>
                                     </el-col>
@@ -349,14 +351,16 @@
                                     <el-col :span="8">
                                         <el-form-item label="留样数量(三)" required class="zzj">
                                             <template slot-scope="scope">
-                                                <el-input v-model="item.liu_yang_shu_lian_san"></el-input>
+                                                <el-input v-model="item.liu_yang_shu_lian_san" :disabled=!item.liu_yang_shu_lian_san></el-input>
                                             </template>
                                         </el-form-item>
                                     </el-col>
                                     <el-col :span="8">
                                         <el-form-item label="留样存放位置(三)" required>
                                             <template slot-scope="scope">
-                                                <liuyangData v-model="item.liu_yang_wei_zhi_san" ref="LyPositionThree" />
+                                                <liuyangData v-model="item.liu_yang_wei_zhi_san" ref="LyPositionThree" 
+                                                 v-if="item.liu_yang_shu_lian_san" />
+                                                <el-input  v-if="!item.liu_yang_shu_lian_san" :disabled="true"></el-input>
                                             </template>
                                         </el-form-item>
                                     </el-col>
@@ -449,14 +453,16 @@
                                     <el-col :span="8">
                                         <el-form-item label="留样数量(四)" required class="zzj">
                                             <template slot-scope="scope">
-                                                <el-input v-model="item.liu_yang_shu_lian_si"></el-input>
+                                                <el-input v-model="item.liu_yang_shu_lian_si" :disabled=!item.liu_yang_shu_lian_si></el-input>
                                             </template>
                                         </el-form-item>
                                     </el-col>
                                     <el-col :span="8">
                                         <el-form-item label="留样存放位置(四)" required>
                                             <template slot-scope="scope">
-                                                <liuyangData v-model="item.liu_yang_wei_zhi_si" ref="LyPositionFour" />
+                                                <liuyangData v-model="item.liu_yang_wei_zhi_si" ref="LyPositionFour"
+                                                  v-if="item.liu_yang_shu_lian_si" />
+                                                <el-input v-if="!item.liu_yang_shu_lian_si" :disabled="true"></el-input>
                                             </template>
                                         </el-form-item>
                                     </el-col>
@@ -476,7 +482,7 @@
                                         <template slot-scope="scope">
                                             <el-date-picker v-model="item.liu_yang_ri_qi_" type="date"
                                                 value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="请选择"
-                                                :readonly="false" :clearable="true" @change="liuyanRiQiChange(item, index)" />
+                                                 :clearable="true" @change="liuyanRiQiChange(item, index)" />
                                         </template>
                                     </el-form-item>
                                 </el-col>
@@ -485,7 +491,7 @@
                                         <template slot-scope="scope">
                                             <el-date-picker v-model="item.liu_yang_qi_xian" type="date"
                                                 value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="请选择"
-                                                :readonly="false" :clearable="true" />
+                                                 :clearable="true" />
                                         </template>
                                     </el-form-item>
                                 </el-col>
@@ -508,7 +514,7 @@
                                         <template slot-scope="scope">
                                             <el-date-picker v-model="item.fan_yang_ri_qi_" type="date"
                                                 value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="请选择"
-                                                :readonly="false" :clearable="true" />
+                                                 :clearable="true" />
                                         </template>
                                     </el-form-item>
                                 </el-col>
@@ -516,14 +522,14 @@
                                     <el-form-item label="返样接样人">
                                         <template slot-scope="scope">
                                             <el-input v-model="item.fan_yang_jyr" placeholder="请输入" type="text"
-                                                :readonly="false" clearable />
+                                                 clearable />
                                         </template>
                                     </el-form-item>
                                 </el-col>
 
                                 <el-col :span="8">
                                     <el-form-item label="是否加急">
-                                        <el-input v-model="item.chu_ju_bao_gao_ya" readonly="true" ></el-input>
+                                        <el-input v-model="item.chu_ju_bao_gao_ya"  readonly ></el-input>
                                     </el-form-item>
                                 </el-col>
                                
@@ -534,7 +540,7 @@
                                     <el-form-item label="姓名">
                                         <template slot-scope="scope">
                                             <el-input v-model="item.xing_ming_" placeholder="请输入" type="text"
-                                                :readonly="false" clearable />
+                                                 clearable />
                                         </template>
                                     </el-form-item>
                                 </el-col>
@@ -553,7 +559,7 @@
                                     <el-form-item label="年龄">
                                         <template slot-scope="scope">
                                             <el-input v-model="item.nian_ling_" placeholder="请输入" type="text"
-                                                :readonly="false" clearable />
+                                                 clearable />
                                         </template>
                                     </el-form-item>
                                 </el-col>
@@ -564,8 +570,8 @@
                                 <el-col :span="8">
                                     <el-form-item label="备注">
                                         <template slot-scope="scope">
-                                            <el-input v-model="item.bei_zhu_" placeholder="请输入" type="text"
-                                                :readonly="false" clearable />
+                                            <el-input v-model="item.bei_zhu_1_" placeholder="请输入" type="text"
+                                                 clearable />
                                         </template>
                                     </el-form-item>
                                 </el-col>
@@ -573,7 +579,7 @@
                                     <el-form-item label="送样要求">
                                         <template slot-scope="scope">
                                             <el-input v-model="item.song_yang_yao_qiu" placeholder="请输入" type="text"
-                                                :readonly="false" clearable />
+                                                 clearable />
                                         </template>
                                     </el-form-item>
                                 </el-col>
@@ -754,7 +760,7 @@ export default {
             let item = this.listData[index]
             let ifLYArgs = ['shi_fou_liu_yang_yi','shi_fou_liu_yang_er','shi_fou_liu_yang_san','shi_fou_liu_yang_si']
             let LYShuLiangArgs = ['liu_yang_shu_lian_yi','liu_yang_shu_lian_er','liu_yang_shu_lian_san','liu_yang_shu_lian_si']
-            let positionArgs = ['LyPositionOne','LyPositionTwo','LyPositionThree','LyPositionThree']
+            let positionArgs = ['LyPositionOne','LyPositionTwo','LyPositionThree','LyPositionFour']
             if (item[ifLYArgs[LYIndex]] == '否') {
                 item[LYShuLiangArgs[LYIndex]] = null
                 this.$refs[positionArgs[LYIndex]][0].clearPosition()

+ 1 - 1
src/views/system/jbdScan/goods/tag.vue

@@ -148,7 +148,7 @@ export default {
     },
     getLook(id) {
       // let sql = `select * from t_lhypb where find_in_set(id_,'${id}')`
-      let sql = `select ypb.*,	djb.shou_yang_ri_qi_ FROM	t_lhypb ypb left outer JOIN t_lhypdjb djb ON djb.yang_ben_bian_hao = ypb.yang_pin_bian_hao 	where find_in_set( ypb.id_, '${id}' )`
+      let sql = `select distinct ypb.*,	djb.shou_yang_ri_qi_ FROM	t_lhypb ypb left outer JOIN t_lhypdjb djb ON djb.yang_ben_bian_hao = ypb.yang_pin_bian_hao 	where find_in_set( ypb.id_, '${id}' )`
       // let sql = `select * from t_lhypdjb where find_in_set(id_,'${id}')`
       // console.log(sql)
       repostCurd("sql", sql).then(res => {

+ 14 - 2
src/views/system/jbdScan/js/manualConfirmationJS.js

@@ -89,6 +89,12 @@ export default {
                         item.yang_pin_lei_si_ ? this.$set(item, 'flag4', true) : this.$set(item, 'flag4', false)
                         item.liu_yang_qi_xian = dayjs(item.song_jian_shi_jia).add(rq, 'month').format("YYYY-MM-DD")
                         // temp[i].xiao_hui_ri_qi_ = dayjs(temp[i].liu_yang_qi_xian).endOf('month').format("YYYY-MM-DD")
+                        
+                        item.dan_wei_yi = item.yang_pin_gui_ge_ ? this.handleSpecificationsToUnit(item.yang_pin_gui_ge_) : ''
+                        item.dan_wei_er = item.yang_pin_gui_ge_e ? this.handleSpecificationsToUnit(item.yang_pin_gui_ge_e) : ''
+                        item.dan_wei_san = item.yang_pin_gui_ge_s ? this.handleSpecificationsToUnit(item.yang_pin_gui_ge_s) : ''
+                        item.dan_wei_si = item.yang_pin_gui_si_ ? this.handleSpecificationsToUnit(item.yang_pin_gui_si_) : ''
+
                     })
                     this.listData = temp
                 } else {
@@ -139,6 +145,11 @@ export default {
                         item.yang_pin_lei_san_ ? this.$set(item, 'flag3', true) : this.$set(item, 'flag3', false)
                         item.yang_pin_lei_si_ ? this.$set(item, 'flag4', true) : this.$set(item, 'flag4', false)
                         item.liu_yang_qi_xian = dayjs(item.song_jian_shi_jia).add(rq, 'month').format("YYYY-MM-DD")
+
+                        item.dan_wei_yi = item.yang_pin_gui_ge_ ? this.handleSpecificationsToUnit(item.yang_pin_gui_ge_) : ''
+                        item.dan_wei_er = item.yang_pin_gui_ge_e ? this.handleSpecificationsToUnit(item.yang_pin_gui_ge_e) : ''
+                        item.dan_wei_san = item.yang_pin_gui_ge_s ? this.handleSpecificationsToUnit(item.yang_pin_gui_ge_s) : ''
+                        item.dan_wei_si = item.yang_pin_gui_si_ ? this.handleSpecificationsToUnit(item.yang_pin_gui_si_) : ''
                     })
                     this.listData = temp
                 } else {
@@ -418,7 +429,8 @@ export default {
                                 yang_pin_gui_si_: ypInfoList[yp].yang_pin_gui_si_,
 
                                 jie_yang_zhuang_t:"已接收",
-                                yang_pin_zong_shu:ypInfoList[yp].yang_pin_zong_shu
+                                yang_pin_zong_shu:ypInfoList[yp].yang_pin_zong_shu,
+                                bei_zhu_1_:ypInfoList[yp].bei_zhu_1_
                             }
                         }
                         sampleList.push(o)
@@ -601,7 +613,7 @@ export default {
                                                 nian_ling_: ypInfoList[index].nian_ling_=== undefined?'':ypInfoList[index].nian_ling_,
                                                 yang_ben_zhuang_t: item.yang_pin_zhuang_t,
                                                 shou_yang_ri_qi_: currentTime,
-                                                bei_zhu_: ypInfoList[index].bei_zhu_ === undefined?'':ypInfoList[index].bei_zhu_,
+                                                bei_zhu_: ypInfoList[index].bei_zhu_1_ === undefined?'':ypInfoList[index].bei_zhu_1_,
                                                 yang_ben_lei_xing: yblx,
                                                 yun_shu_tiao_jian: ystj,
                                                 yang_pin_shu_lian: ypsl,

+ 7 - 2
src/views/system/jbdScan/js/sampleConfirmationJS.js

@@ -102,6 +102,10 @@ export default {
                             item.yang_pin_lei_san_ ? this.$set(item, 'flag3', true) : this.$set(item, 'flag3', false)
                             item.yang_pin_lei_si_ ? this.$set(item, 'flag4', true) : this.$set(item, 'flag4', false)
                             item.liu_yang_qi_xian = dayjs(item.song_jian_shi_jia).add(rq, 'month').format("YYYY-MM-DD")
+                            item.dan_wei_yi = item.yang_pin_gui_ge_ ? this.handleSpecificationsToUnit(item.yang_pin_gui_ge_) : ''
+                            item.dan_wei_er = item.yang_pin_gui_ge_e ? this.handleSpecificationsToUnit(item.yang_pin_gui_ge_e) : ''
+                            item.dan_wei_san = item.yang_pin_gui_ge_s ? this.handleSpecificationsToUnit(item.yang_pin_gui_ge_s) : ''
+                            item.dan_wei_si = item.yang_pin_gui_si_ ? this.handleSpecificationsToUnit(item.yang_pin_gui_si_) : ''
                         })
                         this.listData.push(temp[0])
                         // console.log(this.listData)
@@ -345,7 +349,8 @@ export default {
                                 yang_pin_gui_si_: ypInfoList[yp].yang_pin_gui_si_,
 
                                 jie_yang_zhuang_t:"已接收",
-                                yang_pin_zong_shu:ypInfoList[yp].yang_pin_zong_shu
+                                yang_pin_zong_shu:ypInfoList[yp].yang_pin_zong_shu,
+                                bei_zhu_1_:ypInfoList[yp].bei_zhu_1_
                             }
                         }
                         sampleList.push(o)
@@ -528,7 +533,7 @@ export default {
                                                 nian_ling_: ypInfoList[index].nian_ling_=== undefined?'':ypInfoList[index].nian_ling_,
                                                 yang_ben_zhuang_t: item.yang_pin_zhuang_t,
                                                 shou_yang_ri_qi_: currentTime,
-                                                bei_zhu_: ypInfoList[index].bei_zhu_ === undefined?'':ypInfoList[index].bei_zhu_,
+                                                bei_zhu_: ypInfoList[index].bei_zhu_1_ === undefined?'':ypInfoList[index].bei_zhu_1_,
                                                 yang_ben_lei_xing: yblx,
                                                 yun_shu_tiao_jian: ystj,
                                                 yang_pin_shu_lian: ypsl,