1.不合格处理:新增问题类型字段;2.班次:新增删除排班操作;3.检验任务:新增撤销委托订单操作
已修改5个文件
202 ■■■■ 文件已修改
src/api/performance/class.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/inspectionTask/index.vue 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/unpass/components/unPassDialog.vue 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/unpass/index-manage.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/performance/class/index.vue 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/performance/class.js
@@ -118,3 +118,12 @@
    params: query,
  });
}
// 删除排班数据
export function delShift(data) {
  return request({
    url: "/performanceShift/delShift",
    method: "delete",
    data: data,
  });
}
src/views/business/inspectionTask/index.vue
@@ -9,7 +9,7 @@
              <el-option label="KJNS" value="KJNS"/>
            </el-select>
          </el-form-item>
          <el-form-item label="批号" prop="updateBatchNo" v-if="tabIndex !== 0">
          <el-form-item label="批号" prop="updateBatchNo">
            <el-input v-model="queryParams.updateBatchNo" clearable placeholder="请输入" size="small"
              @keyup.enter.native="refreshTable()">
            </el-input>
@@ -25,7 +25,7 @@
            </el-select>
          </el-form-item>
          <el-form-item label="物料属性" prop="materialProp" v-if="tabIndex !== 0">
          <el-form-item label="物料属性" prop="materialProp" v-if="tabIndex !== -1">
            <el-select clearable size="small" v-model="queryParams.materialProp" style="width: 100%" @change="refreshTable()">
              <el-option v-for="dict in dict.type.material_prop_type" :key="dict.value" :label="dict.label"
                :value="dict.value">
@@ -33,7 +33,7 @@
            </el-select>
          </el-form-item>
          <el-form-item label=" 供应商名称" prop="supplierName" v-if="tabIndex === 2">
          <el-form-item label=" 供应商名称" prop="supplierName" v-if="tabIndex === 0">
                <el-input v-model="queryParams.supplierName" clearable placeholder="请输入" size="small"
                  @keyup.enter.native="goSearch">
                </el-input>
@@ -49,7 +49,7 @@
          <div style="display: flex; align-items: center">
            <span style="font-size: 14px">试验室种类:</span>
            <ul class="tab">
              <li v-for="(m, i) in tabList" :key="i" :class="{ active: i == tabIndex }" @click="handleTab(m, i)">
              <li v-for="(m, i) in tabList" :key="i" :class="{ active: m.value === tabIndex }" @click="handleTab(m, i)">
                {{ m.label.replace("试验室", "") }}
              </li>
            </ul>
@@ -68,43 +68,44 @@
          <div slot="action" slot-scope="scope">
            <el-button size="small" type="text" @click="handleDataLook(scope.row)">数据查看</el-button>
            <el-button type="text" size="small"
              :disabled="(scope.row.userName == null || scope.row.insState == 3 || scope.row.insState == 5) && checkPermi(['update:product:onPlan'])"
              :disabled="(scope.row.userName == null || scope.row.insState === 3 || scope.row.insState === 5) && checkPermi(['update:product:onPlan'])"
              @click="editInspection(scope.row)">修改检验值</el-button>
            <el-button type="text" size="small" :disabled="(
              scope.row.userName == null ||
              scope.row.insState == 3 ||
              scope.row.insState == 5 ||
              scope.row.insState === 3 ||
              scope.row.insState === 5 ||
              (scope.row.userName && !scope.row.userName.includes(nickName))
            )" @click="handleInspection(scope.row)">检验</el-button>
            <el-button type="text" size="small" :disabled="(
              scope.row.userName == null ||
              scope.row.insState == 5 ||
              scope.row.insState == 3 ||
              scope.row.insState === 5 ||
              scope.row.insState === 3 ||
              (scope.row.userName && !scope.row.userName.includes(nickName))
            )" @click="handleConnect(scope.row)">交接</el-button>
            <el-button type="text" size="small" @click="viewInspectInfo(scope.row)">原始记录</el-button>
            <el-button v-if="tabIndex===-1" :disabled="scope.row.insState === 5 || (scope.row.userName && !scope.row.userName.includes(nickName))" style="color:#ff4949" type="text" size="small" @click="cancelInspectOrder(scope.row)">撤销下单</el-button>
            <el-popover placement="bottom" trigger="hover" style="margin-left: 6px"
              :disabled="(scope.row.insState != 3 || scope.row.userName == null || (scope.row.userName && !scope.row.userName.includes(nickName)))">
              :disabled="(scope.row.insState !== 3 || scope.row.userName == null || (scope.row.userName && !scope.row.userName.includes(nickName)))">
              <template #reference>
                <el-button link type="text" size="small" :disabled="(scope.row.insState != 3 || scope.row.userName == null ||
                <el-button link type="text" size="small" :disabled="(scope.row.insState !== 3 || scope.row.userName == null ||
                  (scope.row.userName && !scope.row.userName.includes(nickName)))">更多</el-button>
              </template>
              <div>
                <el-button :disabled="(scope.row.insState != 3 || scope.row.userName == null ||
                <el-button :disabled="(scope.row.insState !== 3 || scope.row.userName == null ||
                  (scope.row.userName && !scope.row.userName.includes(nickName)))" style="margin-left: 10px"
                  type="text" size="small" @click="download(scope.row)">下载报告</el-button>
                <el-upload ref='upload' :action="javaApi + '/insReport/inReport'" :before-upload="beforeUpload"
                  :data="{ id: scope.row.insReportId }" :headers="uploadHeader" :on-error="onError"
                  :on-success="handleSuccessUp" :show-file-list="false" style="display: inline;margin: 0 6px"
                  accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'>
                  <el-button :disabled="(scope.row.insState != 3 || scope.row.userName == null ||
                  <el-button :disabled="(scope.row.insState !== 3 || scope.row.userName == null ||
                    (scope.row.userName && !scope.row.userName.includes(nickName)))" size="small"
                    type="text">上传</el-button>
                </el-upload>
                <el-button :disabled="(scope.row.insState != 3 || scope.row.userName == null ||
                <el-button :disabled="(scope.row.insState !== 3 || scope.row.userName == null ||
                  (scope.row.userName && !scope.row.userName.includes(nickName)))" type="text" size="small"
                  @click="handleRestore(scope.row)">还原</el-button>
                <el-button :disabled="(scope.row.insState != 3 || scope.row.userName == null ||
                <el-button :disabled="(scope.row.insState !== 3 || scope.row.userName == null ||
                  (scope.row.userName && !scope.row.userName.includes(nickName)))" type="text" size="small"
                  @click="handleIssued(scope.row)">查看报告</el-button>
              </div>
@@ -259,6 +260,7 @@
} from "@/api/business/inspectionTask.js";
import { mapGetters } from "vuex";
import { getRetestResult } from "@/api/business/rawMaterialOrder";
import { updateStatus } from "@/api/business/productOrder";
import { upReportUrl } from "@/api/business/insReport";
import onlyoffice from "@/components/Onlyoffice/onlyoffice.vue";
import filePreview from "@/components/Preview/filePreview.vue";
@@ -302,7 +304,7 @@
        { label: "外购", value: 0 },
      ],
      active: 1,
      tabIndex: 0,
      tabIndex: -1,
      dataDialogVisible: false,
      planTotal: 0,
      insStateList: [],
@@ -491,7 +493,7 @@
          fixed: "right",
          dataType: "slot",
          slot: "action",
          width: '340px',
          width: '380px',
          label: "操作"
        }
      ],
@@ -586,8 +588,8 @@
              disabled: (row) => {
                return (
                  this.lookInfo.userName == null ||
                  this.lookInfo.insState == 3 ||
                  this.lookInfo.insState == 5
                  this.lookInfo.insState === 3 ||
                  this.lookInfo.insState === 5
                );
              },
            },
@@ -632,6 +634,27 @@
    this.refreshTable();
  },
  methods: {
    //委托检验,撤销下单
    cancelInspectOrder(row){
      console.log(row)
      this.$confirm("确认撤销委托订单<span style='color:#1890FF'>"+row.entrustCode+"</span>?", '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        dangerouslyUseHTMLString: true,
        type: 'warning'
      }).then(() => {
        updateStatus({
          id: row.id,
        }).then(res=>{
          if(res.code === 200){
            this.$message.success("撤销成功")
          }
          this.refreshTable();
        }).catch(err=>{
          console.error(err);
        })
      }).catch(() => {});
    },
    getList() {
      this.tableLoading = true;
      let param = { ...this.queryParams, ...this.page };
@@ -728,7 +751,6 @@
    },
    // 查看报告
    handleIssued(row) {
      console.log('================')
      // todo: 查看报告组件
      this.currentInfo = row;
      let fileName = row.url
@@ -784,7 +806,7 @@
      return "";
    },
    handleTab(m, i) {
      this.tabIndex = i;
      this.tabIndex = m.value;
      this.typeSource = m.value;
      this.queryParams.sonLaboratory = "";
      this.refreshTable();
src/views/business/unpass/components/unPassDialog.vue
@@ -87,6 +87,18 @@
            </el-col>
          </el-row>
          <el-row >
            <el-col :span="12">
              <el-form-item label="问题分类" prop="issueType">
                <el-select style="width:100%" v-model="unPassForm.issueType" :disabled="type === 'view'" size="small" placeholder="请选择">
                  <el-option v-for="item in issueTypeOptions" :key="item.value" :label="item.label"
                             :value="item.value"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
            </el-col>
          </el-row>
          <el-row >
            <el-col :span="24">
              <el-form-item label="不合格情况描述" prop="unqualifiedDesc">
                <el-input style="width:100%" clearable type="textarea" v-model="unPassForm.unqualifiedDesc" :disabled="type === 'view'"
@@ -153,6 +165,7 @@
        feedbackUser: '', // 反馈人
        feedbackTime: '', // 反馈时间
        classification: '', // 分类
        issueType:null,
        offGradeAscription: '', // 不合格归属
        unqualifiedDesc: '', // 不合格情况描述
        unqualifiedHandlerFiles: [], // 不合格附件URL
@@ -166,21 +179,32 @@
        ],
        materialName: [
          { required: true, message: '请填写物料名称', trigger: 'blur' }
        ],
        issueType: [
          { required: true, message: '请选择问题类型', trigger: 'change' }
        ]
      },
      unPassFilesList: [], // 不合格处理附件数据
      classificationOptions: [], // 不合格分类下拉框
      offGradeAscriptionOptions: [], // 不合格归属下拉框
      handlunPassLoading: false,
      unqualifiedHandlerFiles: []
      unqualifiedHandlerFiles: [],
      issueTypeOptions:[],
    }
  },
  mounted() {
    this.getClassificationOptions() // 获取不合格分类下拉框选项
    this.getOffGradeAscriptionOptions() // 获取不合格归属下拉框选项
    this.getIssueTypeOptions() // 获取问题分类下拉框选项
  },
  // 方法集合
  methods: {
    getIssueTypeOptions(){
      // 不合格问题分类
      this.getDicts("unqualified_issue_type").then((response) => {
        this.issueTypeOptions = this.dictToValue(response.data);
      });
    },
    disabledDate(time){
        return time < new Date().getTime() - 86400000
    },
src/views/business/unpass/index-manage.vue
@@ -675,6 +675,7 @@
          },
        },
        { label: "不合格描述", prop: "unqualifiedDesc", width: "160px" },
        { label: "问题类型", prop: "issueType", width: "120px" },
        {
          dataType: "action",
          fixed: "right",
src/views/performance/class/index.vue
@@ -86,6 +86,13 @@
          v-if="checkPermi(['performance:class:add'])"
          >排 班</el-button
        >
        <el-button
          size="small"
          type="danger"
          @click="delSchedulingVisible = true"
          v-if="checkPermi(['performance:class:del'])"
          >删除排班</el-button
        >
      </div>
    </div>
    <div class="center" v-loading="pageLoading">
@@ -562,6 +569,58 @@
        >
      </span>
    </el-dialog>
<!--    删除排班弹框-->
    <el-dialog
      title="删除排班"
      :visible.sync="delSchedulingVisible"
      @close="closeSchedulingDelDialog"
      width="30%">
      <el-form
        ref="delSchedulingFormRef"
        :model="delSchedulingForm"
        :rules="delSchedulingFormRules"
      >
        <el-form-item label="人员名称:" prop="userIdList">
          <el-select
            v-model="delSchedulingForm.userIdList"
            popper-class="select-with-all"
            placeholder="请选择"
            style="width: 100%"
            multiple
            collapse-tags
            clearable
          >
            <el-option
              v-for="item in personList"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            >
              <span style="float: left">{{ item.name }}</span>
              <span style="float: right; color: #8492a6; font-size: 13px">{{
                  item.account
                }}</span>
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="时间范围:" prop="dateRange">
          <el-date-picker
            v-model="delSchedulingForm.dateRange"
            type="datetimerange"
            value-format="yyyy-MM-dd HH:mm:ss"
            :default-time="['00:00:00', '23:59:59']"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            style="width: 100%"
          >
          </el-date-picker>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
    <el-button @click="closeSchedulingDelDialog">取 消</el-button>
    <el-button type="primary" @click="confirmDelScheduling">确 定</el-button>
  </span>
    </el-dialog>
  </div>
</template>
@@ -579,6 +638,7 @@
  update,
  editAnnotationText,
  delAnnotationText,
  delShift
} from "@/api/performance/class";
import { selectUserListByPerformance } from "@/api/system/user";
import { getWorkMonth } from "@/utils/date";
@@ -685,6 +745,24 @@
      menuX: 0,
      menuY: 0,
      selectedTarget: null,
      //删除排班
      delSchedulingVisible:false,
      delSchedulingForm:{
        userIdList: [],
        dateRange: [],
      },
      delSchedulingFormRules: {
        dateRange: {
          required: true,
          message: "请选择日期范围",
          trigger: "change",
        },
        userIdList: {
          required: true,
          message: "请选择人员名称",
          trigger: "change",
        }
      },
    };
  },
  computed: {
@@ -716,6 +794,30 @@
    document.removeEventListener("click", this.handleClickOutside);
  },
  methods: {
    //确认删除排班
    confirmDelScheduling() {
      const data = {
        userIdList: this.delSchedulingForm.userIdList,
        startTime: this.delSchedulingForm.dateRange[0],
        endTime: this.delSchedulingForm.dateRange[1],
      }
      delShift(data).then(res => {
        if(res.code === 200) {
          this.$message.success("删除成功");
          this.closeSchedulingDelDialog()
          this.refreshTable()
        }
      }).catch(err => {
        console.error(err);
        this.closeSchedulingDelDialog()
      })
    },
    closeSchedulingDelDialog(){
      this.delSchedulingVisible = false;
      this.delSchedulingForm.userIdList = [];
      this.delSchedulingForm.dateRange = [];
      this.$refs.delSchedulingFormRef.resetFields()
    },
    resetForm() {
      this.$refs.schedulingQueryRef.resetFields();
      this.$nextTick(() => {