guoyujia 3 місяців тому
батько
коміт
df95e09d58

+ 421 - 86
src/views/business/noCurrentReject/DialogRejectInfo.vue

@@ -1,18 +1,53 @@
 <template>
-  <el-dialog title="添加非本序废品信息" v-model="visible" width="1000px" append-to-body draggable v-loading="loading">
+  <el-dialog
+    title="添加非本序废品信息"
+    v-model="visible"
+    width="1000px"
+    append-to-body
+    draggable
+    v-loading="loading"
+  >
     <div class="form-container">
       <div style="padding: 16px 16px 0 16px">
         <el-row :gutter="20">
-          <span style="font-weight: bold; font-size: 18px">批次号:{{ detailInfo.lotCode }}</span>
+          <div style="width: 90%">
+            <span style="font-weight: bold; font-size: 18px"
+              >批次号:{{ detailInfo.lotCode }}</span
+            >
+          </div>
+
+          <div style="float: right">
+            <el-tag
+              v-if="detailInfo.status == 0"
+              class="spacing"
+              type="warning"
+              >{{ "审核中" }}</el-tag
+            >
+            <el-tag
+              v-if="detailInfo.status == 1"
+              class="spacing"
+              type="success"
+              >{{ "已通过" }}</el-tag
+            >
+            <el-tag
+              v-if="detailInfo.status == 2"
+              class="spacing"
+              type="danger"
+              >{{ "已拒绝" }}</el-tag
+            >
+          </div>
         </el-row>
         <el-row :gutter="20" style="margin-top: 15px">
           <span style="font-weight: bold">基础信息</span>
         </el-row>
-        <el-row :gutter="20" style="
+        <el-row
+          :gutter="20"
+          style="
             margin-top: 15px;
             padding-bottom: 10px;
             border-bottom: 1px solid #999;
-          ">
+          "
+        >
           <el-col :span="11">
             <span class="leftInfo">客户简称</span>
             <span class="rightInfo">{{ detailInfo.companyAlias }}</span>
@@ -26,11 +61,14 @@
             <span class="rightInfo">{{ detailInfo.lotCode }}</span>
           </el-col>
         </el-row>
-        <el-row :gutter="20" style="
+        <el-row
+          :gutter="20"
+          style="
             margin-top: 15px;
             padding-bottom: 10px;
             border-bottom: 1px solid #999;
-          ">
+          "
+        >
           <el-col :span="11">
             <span class="leftInfo">产品描述</span>
             <span class="rightInfo">{{ detailInfo.productDescription }}</span>
@@ -44,11 +82,14 @@
             <span class="rightInfo">{{ detailInfo.productionQuantity }}</span>
           </el-col>
         </el-row>
-        <el-row :gutter="20" style="
+        <el-row
+          :gutter="20"
+          style="
             margin-top: 15px;
             padding-bottom: 10px;
             border-bottom: 1px solid #999;
-          ">
+          "
+        >
           <el-col :span="11">
             <span class="leftInfo">下达日期</span>
             <span class="rightInfo">{{ detailInfo.createTime }}</span>
@@ -68,118 +109,287 @@
           <span style="font-weight: bold">废品信息</span>
         </el-row>
       </div>
-      <el-form ref="noCurrent" v-loading="loading" class="master-container" :model="detailInfo" :rules="rules"
-        label-width="80px">
+      <el-form
+        ref="noCurrent"
+        v-loading="loading"
+        class="master-container"
+        :model="detailInfo"
+        :rules="rules"
+        label-width="80px"
+      >
         <el-row :gutter="24">
           <el-col :span="8">
-            <el-form-item label="发现工段" label-width="80px" prop="findDeptName">
-              <el-select-v2 v-model="detailInfo.findDeptName" :options="deptList" placeholder="请选择工段"
-                @change="getFindProcess" style="width: 140px" />
+            <el-form-item
+              label="发现工段"
+              label-width="80px"
+              prop="findDeptName"
+            >
+              <el-select-v2
+                 :disabled="detailInfo.status >0 || (detailInfo.id != null && isCurrentDept) || (detailInfo.id != null && detailInfo.creatorId != useUserStore().user.userId) "
+                v-model="detailInfo.findDeptName"
+                :options="deptList"
+                placeholder="请选择工段"
+                @change="getFindProcess"
+                style="width: 140px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item label="发现工序" label-width="100px" prop="findTechnologicalProcessName">
-              <el-select-v2 v-model="detailInfo.findTechnologicalProcessName" :options="findProcessList"
-                @change="selectFindProcess" placeholder="请选择工序" :disabled="detailInfo.findDeptId == null"
-                style="width: 140px">
-                <template #default="{ index, item }">
-                  <span style="float: left">{{ index + 1 }}</span>
-                  <span style="margin-left: 8px">{{ item.label }}</span>
-                </template>
-              </el-select-v2>
+            <el-form-item
+              label="发现工序"
+              label-width="100px"
+              prop="findProcessStepNumber"
+            >
+              <el-select
+                :disabled="detailInfo.status >0 || (detailInfo.id != null && isCurrentDept) || (detailInfo.id != null && detailInfo.creatorId != useUserStore().user.userId) "
+                v-model="detailInfo.findProcessStepNumber"
+                placeholder="请选择工序"
+                @change="selectFindProcess"
+                style="width: 140px"
+              >
+                <el-option
+                  v-for="(item, index) in findProcessList"
+                  :key="item.processStepNumber"
+                  :label="item.processAlias"
+                  :value="item.processStepNumber"
+                >
+                  <!-- 自定义选项内容 -->
+                  <template #default>
+                    <span style="float: left">{{ index + 1 }}</span>
+                    <span style="margin-left: 8px">{{
+                      item.processAlias
+                    }}</span>
+                  </template>
+                </el-option>
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item label="发现人" label-width="100px">
-              <el-autocomplete v-if="editStatus && type !== 'alterOrder'" :fetch-suggestions="querySearchAsync"
-                :trigger-on-focus="true" style="width: 100%" v-model="detailInfo.findUserName" placeholder="选择人员"
-                popper-class="my-autocomplete" @select="handleSelectEmployee">
+            <el-form-item label="发现人" label-width="100px" prop="findUserName">
+              <el-autocomplete
+                v-if="editStatus && type !== 'alterOrder'"
+                :fetch-suggestions="querySearchAsync"
+                :trigger-on-focus="true"
+                style="width: 100%"
+                v-model="detailInfo.findUserName"
+                placeholder="选择人员"
+                popper-class="my-autocomplete"
+                  :disabled="detailInfo.status >0 || (detailInfo.id != null && isCurrentDept) || (detailInfo.id != null && detailInfo.creatorId != useUserStore().user.userId) "
+                @select="handleSelectEmployee"
+              >
                 <template #default="{ item }">
-                  <div style="
+                  <div
+                    style="
                       display: flex;
                       flex-direction: row;
                       justify-content: space-between;
-                    ">
+                    "
+                  >
                     <div class="name" style="font-size: 12px">
                       {{ item.nickName }}
                     </div>
-                    <span class="code" style="font-size: 10px; color: darkgrey">{{ item.userName }}</span>
+                    <span
+                      class="code"
+                      style="font-size: 10px; color: darkgrey"
+                      >{{ item.userName }}</span
+                    >
                   </div>
                 </template>
               </el-autocomplete>
-              <!-- <el-select
-                v-model="detailInfo.findUserId"
-                filterable
-                remote
-                reserve-keyword
-                placeholder="请选发现人"
-                collapse-tags-tooltip
-                collapse-tags
-                :remote-method="(arg) => selectUsere(arg)"
-                :loading="loadingCarrier"
-                @change="handleselectUsereChange"
-              >
-                <el-option
-                  v-for="dict in userList"
-                  :key="dict.userid"
-                  :label="dict.userName"
-                >
-                  <template #suffix>
-                    <span>{{ dict.userName }} - {{ dict.nickName }}</span>
-                  </template>
-                </el-option>
-              </el-select> -->
             </el-form-item>
           </el-col>
         </el-row>
         <el-row :gutter="24">
           <el-col :span="8">
             <el-form-item label="责任工段" label-width="80px" prop="deptId">
-              <el-select-v2 v-model="detailInfo.deptName" :options="deptList" placeholder="请选择工段" @change="getProcess"
-                style="width: 140px" />
+              <el-select-v2
+               :disabled="detailInfo.status >0 || (detailInfo.id != null && isCurrentDept) || (detailInfo.id != null && detailInfo.creatorId != useUserStore().user.userId) "
+                v-model="detailInfo.deptId"
+                :options="deptList"
+                placeholder="请选择工段"
+                @change="handleChangeDept"
+                style="width: 140px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item label="责任工序" label-width="100px" prop="technologicalProcessName">
-              <el-select-v2 v-model="detailInfo.technologicalProcessName" :options="processList" placeholder="请选择工序"
-                :disabled="detailInfo.deptId == null" @change="selectProcess" style="width: 140px">
-                <template #default="{ index, item }">
-                  <span style="float: left">{{ index + 1 }}</span>
-                  <span style="margin-left: 8px">{{ item.label }}</span>
-                </template>
-              </el-select-v2>
+            <el-form-item
+              label="责任工序"
+              label-width="100px"
+              prop="processStepNumber"
+            >
+              <el-select
+                :disabled="detailInfo.status >0 || (detailInfo.id != null && isCurrentDept) || (detailInfo.id != null && detailInfo.creatorId != useUserStore().user.userId) "
+                v-model="detailInfo.processStepNumber"
+                placeholder="请选择工序"
+                @change="getFindUser"
+                style="width: 140px"
+              >
+                <el-option
+                  v-for="(item, index) in processList"
+                  :key="item.processStepNumber"
+                  :label="item.processAlias"
+                  :value="item.processStepNumber"
+                >
+                  <!-- 自定义选项内容 -->
+                  <template #default>
+                    <span style="float: left">{{ index + 1 }}</span>
+                    <span style="margin-left: 8px">{{
+                      item.processAlias
+                    }}</span>
+                  </template>
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="责任人" label-width="100px">
+              <el-select
+                :disabled="detailInfo.status >0 || (detailInfo.id != null && detailInfo.creatorId != useUserStore().user.userId && !isCurrentDept) "
+               v-if="detailInfo.isWx == 0"
+                v-model="detailInfo.userIds"
+                multiple
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in userList"
+                  :key="item.userId"
+                  :label="item.nickName"
+                  :value="item.userId"
+                >
+                  <template #default>
+                    <span style="float: left">{{ item.userName }}</span>
+                    <span style="margin-left: 8px">{{ item.nickName }}</span>
+                  </template></el-option
+                >
+              </el-select>
+              <el-select
+               :disabled="detailInfo.status >0 || (detailInfo.id != null && detailInfo.creatorId != useUserStore().user.userId && !isCurrentDept) "
+              v-if="detailInfo.isWx == 1"
+                v-model="detailInfo.supplierIds"
+                multiple
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in userList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                  <template #default>
+                    <span style="float: left">{{ item.code }}</span>
+                    <span style="margin-left: 8px">{{ item.name }}</span>
+                  </template></el-option
+                >
+              </el-select>
             </el-form-item>
           </el-col>
+        </el-row>
+        <el-row :gutter="20">
           <el-col :span="8">
-            <el-form-item label="废品数量" label-width="100px" prop="rejectNum">
-              <el-input-number v-model="detailInfo.rejectNum" :min="1" :max="detailInfo.productionQuantity"
-                :decimal="false" :step="1" step-strictly label="数量" style="width: 140px" />
+            <el-form-item label="废品数量" label-width="80px" prop="rejectNum">
+              <el-input-number
+                :disabled="detailInfo.status >0 || (detailInfo.id != null && isCurrentDept) || (detailInfo.id != null && detailInfo.creatorId != useUserStore().user.userId) "
+                v-model="detailInfo.rejectNum"
+                :min="1"
+                :max="detailInfo.productionQuantity"
+                :decimal="false"
+                :step="1"
+                step-strictly
+                label="数量"
+                style="width: 140px"
+              />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row :gutter="20">
           <el-form-item label="废品原因" label-width="90px" prop="remark">
-            <el-input type="textarea" placeholder="请输入批废原因" maxlength="200" show-word-limit
-              v-model.trim="detailInfo.remark" style="width: 495px" />
+            <el-input
+              :disabled="detailInfo.status >0 || (detailInfo.id != null && isCurrentDept) || (detailInfo.id != null && detailInfo.creatorId != useUserStore().user.userId) "
+              type="textarea"
+              placeholder="请输入批废原因"
+              maxlength="200"
+              show-word-limit
+              v-model.trim="detailInfo.remark"
+              style="width: 495px"
+            />
           </el-form-item>
         </el-row>
         <el-row :gutter="20">
           <el-col :span="8">
             <el-form-item label="填写人" label-width="80px" prop="fillName">
-              <el-input :disabled="true" placeholder="请输入填写人" v-model.trim="detailInfo.fillName" style="width: 140px" />
+              <el-input
+                :disabled="true"
+                v-model.trim="detailInfo.fillName"
+                style="width: 140px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="9">
-            <el-form-item label="填写时间" label-width="100px" prop="fillDate">
-              <el-date-picker v-model="detailInfo.fillDate" :disabled="true" type="date" value-format="YYYY-MM-DD"
-                placeholder="请选择填写时间" style="width: 150px" />
+            <el-form-item label="填写日期" label-width="100px" prop="fillDate">
+              <el-date-picker
+                v-model="detailInfo.fillDate"
+                :disabled="true"
+                type="date"
+                value-format="YYYY-MM-DD"
+                style="width: 150px"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="8">
+            <el-form-item label="审核人" label-width="80px" prop="reviewName">
+              <el-input
+                :disabled="true"
+                v-model.trim="detailInfo.reviewName"
+                style="width: 140px"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="9">
+            <el-form-item
+              label="审核日期"
+              label-width="100px"
+              prop="reviewDate"
+            >
+              <el-date-picker
+                v-model="detailInfo.reviewDate"
+                :disabled="true"
+                type="date"
+                value-format="YYYY-MM-DD"
+                style="width: 150px"
+              />
             </el-form-item>
           </el-col>
         </el-row>
       </el-form>
     </div>
     <template #footer>
-      <el-button type="primary" icon="Check" @click="handleSave">保存</el-button>
+      <el-button
+        v-if="
+          detailInfo.id == null ||
+          detailInfo.creatorId == useUserStore().user.userId
+        "
+        type="primary"
+        icon="Check"
+        @click="handleSave"
+        >保存</el-button
+      >
+      <el-button
+        v-if="detailInfo.id != null && isCurrentDept"
+        type="success"
+        icon="Check"
+        @click="handleReview(1)"
+        >通过</el-button
+      >
+      <el-button
+        v-if="detailInfo.id != null && isCurrentDept"
+        type="danger"
+        icon="Close"
+        @click="handleReview(2)"
+        >拒绝</el-button
+      >
       <el-button icon="Close" @click="handleCancel">取 消</el-button>
     </template>
   </el-dialog>
@@ -188,10 +398,17 @@
 import { getDeptInfo } from "@/api/business/daywork.js";
 import { getDayworkProcessList } from "@/api/business/daywork.js";
 import { lotParticulars } from "@/api/business/technologicalAmend.js";
-import { selectUserList, getInfo } from "@/api/business/noCurrentReject";
+import {
+  selectUserList,
+  getInfo,
+  getUserByProcessStepNumber,
+} from "@/api/business/noCurrentReject";
+import { getDeptList } from "@/api/business/planDetailSubDetail.js";
 import useUserStore from "@/store/modules/user";
 import { ref } from "vue";
-import { save } from "../../../api/business/noCurrentReject";
+import { save,updateReject } from "../../../api/business/noCurrentReject";
+import { has } from "lodash-es";
+import { use } from "vxe-table";
 const { proxy } = getCurrentInstance();
 const emit = defineEmits(["handleSaveSuccess"]);
 /** 字典数组区 */
@@ -201,6 +418,8 @@ const deptList = ref([]);
 const detailInfo = ref({});
 const processList = ref([]);
 const findProcessList = ref([]);
+const isCurrentDept = ref(false); //是否可以审核
+const currentDeptList = ref([]);
 const userList = ref([]);
 const loading = ref(false);
 const editStatus = ref(true);
@@ -215,9 +434,13 @@ const data = reactive({
     findDeptName: [
       { required: true, message: "发现工段不能为空", trigger: "blur" },
     ],
+    findUserName: [
+      { required: true, message: "发现人不能为空", trigger: "blur" },
+    ],
     findTechnologicalProcessName: [
       { required: true, message: "发现工序不能为空", trigger: "blur" },
     ],
+    remark: [{ required: true, message: "废品原因不能为空", trigger: "blur" }],
     rejectNum: [{ required: true, message: "废品不能为空", trigger: "blur" }],
   },
 });
@@ -241,21 +464,47 @@ const open = (row) => {
     //   deptList.value = res.data;
     //   console.log("deptList.value", deptList.value);
     // });
-    Promise.all([getInfo(row.id), getDeptInfo({ dayworkId: row.dayworkId })]).then((res) => {
+    Promise.all([
+      getInfo(row.id),
+      getDeptInfo({ dayworkId: row.dayworkId }),
+    ]).then((res) => {
       if (res[0].code == 200 && res[1].code == 200) {
-        deptList.value = res[1].data
-        detailInfo.value = res[0].data
-        getProcess(detailInfo.value.deptId)
-        getFindProcess(detailInfo.value.findDeptId)
+        deptList.value = res[1].data;
+        detailInfo.value = res[0].data;
+        userList.value = res[0].data.supplierList&&res[0].data.supplierList.length >0 ? res[0].data.supplierList : res[0].data.dayworkItemList && res[0].data.dayworkItemList.length >0? res[0].data.dayworkItemList : [];
+        console.log(userList.value)
+        getDeptList().then((response) => {
+          currentDeptList.value = response.data.rows;
+            //判断是否显示审核按钮
+  hasCurrentDept();
+        });
+        getProcessList()
+        
+        // handleChangeDept(detailInfo.value.deptId);
+        // getFindProcess(detailInfo.value.findDeptId)
       }
-    })
-
+    });
 
     visible.value = true;
   }
 };
-
+//获取工序集合
+function getProcessList(){
+  getDayworkProcessList({
+    id: detailInfo.value.dayworkId,
+    deptId: detailInfo.value.deptId,
+  }).then((response) => {
+    processList.value = response.data;
+  });
+  getDayworkProcessList({
+    id: detailInfo.value.dayworkId,
+    deptId: detailInfo.value.findDeptId,
+  }).then((response) => {
+    findProcessList.value = response.data;
+  });
+}
 const add = (row) => {
+  console.log("uwer", useUserStore().user);
   reset();
   if (row.id) {
     lotParticulars(row.lotCode).then((res) => {
@@ -268,11 +517,14 @@ const add = (row) => {
           detailInfo.value.daywork.productionPlanNo;
         // detailInfo.value.deptName = detailInfo.value.daywork.deptName;
         detailInfo.value.dayworkId = row.id;
+        detailInfo.value.status = 0;
+        detailInfo.value.isWx = 0
         detailInfo.value.technologicalProcessId = null;
         detailInfo.value.deptId = null;
         detailInfo.value.fillDate = proxy.moment().format("YYYY-MM-DD");
         detailInfo.value.fillName = useUserStore().user.nickName;
         detailInfo.value.id = null;
+        console.log(detailInfo.value,"999")
       }
     });
 
@@ -285,6 +537,45 @@ const add = (row) => {
     visible.value = true;
   }
 };
+//审核
+function handleReview(value){
+    //审核责任人不能为空
+    if(detailInfo.value.userIds.length == 0){
+    proxy.$modal.msgError("责任人不能为空");
+    return
+  }
+  detailInfo.value.status = value
+  detailInfo.value.reviewDate = proxy.moment().format("YYYY-MM-DD");
+  detailInfo.value.reviewName = useUserStore().user.nickName;
+  detailInfo.value.reviewId = useUserStore().user.userId;
+  updateReject(detailInfo.value).then((res) => {
+    proxy.$modal.msgSuccess("审核成功");
+    visible.value = false;
+    emit("handleSaveSuccess");
+})
+}
+//获取责任用户
+function getUser(){
+  getUserByProcessStepNumber({
+    dayworkId: detailInfo.value.dayworkId,
+    processStepNumber: detailInfo.value.processStepNumber,
+    isWx: detailInfo.value.isWx,
+  }).then((res) => {
+    userList.value = res.data;
+  });
+}
+//责任人下拉框
+function getFindUser() {
+  detailInfo.value.userIds = []
+  detailInfo.value.supplierIds = []
+  const foundProcess = processList.value.find(
+    (process) =>
+      process.processStepNumber === detailInfo.value.processStepNumber
+  );
+  detailInfo.value.technologicalProcessId = foundProcess.processId;
+  detailInfo.value.technologicalProcessName = foundProcess.processAlias;
+getUser()
+}
 
 /** 输入框输出建议 */
 function querySearchAsync(queryString, cb) {
@@ -299,8 +590,33 @@ function handleSelectEmployee(item) {
   detailInfo.value.findUserName = item.nickName;
   detailInfo.value.findUserId = item.userId;
 }
+//责任工段切换
+function handleChangeDept(value) {
+  detailInfo.value.technologicalProcessId = null;
+  detailInfo.value.processStepNumber = null;
+  detailInfo.value.supplierIds = []
+  detailInfo.value.userIds = []
+  userList.value = []
+  const foundProcess = deptList.value.find(
+    (process) => process.value === value
+  );
+  detailInfo.value.deptName = foundProcess.label;
+  if (foundProcess.isOutsourcing == 1) {
+    detailInfo.value.isWx = 1;
+  } else {
+    detailInfo.value.isWx = 0;
+  }
+  //判断是否显示审核按钮
+  hasCurrentDept();
+  getDayworkProcessList({
+    id: detailInfo.value.dayworkId,
+    deptId: detailInfo.value.deptId,
+  }).then((response) => {
+    processList.value = response.data;
+  });
+}
 //获得工序
-function getProcess(value) {
+function getProcess() {
   detailInfo.value.technologicalProcessId = null;
 
   const foundProcess = deptList.value.find(
@@ -309,7 +625,8 @@ function getProcess(value) {
 
   detailInfo.value.deptId = foundProcess.value;
   detailInfo.value.deptName = foundProcess.label;
-
+  //判断是否显示审核按钮
+  hasCurrentDept();
   getDayworkProcessList({
     id: detailInfo.value.dayworkId,
     deptId: detailInfo.value.deptId,
@@ -317,6 +634,22 @@ function getProcess(value) {
     processList.value = response.data;
   });
 }
+function hasCurrentDept() {
+  console.log(currentDeptList.value);
+  console.log(detailInfo.value)
+  //管理员
+  if (useUserStore().user.userId == 1) {
+    isCurrentDept.value = true;
+  } else {
+    currentDeptList.value.forEach((item) => {
+      console.log(item.value,detailInfo.value.deptId)
+      if (item.value == detailInfo.value.deptId) {
+        isCurrentDept.value = true;
+      }
+    });
+    console.log(isCurrentDept.value)
+  }
+}
 
 function selectProcess(value) {
   const foundProcess = processList.value.find(
@@ -329,14 +662,15 @@ function selectProcess(value) {
 
 function selectFindProcess(value) {
   const foundProcess = findProcessList.value.find(
-    (process) => process.value === value
+    (process) => process.processStepNumber === detailInfo.value.findProcessStepNumber
   );
-  detailInfo.value.findTechnologicalProcessId = foundProcess.value;
-  detailInfo.value.findTechnologicalProcessName = foundProcess.label;
+  detailInfo.value.findTechnologicalProcessId = foundProcess.processId;
+  detailInfo.value.findTechnologicalProcessName = foundProcess.processAlias;
 }
 
 //获得工序
 function getFindProcess(value) {
+  console.log(value);
   detailInfo.value.findTechnologicalProcessId = null;
   const foundProcess = deptList.value.find(
     (process) => process.value === value
@@ -368,6 +702,7 @@ function reset() {
     fillDate: null,
     fillName: null,
   };
+  isCurrentDept.value = false;
   proxy.resetForm("noCurrent");
 }
 

+ 2 - 1
src/views/business/noCurrentReject/DialogSelectLot.vue

@@ -15,7 +15,7 @@
       style="padding-top: 16px"
     >
       <el-form-item
-        label="产品描述:"
+        label="关键字:"
         prop="productDescription"
         label-width="104"
       >
@@ -136,6 +136,7 @@ function open() {
  */
 function close() {
   queryParams.value.pageNum = 1;
+  queryParams.value.keyword = "";
   visible.value = false;
 }
 

+ 61 - 5
src/views/business/noCurrentReject/index.vue

@@ -10,13 +10,27 @@
         <el-input v-model="queryParams.productDescription" placeholder="请输入产品描述" style="width: 144px" clearable
           @keyup.enter="handleQuery" />
       </el-form-item>
-      <el-form-item label="生成日期:" prop="startTime">
+      <el-form-item label="状态:">
+        <el-select style="width: 160px"  v-model="queryParams.status" collapse-tags collapse-tags-tooltip
+          clearable placeholder="请选择状态">
+          <el-option v-for="item in statusList" :key="item.value" :label="item.label"
+            :value="item.value"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="填写日期:" prop="fillTime">
         <el-date-picker v-model="queryParams.startTime" type="date" style="width: 144px" value-format="YYYY-MM-DD"
           placeholder="选择起始日期" clearable />
         <span style="margin: 0 4px">到</span>
         <el-date-picker v-model="queryParams.endTime" type="date" style="width: 144px" value-format="YYYY-MM-DD"
           placeholder="选择结束日期" clearable />
       </el-form-item>
+      <el-form-item label="审核日期:" prop="reviewTime">
+        <el-date-picker v-model="queryParams.firstTime" type="date" style="width: 144px" value-format="YYYY-MM-DD"
+          placeholder="选择起始日期" clearable />
+        <span style="margin: 0 4px">到</span>
+        <el-date-picker v-model="queryParams.secondTime" type="date" style="width: 144px" value-format="YYYY-MM-DD"
+          placeholder="选择结束日期" clearable />
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
         <el-button icon="Refresh" @click="resetQuery">重置</el-button>
@@ -40,23 +54,52 @@
           <el-table-column type="selection" width="55" align="center" />
           <el-table-column label="批次号" align="center" prop="lotCode" />
           <el-table-column label="产品描述" align="center" min-width="150px" prop="productDescription" />
-          <el-table-column label="计划单号" align="center" prop="productionPlanNo" />
+          <!-- <el-table-column label="计划单号" align="center" prop="productionPlanNo" /> -->
           <el-table-column label="责任工段" align="center" prop="deptName" />
           <el-table-column label="批次投产量" align="center" prop="productionQuantity" />
           <el-table-column label="废品数量" align="center" prop="rejectNum" />
-          <el-table-column label="生成日期" align="center" prop="fillDate">
+          <el-table-column label="填写人" align="center" prop="fillName"/>
+          <el-table-column label="填写日期" align="center" prop="fillDate">
             <template #default="scope">
               {{ parseTime(scope.row.fillDate, "{y}-{m}-{d}") }}
             </template>
           </el-table-column>
-          <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+          <el-table-column label="审核人" align="center" prop="reviewName"/>
+          <el-table-column label="审核日期" align="center" prop="reviewDate">
+            <template #default="scope">
+              {{ parseTime(scope.row.reviewDate, "{y}-{m}-{d}") }}
+            </template>
+          </el-table-column>
+          <el-table-column label="状态" width="80" prop="status" align="center">
+            <template #default="scope">
+              <el-tag
+              v-if="scope.row.status == 0"
+              class="spacing"
+              type="warning"
+              >{{ "审核中" }}</el-tag
+            >
+            <el-tag
+              v-if="scope.row.status == 1"
+              class="spacing"
+              type="success"
+              >{{ "已通过" }}</el-tag
+            >
+            <el-tag
+              v-if="scope.row.status == 2"
+              class="spacing"
+              type="danger"
+              >{{ "已拒绝" }}</el-tag
+            >
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
             <template #default="scope">
               <el-button link type="warning" icon="Edit" v-hasPermi="['business:noCurrentReject:edit']"
                 @click="handleShowTurnoverDialog(scope.row)">
                 编辑
               </el-button>
 
-              <el-button link type="danger" icon="Delete" v-hasPermi="['business:noCurrentReject:remove']"
+              <el-button v-if="scope.row.status ==0" link type="danger" icon="Delete" v-hasPermi="['business:noCurrentReject:remove']"
                 @click="handleDelete(scope.row)">
                 删除
               </el-button>
@@ -91,8 +134,15 @@ import { listReject, delReject } from "@/api/business/noCurrentReject";
 
 import DialogRejectInfo from "./DialogRejectInfo";
 import DialogSelectLot from "./DialogSelectLot";
+import { ref } from "vue";
 const { proxy } = getCurrentInstance();
 const dataList = ref([]);
+const selections = ref([])
+const statusList = ref([
+  { label: "审核中", value: 0 },
+  { label: "已通过", value: 1 },
+  { label: "已拒绝", value: 2 },
+]);
 const loading = ref(true);
 const ids = ref([]);
 const total = ref(0);
@@ -118,6 +168,10 @@ function getList() {
 
 /** 删除按钮操作 */
 function handleDelete(row) {
+  console.log(selections.value)
+if(selections.value.some((item)=>item.status>0)){
+  proxy.$modal.msgError("已审核数据不能删除!");
+}else{
   const _ids = row.id || ids.value;
   proxy.$modal
     .confirm("是否确认删除选中的数据项?")
@@ -129,6 +183,7 @@ function handleDelete(row) {
       proxy.$modal.msgSuccess("删除成功!");
     })
     .catch(() => { });
+  }
 }
 
 // 新增按钮操作
@@ -145,6 +200,7 @@ function handleQuery() {
 // 多选框选中数据
 function handleSelectionChange(selection) {
   ids.value = selection.map((item) => item.id);
+  selections.value = selection;
 }
 
 /** 重置按钮操作 */