lxp
2024-08-12 14b15cb429be4c2cf9d7372afcd3bf1e6c53d6af
src/components/view/b1-inspect-order-plan.vue
@@ -200,10 +200,16 @@
         </span>
      </el-dialog>
      <div style="width: 100%;height: 100%;" v-if="activeFace >0">
         <Add :active="activeFace" :currentId="currentId"/>
         <Add :active="activeFace" :currentId="currentId" :examine="examine"/>
      </div>
    <Inspection v-if="state>0" @goback="goback" :orderId="orderId" :sonLaboratory="componentData.entity.sonLaboratory" :state="state"/>
   </div>
    <Inspection v-if="state>0" @goback="goback" :orderId="orderId" :inspectorList="inspectorList" :sonLaboratory="componentData.entity.sonLaboratory" :state="state"/>
      <el-dialog title="数据查看" :visible.sync="dataDialogVisible" width="80%">
            <div style="height: 70vh;overflow-y: auto;" v-if="dataDialogVisible">
               <ValueTable ref="ValueTableDataLook" :url="$api.insOrder.selectSampleAndProductByOrderId"
                  :componentData="componentDataDataLook"/>
            </div>
         </el-dialog>
  </div>
</template>
<script>
@@ -213,6 +219,7 @@
      getYearAndMonthAndDays
   } from '../../util/date'
   import Add from '../do/b1-ins-order/add.vue'
import { CellGroup } from 'iview'
   export default {
      components: {
         ValueTable,
@@ -221,6 +228,8 @@
      },
      data() {
         return {
            examine: null,
        inspectorList: [],//检验人员列表
            alone: false,
            sampleUserForm: {
               entrustCode: null,
@@ -231,6 +240,55 @@
            tabList: [],
            active: 1,
            tabIndex: 0,
        componentDataDataLook: {
               entity: {
                  id: 0,
                  orderBy: {
                     field: 'sampleCode',
                     order: 'asc'
                  }
               },
               isIndex: false,
               showSelect: false,
               select: false,
               do: [],
               tagField: {
                  insState: {
                     select: []
                  },
                  insResult: {
                     select: [{
                        value: 1,
                        label: '合格',
                        type: 'success'
                     },{
                        value: 0,
                        label: '不合格',
                        type: 'danger'
                     }]
                  }
               },
               selectField: {},
          spanConfig:{
            rows:[
              {
                name:'sampleCode',
                index:0
              },
              {
                name:'sample',
                index:1
              },
              {
                name:'model',
                index:5
              }
            ]
          },
               requiredAdd: [],
               requiredUp: []
            },
        dataDialogVisible: false,
            componentData: {
               entity: {
                  sonLaboratory: null,
@@ -243,12 +301,25 @@
               init: false,
          needSort: ['createTime', 'sendTime', 'type', 'appointed', 'insState'],
               do: [{
                  id: '',
                  font: '数据查看',
                  type: 'text',
                  method: 'handleDataLook',
            //disabFun: (row, index) => {
              //const user = JSON.parse(localStorage.getItem('user'))
             // let currentUserName = ''
             // if(user){
              //  currentUserName = user.name
              //}
                     //return row.userName.indexOf(currentUserName)<0 && row.checkName.indexOf(currentUserName)<0
                  //}
               },{
                     id: '',
                     font: '检验',
                     type: 'text',
                     method: 'handleInspection',
                     disabFun: (row, index) => {
                        return row.userId == null || row.insState == 3 || row.insState == 5||JSON.parse(localStorage.getItem("user")).name != row.userName
                        return row.userName == null || row.insState == 3 || row.insState == 5||(row.userName&&!row.userName.includes(JSON.parse(localStorage.getItem("user")).name))
                     }
              // disabFun: (row, index) => {
                     //    return row.userId == null || row.insState == 3 || row.insState == 5
@@ -259,7 +330,7 @@
                     type: 'text',
                     method: 'handleConnect',
                     disabFun: (row, index) => {
                        return row.userId == null || row.orderUserId == null || row.insState == 5  || row.insState == 3||JSON.parse(localStorage.getItem("user")).name != row.userName
                        return row.userName == null || row.insState == 5  || row.insState == 3||(row.userName&&!row.userName.includes(JSON.parse(localStorage.getItem("user")).name))
                     }
                  },
                  {
@@ -267,8 +338,8 @@
                     font: '复核',
                     type: 'text',
                     method: 'handleReview',
                     disabFun: (row, index) => {
                        return row.userId == null || row.insState != 3 ||JSON.parse(localStorage.getItem("user")).name != row.userName
                     disabFun: (row, userName) => {
                        return row.userName == null || row.insState != 3 ||(row.checkName&&!row.checkName.includes(JSON.parse(localStorage.getItem("user")).name))
                     }
                  }, {
                     id: '',
@@ -276,7 +347,7 @@
                     type: 'text',
                     method: 'claimFun',
                     disabFun: (row, index) => {
                        return row.userId != null
                        return row.userName != null || row.checkName!=null
                     }
                  }
               ],
@@ -343,6 +414,11 @@
      this.getPower()
      },
      methods: {
         // 数据查看
         handleDataLook(row) {
            this.componentDataDataLook.entity.id = row.id
            this.dataDialogVisible = true;
         },
      // 权限分配
         getPower(radio) {
            let power = JSON.parse(sessionStorage.getItem('power'))
@@ -506,6 +582,7 @@
         },
         selectAllByOne(row) {
            this.activeFace = 2;
            this.examine = 1;
            this.currentId = parseInt(row.id)
         },
         playOrder(num) {
@@ -516,6 +593,12 @@
            this.refreshTable('page')
         },
      handleInspection(row){
        //当前检验任务的检验人列表
        let inspectorList = []
        if(row.userName){
          inspectorList = row.userName.split(',')
        }
        this.inspectorList = inspectorList
        this.state = 1;
            this.orderId = row.id
      },