Переглянути джерело

Merge branch 'master' of http://120.46.159.163:7400/ezhizao/ezhizao_dms_vue

zhuzeyu 11 місяців тому
батько
коміт
c38c615419

+ 175 - 0
src/views/business/outsourceVerify/index.vue

@@ -0,0 +1,175 @@
+<template>
+  <div class="page-container row-container">
+    <!-- 左侧区域 -->
+    <section class="list-part-container" style="flex: 3">
+      <!-- 搜索区 -->
+      <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true"
+        style="margin-right: 0px">
+        <el-form-item class="section-title" label="工段:">
+          <el-select-v2 v-model="queryParams.deptId" :options="deptList" placeholder="请选择工段" style="width: 130px"
+            @change="handleDeptChange" />
+        </el-form-item>
+        <el-form-item label="批次号:">
+          <el-input placeholder="请输入批次号" v-model.trim="queryParams.lotCode" @keydown.enter.prevent clearable
+            style="width: 140px" />
+        </el-form-item>
+        <el-form-item label="产品描述:">
+          <el-input placeholder="请输入产品描述" v-model.trim="queryParams.productDescription" @keydown.enter.prevent clearable
+            style="width: 130px" />
+        </el-form-item>
+        <el-form-item label="工序:">
+          <el-input placeholder="请输入工序" v-model.trim="queryParams.processAlias" @keydown.enter.prevent clearable
+            style="width: 130px" />
+        </el-form-item>
+        <el-form-item label="状态:">
+          <el-select v-model="queryParams.status" clearable placeholder="请选择状态" style="width: 130px">
+            <el-option v-for="dict in process_inspection_status" :key="dict.value" :label="dict.label"
+              :value="dict.value"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="检测日期:">
+          <el-date-picker v-model="queryParams.startTime" type="date" value-format="YYYY-MM-DD" :editable="false"
+            clearable placeholder="请选择" style="width: 136px" @change="handleTimeChange" />
+          <span>~</span>
+          <el-date-picker v-model="queryParams.endTime" type="date" value-format="YYYY-MM-DD" :editable="false"
+            clearable placeholder="请选择" style="width: 136px" @change="handleTimeChange" />
+        </el-form-item>
+        <el-form-item style="margin-left: 0">
+          <el-button type="info" icon="Search" @click="handleQuery">搜索
+          </el-button>
+        </el-form-item>
+      </el-form>
+      <div class="el-table-container">
+        <div class="el-table-inner-container">
+          <el-table ref="processInspectionTable" :data="inspectionList" v-loading="inspectionLoading"
+            highlight-current-row height="100%">
+            <el-table-column label="批次号" prop="lotCode" width="160" align="center" />
+            <el-table-column label="产品描述" prop="productDescription" align="center" width="220" />
+            <el-table-column label="图号" prop="drawingNumber" align="center" />
+            <el-table-column label="工艺版本" prop="technologyVersion" align="center" />
+            <el-table-column label="检测人员" prop="nickName" align="center" />
+            <el-table-column label="检测工段" prop="deptName" width="160" align="center" />
+            <el-table-column label="检测工序" prop="processAlias" width="160" align="center" />
+            <el-table-column label="检测日期" prop="createTime" width="160" align="center" />
+            <el-table-column label="备注" prop="remark" width="160" align="center" />
+            <el-table-column label="检测状态" align="center" prop="status">
+              <template #default="scope">
+                <dict-tag :options="process_inspection_status" :value="scope.row.status" />
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" width="200" fixed="right" align="center">
+              <template #default="scope">
+                <el-button link type="primary" icon="View" @click="handleView(scope.row)">查看</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+      <!-- 分页 -->
+      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+        v-model:limit="queryParams.pageSize" @pagination="getProcessInspectionList" />
+    </section>
+    <process-inspection-form ref="processInspectionRef" />
+  </div>
+</template>
+
+<script setup name="processInspection">
+import {
+  listInspecion
+} from "@/api/business/processInspecion.js";
+
+import { getDeptList } from "@/api/business/planDetailSubDetail.js";
+// import processInspectionForm from "./form.vue"
+import { ref } from "vue";
+const { proxy } = getCurrentInstance();
+/** 字典数组区 */
+const { process_inspection_status } = proxy.useDict('process_inspection_status')
+
+/** 序检 */
+const processInspectionTable = ref(null);
+const inspectionList = ref([]);
+const inspectionLoading = ref(false);
+const loading = ref(false);
+const isDispatch = ref(false);
+const total = ref(0);
+/**工段 */
+const deptList = ref([]);
+const queryParams = ref({
+  pageNum: 1,
+  pageSize: 10,
+  lotCode: null,
+  productDescription: null,
+  deptId: null,
+  processAlias: null
+});
+
+/***********************  工段相关事件  ****************************/
+function getList() {
+  getNowDate();
+  loading.value = true;
+  getDeptList().then((response) => {
+    deptList.value = response.data.rows;
+    isDispatch.value = response.data.others.isDispatch;
+    loading.value = false;
+    if (isDispatch.value) {
+      deptList.value.unshift({ label: "全部", value: "0" });
+    }
+    let index = deptList.value.findIndex(item => {
+      return item.label == '外协'
+    })
+    if (index > -1) {
+      deptList.value.splice(index, 1)
+    }
+    queryParams.value.deptId = deptList.value[0].value;
+    getProcessInspectionList();
+  });
+}
+function getNowDate() {
+  queryParams.value.startTime = proxy.moment().format("YYYY-MM-DD")
+  queryParams.value.endTime = proxy.moment().format("YYYY-MM-DD")
+}
+function handleTimeChange() {
+  getProcessInspectionList();
+}
+//查看序检明细
+function handleView(row) {
+  proxy.$refs.processInspectionRef.open(row)
+}
+
+//切换工段
+function handleDeptChange() {
+  getProcessInspectionList();
+}
+
+
+/***********************  废品报表信息相关事件  ****************************/
+
+/** 废品详情列表 */
+function getProcessInspectionList() {
+  if (queryParams.value.startTime != null) {
+    queryParams.value.startTime = proxy.moment(queryParams.value.startTime).format('YYYY-MM-DD 00:00:00')
+  }
+  if (queryParams.value.endTime != null) {
+    queryParams.value.endTime = proxy.moment(queryParams.value.endTime).format('YYYY-MM-DD 23:59:59')
+  }
+  inspectionLoading.value = true;
+  listInspecion(queryParams.value).then((res) => {
+    inspectionList.value = res.rows;
+    total.value = res.total;
+    inspectionLoading.value = false;
+  });
+}
+/** 搜索按钮操作 */
+function handleQuery() {
+  getProcessInspectionList();
+}
+
+onMounted(() => {
+  getList();
+});
+</script>
+<style scoped>
+.el-form--inline .el-form-item {
+  margin-right: 20px;
+}
+</style>

+ 10 - 0
src/views/business/returnReceipt/form.vue

@@ -121,6 +121,7 @@ import {
   addReceipt,
   updateReceipt,
 } from "@/api/business/returnReceipt";
+import { getP2NeedCheckProcess } from '@/api/business/p2'
 import dialogOutsourceDetails from "./DialogOutsourceDetails";
 import dialogSuppliers from "./DialogSuppliers";
 const emit = defineEmits(["handleSaveSuccess"]);
@@ -129,6 +130,7 @@ const { proxy } = getCurrentInstance();
 const loading = ref(false);
 const visible = ref(false);
 const editStatus = ref(false);
+const processList = ref([])
 const webHost = import.meta.env.VITE_APP_BASE_API;
 const form = ref({});
 
@@ -137,6 +139,7 @@ const form = ref({});
 const open = (row) => {
   reset();
   visible.value = true;
+  getP2NeedCheck()
   if (row) {
     loading.value = true;
     editStatus.value = row.editStatus;
@@ -307,6 +310,7 @@ function submitForm() {
           proxy.$modal
             .confirm("存在填写确定数量为0的工序,确定要收回吗?")
             .then(function () {
+              form.value.processes = processList.value
               if (form.value.id != null) {
                 updateReceipt(form.value).then((response) => {
                   proxy.$modal.msgSuccess("修改成功");
@@ -399,6 +403,12 @@ function handleSetAuditStatus() {
     });
   }
 }
+
+function getP2NeedCheck() {
+  getP2NeedCheckProcess("Y").then(res => {
+    processList.value = res.row.map(v => v.prcode.trim())
+  })
+}
 /** 暴露给父组件的方法 */
 defineExpose({
   open,

+ 19 - 23
src/views/business/reviseBath/multiSingleChangeDialog.vue

@@ -16,18 +16,15 @@
           @click="handleAdd"
           >在此工序前添加新工序</el-button
         >
-        <el-button
-          type="danger"
-          @click="handleDel"
-          :disabled="click"
-          icon="delete"
+        <el-button type="danger" @click="handleDel" icon="delete"
           >删除</el-button
         >
       </el-form-item>
     </el-form>
     <div class="el-table-inner-container">
       <el-table
-        style="height: 600px"
+        ref="processTable"
+        style="height: 500px"
         v-loading="loading"
         @selection-change="handleSelectionChange"
         :data="processList"
@@ -142,6 +139,7 @@ const loading = ref(false);
 const haveModified = ref(false); //是否已经修改
 const addProcess = ref(false); //新增工序弹窗
 const total = ref(0);
+const processTable = ref(null);
 const emit = defineEmits(["handleSaveSuccess"]);
 const ids = ref([]); //多选框选中数据
 const click = ref(true); //按钮不可点
@@ -190,29 +188,27 @@ function handleSelectionChange(selection) {
 
 /** 删除按钮操作 */
 function handleDel() {
-  if (haveModified.value) {
-    proxy.$modal.msgError("只能修改一次工序数据");
-    return;
-  }
-
-  //查询选中工序位置
-  let id = ids.value[0];
-  let index = processList.value.findIndex((item) => item.id === id);
+  //查询选中数据
+  const delRows = processTable.value.getSelectionRows();
 
   proxy.$modal.confirm("是否确认删除该条数据?").then(() => {
-    processList.value.splice(index, 1);
-    haveModified.value = true;
+    processList.value = processList.value.filter(
+      (item) => !delRows.includes(item)
+    );
   });
 }
 
 /** 新增工序确认按钮 操作*/
 function handleProcess(row) {
   //查询选中工序位置
-  let id = ids.value[0];
-  let indexNum = processList.value.findIndex((item) => item.id === id);
+  const clickProcess = processTable.value.getSelectionRows();
+  let indexNum = processList.value.findIndex((item) =>
+    Object.is(item, clickProcess[0])
+  );
+  console.log("indexNum", indexNum);
 
   //获取新增工序上一条排序
-  let num = processList.value[indexNum - 1].processStepNumber; //
+  let num = processList.value[indexNum - 1].processStepNumber;
 
   //复制选中数据
   let process = { ...processList.value[indexNum] };
@@ -247,10 +243,10 @@ function checkSelectable(row) {
 
 /** 添加新工序按钮操作 */
 function handleAdd() {
-  if (haveModified.value) {
-    proxy.$modal.msgError("只能修改一次工序数据");
-    return;
-  }
+  // if (haveModified.value) {
+  //   proxy.$modal.msgError("只能修改一次工序数据");
+  //   return;
+  // }
   handleSelect();
   addProcess.value = true;
 }

+ 18 - 22
src/views/business/reviseBath/onceSingleChangeDialog.vue

@@ -16,18 +16,15 @@
           @click="handleAdd"
           >在此工序前添加新工序</el-button
         >
-        <el-button
-          type="danger"
-          @click="handleDel"
-          :disabled="click"
-          icon="delete"
+        <el-button type="danger" @click="handleDel" icon="delete"
           >删除</el-button
         >
       </el-form-item>
     </el-form>
     <div class="el-table-inner-container">
       <el-table
-        style="height: 600px"
+        ref="processTable"
+        style="height: 500px"
         v-loading="loading"
         @selection-change="handleSelectionChange"
         :data="processList"
@@ -138,6 +135,7 @@ const visible = ref(false);
 const loading = ref(false);
 const haveModified = ref(false); //是否已经修改
 const addProcess = ref(false); //新增工序弹窗
+const processTable = ref(null);
 const total = ref(0);
 const emit = defineEmits(["handleSaveSuccess"]);
 const ids = ref([]); //多选框选中数据
@@ -185,26 +183,24 @@ function handleSelectionChange(selection) {
 
 /** 删除按钮操作 */
 function handleDel() {
-  if (haveModified.value) {
-    proxy.$modal.msgError("只能修改一次工序数据");
-    return;
-  }
-
-  //查询选中工序位置
-  let id = ids.value[0];
-  let index = processList.value.findIndex((item) => item.id === id);
+  //查询选中数据
+  const delRows = processTable.value.getSelectionRows();
 
   proxy.$modal.confirm("是否确认删除该条数据?").then(() => {
-    processList.value.splice(index, 1);
-    haveModified.value = true;
+    processList.value = processList.value.filter(
+      (item) => !delRows.includes(item)
+    );
   });
 }
 
 /** 新增工序确认按钮 操作*/
 function handleProcess(row) {
   //查询选中工序位置
-  let id = ids.value[0];
-  let indexNum = processList.value.findIndex((item) => item.id === id);
+  const clickProcess = processTable.value.getSelectionRows();
+  let indexNum = processList.value.findIndex((item) =>
+    Object.is(item, clickProcess[0])
+  );
+  console.log("indexNum", indexNum);
 
   //获取新增工序上一条排序
   let num = processList.value[indexNum - 1].processStepNumber; //
@@ -244,10 +240,10 @@ function checkSelectable(row) {
 
 /** 添加新工序按钮操作 */
 function handleAdd() {
-  if (haveModified.value) {
-    proxy.$modal.msgError("只能修改一次工序数据");
-    return;
-  }
+  // if (haveModified.value) {
+  //   proxy.$modal.msgError("只能修改一次工序数据");
+  //   return;
+  // }
   handleSelect();
   addProcess.value = true;
 }