Fixiaobai
2023-08-23 0437b2c85145a67fc15dcd667d67027042a8b422
Merge branch 'master' of http://192.168.110.209:9001/r/lims-before
已修改8个文件
441 ■■■■■ 文件已修改
.env.development 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/App.vue 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/experiment/reportAuditing.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/url.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/util/requestUtil.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/experiment/inspectionApplication/index.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/experiment/planAssignments/plan.vue 299 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/experiment/reportAuditing/index.vue 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.development
@@ -2,4 +2,4 @@
ENV = 'development'
# base api
VUE_APP_BASE_API = 'http://192.168.110.254:1234/'
VUE_APP_BASE_API =  'http://localhost:1234/'
src/App.vue
@@ -48,6 +48,16 @@
        color: #fff;
    }
    
    .el-message-box{
        border: 0;
        border-radius: 15px;
    }
    .el-message-box__header * {
        font-size: 16px !important;
        color: #fff !important;
    }
    .el-dialog__headerbtn .el-dialog__close{
        color: #fff;
        top: -20px;
@@ -67,4 +77,20 @@
      box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
      padding: 0 14px;
    }
    .ins_state_success{
        background-color: #67c23a;
        color: #fff;
        display: initial;
        padding: 6px 10px;
        border-radius: 4px;
    }
    .ins_state_error{
        background-color: #f56c6c;
        color: #fff;
        display: initial;
        padding: 6px 10px;
        border-radius: 4px;
    }
</style>
src/api/experiment/reportAuditing.js
@@ -2,8 +2,17 @@
export function selectAllReportCheck(params) {
  return request({
    url: '/reportAuditing/selectAllReportAuditing',
    // url: '/reportAuditing/selectAllReportAuditing',
    url: '/report/selectAllReport',
    method: 'get',
    params
  })
}
// 审核
export function checkApi(params){
  return request({
    url: '/report/check',
    method: 'post',
    params
  })
}
src/api/url.js
@@ -1,4 +1,10 @@
const url = {
    "selectAllPlan": "/plan/selectAllPlan",//查询所有检验计划
    "choosecheck": "/plan/choosecheck",//分配--选择检验人
    "chooseinstum": "/plan/chooseinstum",//分配--选择设备
    "reported": "/plan/reported",//上报
    "distribution": "/plan/distribution",//分配
    "check": "/plan/check",//检验
}
export default function(Vue) {
src/api/util/requestUtil.js
@@ -15,6 +15,15 @@
        data
    })
}
export function wpost(path, params) {
    return request({
        url: path,
        method: 'post',
        params
    })
}
export function postFile(path, data) {
    return request({
        url: path,
src/views/experiment/inspectionApplication/index.vue
@@ -164,7 +164,7 @@
                <el-pagination
                  class="pagination"
                  :current-page="currentPage"
                  :page-sizes="[1, 10, 20, 30]"
                  :page-sizes="[ 10, 20, 30,40]"
                  :page-size="pageSize"
                  layout="total, sizes, prev, pager, next, jumper"
                  :total="total"
@@ -721,10 +721,10 @@
      this.total = this.inspectionTable.length
    },
    reset(){
      this.countSize = 1
      this.searchData = { }
      // console.log('2222');
      this.selectInspectsList()
      this.countSize = 1;
      this.pageSize = 8;
      this.searchData = { };
      this.selectInspectsList();
    },
    //被选中的信息 单选
    handleSelectionChange(val) {
src/views/experiment/planAssignments/plan.vue
@@ -17,11 +17,11 @@
        margin: 10px;
        padding: 15px;
        background-color: white;
        height: calc(100vh - 15vh);
        height: calc(100vh - 18vh);
        overflow-y: auto;
    }
    .order_num{
    .order_num {
        border-radius: 1rem;
        width: 35px;
        height: 25px;
@@ -56,41 +56,77 @@
            <el-button size="small">重置</el-button>
        </div>
        <div class="thing">
            <el-table :data="tableData" style="width: 100%;" row-key="id" default-expand-all
            <el-table :data="tableData" style="width: 100%;" row-key="code" default-expand-all
                :tree-props="{children: 'children', hasChildren: 'hasChildren'}" :key="upIndex">
                <el-table-column type="index" width="50" label="序号">
                </el-table-column>
                <el-table-column prop="date" label="申请单号">
                <el-table-column prop="code" label="申请单号" width="250px">
                    <template slot-scope="scope">
                        <div style="display: flex;">
                            <div v-if="scope.row.code=='01'" style="color: #3caaff;background-color: #eff5ff;" class="order_num">01</div>
                            <div v-else-if="scope.row.code=='02'" style="color: #57c981;background-color: #f1fbf4;" class="order_num">02</div>
                            <div v-else-if="scope.row.code=='03'" style="color: #dfa8fb;background-color: #faf2ff;" class="order_num">03</div>
                            <div>{{scope.row.date}}</div>
                            <div v-if="scope.row.orderNum=='01'" style="color: #3caaff;background-color: #eff5ff;" class="order_num">
                                01
                            </div>
                            <div v-else-if="scope.row.orderNum=='02'" style="color: #57c981;background-color: #f1fbf4;"
                                class="order_num">
                                02</div>
                            <div v-else-if="scope.row.orderNum=='03'" style="color: #dfa8fb;background-color: #faf2ff;"
                                class="order_num">
                                03</div>
                            <div>{{scope.row.code}}</div>
                        </div>
                    </template>
                </el-table-column>
                <el-table-column prop="name" label="检验结果">
                <el-table-column prop="name" label="名称" width="200px">
                </el-table-column>
                <el-table-column prop="address" label="地址">
                <el-table-column prop="unit" label="单位">
                </el-table-column>
                <el-table-column label="操作" width="80">
                <el-table-column prop="required" label="要求值">
                </el-table-column>
                <el-table-column prop="internal" label="内控值">
                </el-table-column>
                <el-table-column prop="testValue" label="检验值">
                </el-table-column>
                <el-table-column prop="checker" label="执行人">
                </el-table-column>
                <el-table-column prop="instrumentname" label="检验设备">
                </el-table-column>
                <el-table-column prop="testState" label="检验状态" width="100px">
                    <template slot-scope="scope">
                        <el-button size="mini" type="primary" v-if="isIfReport(scope.row)">上报</el-button>
                        <el-button size="mini" type="warning" @click="openUpDia(scope.row)"
                            v-else-if="scope.row.code=='03'&&scope.row.insId==undefined&&scope.row.address==null">分配</el-button>
                        <el-button size="mini" type="success" @click="openUpInsDia(scope.row)"
                            v-else-if="scope.row.code=='03'&&scope.row.insId==undefined&&scope.row.name==null">检验</el-button>
                        <el-tag type="success" v-if="scope.row.testState==1">合格</el-tag>
                        <el-tag type="danger" v-else-if="scope.row.testState==0">不合格</el-tag>
                    </template>
                </el-table-column>
                <el-table-column prop="startTime" label="检验开始" width="100px">
                </el-table-column>
                <el-table-column prop="endTime" label="检验结束" width="100px">
                </el-table-column>
                <el-table-column label="操作" width="150">
                    <template slot-scope="scope">
                        <el-button size="mini" type="primary" v-if="isIfReport(scope.row)"
                            @click="addReported(scope.row.id)">上报</el-button>
                        <el-button size="mini" type="text" @click="openUpDia(scope.row)"
                            v-if="scope.row.orderNum=='02'">分配</el-button>
                        <el-button size="mini" type="text" @click="openUpInsDia(scope.row)"
                            v-if="scope.row.orderNum=='02'">检验</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </div>
        <el-dialog title="分配设备和人员" :visible.sync="upDia" width="500px" top="30vh">
            <div class="body">
                <el-row style="line-height: 46px;">
                <el-row style="line-height: 50px;">
                    <el-col :span="4" style="font-size: 14px;text-align: right;">人员:</el-col>
                    <el-col :span="16" :offset="1">
                        <el-input v-model="upData.address" size="small" clearable></el-input>
                        <el-select v-model="upData.checker" size="medium" clearable style="width: 100%;">
                            <el-option v-for="(a, ai) in users" :key="ai" :label="a.name" :value="a.id"></el-option>
                        </el-select>
                    </el-col>
                </el-row>
                <el-row style="line-height: 50px;">
                    <el-col :span="4" style="font-size: 14px;text-align: right;">设备:</el-col>
                    <el-col :span="16" :offset="1">
                        <el-cascader v-model="upData.device" :options="devices" size="medium" style="width: 100%;" clearable
                            :props="{label: 'name',value: 'id',emitPath: false}" :show-all-levels="false"></el-cascader>
                    </el-col>
                </el-row>
            </div>
@@ -102,29 +138,37 @@
        <el-dialog title="检验" :visible.sync="upInsDia" width="500px">
            <div class="body" style="max-height: 50vh;overflow-y: auto;">
                <el-row style="line-height: 46px;">
                    <el-col :span="4" style="font-size: 14px;text-align: right;">样品编码:</el-col>
                    <el-col :span="8">{{upData.date}}</el-col>
                    <el-col :span="4" style="font-size: 14px;text-align: right;">样品名称:</el-col>
                    <el-col :span="8">{{upData.date}}</el-col>
                    <el-col :span="5" style="font-size: 14px;text-align: right;">申请单编码:</el-col>
                    <el-col :span="7">{{upData.insId}}</el-col>
                    <el-col :span="5" style="font-size: 14px;text-align: right;">样品名称:</el-col>
                    <el-col :span="7">{{upData.productName}}</el-col>
                </el-row>
                <el-row style="line-height: 46px;">
                    <el-col :span="4" style="font-size: 14px;text-align: right;">检验项目:</el-col>
                    <el-col :span="8">{{upData.date}}</el-col>
                    <el-col :span="4" style="font-size: 14px;text-align: right;">单位:</el-col>
                    <el-col :span="8">{{upData.date}}</el-col>
                    <el-col :span="5" style="font-size: 14px;text-align: right;">检验项目:</el-col>
                    <el-col :span="7">{{upData.name}}</el-col>
                    <el-col :span="5" style="font-size: 14px;text-align: right;">单位:</el-col>
                    <el-col :span="7">{{upData.unit}}</el-col>
                </el-row>
                <el-row style="line-height: 46px;">
                    <el-col :span="4" style="font-size: 14px;text-align: right;">标准值:</el-col>
                    <el-col :span="8">{{upData.date}}</el-col>
                    <el-col :span="4" style="font-size: 14px;text-align: right;">内控值:</el-col>
                    <el-col :span="8">{{upData.date}}</el-col>
                    <el-col :span="5" style="font-size: 14px;text-align: right;">标准值:</el-col>
                    <el-col :span="7">{{upData.required}}</el-col>
                    <el-col :span="5" style="font-size: 14px;text-align: right;">内控值:</el-col>
                    <el-col :span="7">{{upData.internal}}</el-col>
                </el-row>
                <el-row style="line-height: 46px;">
                    <el-col :span="5" style="font-size: 14px;text-align: right;">检验状态:</el-col>
                    <el-col :span="7">
                        <el-tag type="success" v-if="upData.testState==1">合格</el-tag>
                        <el-tag type="danger" v-else-if="upData.testState==0">不合格</el-tag>
                        <el-tag type="info" v-else>无结果</el-tag>
                    </el-col>
                </el-row>
                <el-row style="line-height: 46px;">
                    <el-col style="text-align: right;"><el-button size="mini" @click="addRes">添加检验值</el-button></el-col>
                </el-row>
                <el-row>
                    <el-col>
                        <el-table :data="upData.res" border style="width: 99.9%;" :key="upIndex2">
                        <el-table :data="upData.testValue" border style="width: 99.9%;" :key="upIndex2">
                            <el-table-column type="index" width="100" label="序号">
                            </el-table-column>
                            <el-table-column label="检验值">
@@ -137,7 +181,7 @@
                            <el-table-column label="操作" width="60">
                                <template slot-scope="scope">
                                    <el-button size="mini" type="text"
                                        @click.native.prevent="deleteRow(scope.$index, upData.res)">删除</el-button>
                                        @click.native.prevent="deleteRow(scope.$index, upData.testValue)">删除</el-button>
                                </template>
                            </el-table-column>
                        </el-table>
@@ -145,7 +189,7 @@
                </el-row>
            </div>
            <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="submitUpData">提 交</el-button>
                <el-button type="primary" @click="submitUpData2">提 交</el-button>
                <el-button @click="upInsDia = false">取 消</el-button>
            </span>
        </el-dialog>
@@ -153,6 +197,12 @@
</template>
<script>
    import {
        get,
        post,
        wpost,
        postFile
    } from "@/api/util/requestUtil.js"
    export default {
        data() {
            return {
@@ -161,125 +211,146 @@
                    date: [],
                    userName: null,
                },
                tableData: [{
                    id: 1,
                    insId: 123,
                    date: '2016-05-02',
                    name: null,
                    address: '上海市普陀区金沙江路 1518 弄',
                    children: [{
                        id: 33,
                        date: '2016-05-01',
                        name: null,
                        res: '[{"number": 1},{"number": 2}]',
                        address: '上海市普陀区金沙江路 1519 弄'
                    }, {
                        id: 34,
                        date: '2016-05-01',
                        name: null,
                        res: '[{"number": 1,"res": "不合格"},{"number": 3,"res": "不合格"}]',
                        address: '上海市普陀区金沙江路 1519 弄',
                        children: [{
                            id: 35,
                            date: 'hhh',
                            name: null,
                            res: '[{"number": 1},{"number": 2}]',
                            address: '上海市普陀区金沙江路 1519 弄'
                        }]
                    }]
                }, {
                    id: 2,
                    insId: 123,
                    date: '2016-05-04',
                    name: null,
                    address: '上海市普陀区金沙江路 1517 弄',
                    children: []
                }, {
                    id: 3,
                    insId: 123,
                    date: '2016-05-01',
                    children: [{
                        id: 31,
                        date: '2016-05-01',
                        name: null,
                        res: '[{"number": 1},{"number": 2}]',
                        address: '上海市普陀区金沙江路 1519 弄'
                    }, {
                        id: 32,
                        date: '2016-05-01',
                        name: null,
                        res: '[]',
                        address: null
                    }]
                }],
                tableData: [],
                upDia: false,
                upData: {},
                upIndex: 0,
                upInsDia: false,
                upIndex2: 0
                upIndex2: 0,
                users: [],
                devices: []
            }
        },
        mounted() {
            this.selectDataList()
            this.getUsers()
            this.getDevices()
        },
        methods: {
            selectDataList() {
                this.tableData.forEach(a => {
                    a.code = '01'
                    if (a.children != undefined) {
                        a.children.forEach(b => {
                            b.code = '02'
                            if (b.children != undefined) {
                                b.children.forEach(c => {
                                    c.code = '03'
                                    c.res = JSON.parse(c.res)
                                })
                            }
                        })
                    }
                get(this.$url.selectAllPlan).then(res => {
                    this.tableData = JSON.parse(JSON.stringify(res.data).replaceAll('pid', 'code').replaceAll('samplename',
                        'name').replaceAll('inspectionStatus', 'testState'))
                    this.tableData.forEach(a => {
                        a.orderNum = '01'
                        if (a.children != undefined) {
                            a.children.forEach(b => {
                                b.orderNum = '02'
                                if (b.testValue == undefined) {
                                    b.testValue = []
                                }
                            })
                        }
                    })
                    this.upIndex++
                })
                this.upIndex++
            },
            isIfReport(row) {
                var count = 0
                if (row.children == undefined) return false
                row.children.forEach(a => {
                    if (a.name != null && a.name != undefined) count++
                    if (a.testState != null && a.testState != undefined) count++
                })
                return row.insId != undefined && count == row.children.length
                return row.testState == undefined && row.orderNum == '01' && count == row
                    .children.length
            },
            openUpDia(row) {
                this.upDia = true
                this.upData = {
                    id: row.id,
                    address: row.address
                    id: row.code,
                    checker: null,
                    device: null
                }
            },
            submitUpData() {
                this.tableData.forEach(a => {
                    a.children.forEach(b => {
                        if (b.id == this.upData.id) {
                            b.address = this.upData.address
                        }
                    })
                if (this.upData.checker == null || this.upData.checker == '') {
                    this.$message.error('人员未分配')
                    return
                } else if (this.upData.device == null || this.upData.device == '') {
                    this.$message.error('设备未分配')
                    return
                }
                wpost(this.$url.distribution, {
                    id: this.upData.id,
                    userId: this.upData.checker,
                    instrumentId: this.upData.device
                }).then(res => {
                    this.$message.success('分配成功')
                    this.upDia = false
                    this.selectDataList()
                })
                this.$message.success('修改成功')
                this.upIndex++
                this.upDia = false
            },
            openUpInsDia(row) {
                this.upInsDia = true
                this.upData = this.HaveJson(row)
                var str = []
                JSON.parse('[' + this.upData.testValue + ']').forEach(a => {
                    str.push({
                        number: a
                    })
                })
                this.upData.testValue = this.HaveJson(str)
                this.tableData.forEach(a => {
                    a.children.forEach(b => {
                        if (b.code == this.upData.code) {
                            this.upData.insId = a.code
                            this.upData.productName = a.name
                        }
                    })
                })
            },
            deleteRow(index, rows) {
                rows.splice(index, 1);
            },
            addRes() {
                this.upData.res.push({
                this.upData.testValue.push({
                    "number": null
                })
                this.upIndex2++
            },
            getUsers() {
                get(this.$url.choosecheck).then(res => {
                    this.users = res.data
                })
            },
            getDevices() {
                get(this.$url.chooseinstum).then(res => {
                    this.devices = res.data
                })
            },
            addReported(id) {
                wpost(this.$url.reported, {
                    id: id
                }).then(res => {
                    this.$message.success('上报成功')
                    this.selectDataList()
                }).catch(e => {
                    this.$message.error('上报失败')
                })
            },
            submitUpData2() {
                var data = []
                this.upData.testValue.forEach(a => {
                    if(a.number!=''&&a.number!=null){
                        data.push(a.number)
                    }
                })
                wpost(this.$url.check, {
                    id: this.upData.code,
                    value: data.toString()
                }).then(res => {
                    this.upInsDia = false
                    this.selectDataList()
                    this.$confirm(`<p style="line-height: 80px">您的项目(${this.upData.name})检验结果为:<span class="${res.data==1?'ins_state_success':'ins_state_error'}">${res.data==1?'合格':'不合格'}</span></p>`, '提交成功', {
                        confirmButtonText: '确定',
                        cancelButtonText: '关闭',
                        dangerouslyUseHTMLString:true,
                        type: `${res.data==1?'success':'error'}`
                    }).then(() => {
                    }).catch(() => {
                    })
                })
            }
        }
    }
</script>
</script>
src/views/experiment/reportAuditing/index.vue
@@ -59,7 +59,11 @@
          :data="reportTable"
          style="width: 100%"
        >
          <el-table-column type="selection" label="" min-width="5%" />
        <el-table-column
          type="index"
          width="50">
        </el-table-column>
          <!-- <el-table-column  label="" min-width="5%" /> -->
          <el-table-column prop="materialCode" label="样品编号" min-width="10%">
            <template slot-scope="scope">
              <span style="color: #409eff">
@@ -79,7 +83,7 @@
            label="样品名称"
            min-width="10%"
          />
          <el-table-column prop="status" label="审批状态" min-width="8%">
          <el-table-column prop="status" label="审批状态" min-width="8%" v-model="Auditconclusion">
            <template slot-scope="scope">
              <span>
                <el-tag type="warning">{{
@@ -99,31 +103,23 @@
                @click="handleClick(scope.row)"
                >查看详细
              </el-button>
            <el-button  type="text" size="small" @click="checkskip = true">审核</el-button>
            <el-button  type="text" size="small" @click="shenHE(scope)">审核</el-button>
            <el-dialog
              title="原始记录审核"
              :visible.sync="checkskip"
              :visible.sync="checkskipvisible"
              width="30%"
              :before-close="handleClose">
              >
              <el-form :model="form">
                <el-form-item label="请选择审核结果" :label-width="formLabelWidth">
                <el-form-item label="请选择审核结果:" :label-width="formLabelWidth">
                </el-form-item>
                <el-row :gutter="20">
                  <el-col :span="6" :offset="5">
                <!-- <el-button type="primary" style="background-color: rgb(208, 201, 192);">退回</el-button> -->
                <el-button style="background-color: rgb(206, 211, 216);">退回</el-button>
                  </el-col>
                  <el-col :span="6" :offset="3">
                <!-- <el-button type="primary" style="background-color: rgb(181, 237, 125);">通过</el-button> -->
                <el-button style="background-color: rgb(192, 236, 148);">通过</el-button>
                  </el-col>
                </el-row>
              </el-form>
              <div slot="footer" class="dialog-footer">
                <el-button @click="checkskip = false">取 消</el-button>
                <el-button type="primary" @click="checkskip= false">确 定</el-button>
                <el-button @click="checkskipvisible = false">取 消</el-button>
                <el-button style="background-color: rgb(206, 211, 216);" @click="nocheckskip(scope.row)" >不通过</el-button>
                <el-button type="primary" @click="checkskip(scope.row)">通过</el-button>
              </div>
            </el-dialog>
@@ -148,27 +144,36 @@
</template>
<script>
import { selectAllReportCheck } from "@/api/experiment/reportAuditing";
import { selectAllReportCheck,checkApi } from "@/api/experiment/reportAuditing";
export default {
  data() {
    return {
      input: "",
      input: '',
      checkStatus: undefined,
      reportTable: [],
      page: 1,
      total: 0,
      pageSize: 10,
      checked: true,
      checkskip: false,
      checkskipvisible: false,
      form:{},
      handleClose:'',
      formLabelWidth: '120px'
      // handleClose:{},
      formLabelWidth: '120px',
      checked:{},
      usertt:[],
      Auditconclusion:{},
      tableRow: {},
    };
  },
  created() {
    this.getData();
  },
  methods: {
    shenHE(s){
      this.tableRow=s
      this.checkskipvisible=true
    },
    // 状态按钮
    handleRadioChange() {
      this.getData();
@@ -193,10 +198,27 @@
      this.checkStatus = undefined;
      this.getData();
    },
    //审核跳转
    // checkskip() {
    //通过
    async checkskip(row) {
      console.log(this.tableRow);
      this.reportTable[this.tableRow.$index].status=2
      this.transmitData(this.tableRow.row.id)
      this.checkskipvisible= false
    // },
    },
    //不通过
    async nocheckskip(row) {
      console.log(this.tableRow);
      this.reportTable[this.tableRow.$index].status=0
      this.transmitData(this.tableRow.row.id)
      this.checkskipvisible= false
    },
    //审核
    async transmitData(id) {
      let param={"id":id,"result":1}
     let data = await checkApi(param)
    },
    // 查询列表
    async getData() {
      const params = {