Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

wangxin 11 bulan lalu
induk
melakukan
a9c14b1324

+ 7 - 0
src/api/business/product.js

@@ -78,3 +78,10 @@ export function getProductsForOutsource(query) {
 		params: query
 	})
 }
+export function getProductTotal(query) {
+	return request({
+	 url: baseUrl +'/business/product/getTotal',
+	  method: 'get',
+	  params: query
+	})
+}

+ 79 - 43
src/views/business/drawing/drawingDetail.vue

@@ -48,52 +48,57 @@
                             <!-- <el-table-column type="selection" width="40" align="center" /> -->
                             <el-table-column type="index" label="行号" width="50" align="center" />
 
-                            <el-table-column label="图纸" prop="drawingName" align="center">
-                                <template #default="scope">
-                                    <el-button link type="primary">{{
-                                        scope.row.drawingName }}</el-button>
-                                </template>
-                            </el-table-column>
+                            <el-table-column label="图纸" prop="drawingName" align="center" />
+                            <el-table-column label="类型" prop="pattern" align="center" width="80" />
                             <el-table-column label="状态" width="80px" prop="status" align="center">
                                 <template #default="scope">
                                     <dict-tag :options="drawing_status" :value="scope.row.status" />
                                 </template>
                             </el-table-column>
-                            <el-table-column label="是否废弃" width="80px" prop="abandoned" align="center">
+                            <!-- <el-table-column label="是否废弃" width="80px" prop="abandoned" align="center">
                                 <template #default="scope">
                                     <dict-tag :options="drawing_type" :value="scope.row.abandoned" />
                                 </template>
-                            </el-table-column>
+                            </el-table-column> -->
                             <el-table-column label="制作人" width="100px" prop="producer" align="center" />
                             <el-table-column label="审核人" width="100px" prop="reviewer" align="center" />
                             <el-table-column label="批准人" width="100px" prop="issuer" align="center" />
-                            <el-table-column fixed="right" label="操作" align="center" width="280px">
+                            <el-table-column fixed="right" label="操作" align="center">
                                 <template #default="scope">
-                                    <el-button v-if="scope.row.status == 0 && scope.row.abandoned == 0" link type="primary"
-                                        v-hasPermi="['business:electronicDrawings:examine']"
-                                        @click="handlePreview(scope.row)">审核
-                                    </el-button>
-                                    <el-button v-if="scope.row.status == 1" link type="success" plain
-                                        v-hasPermi="['business:electronicDrawings:raift']"
-                                        @click="handlePreview(scope.row)">批准</el-button>
-
-                                    <el-upload :action="webHost + '/common/upload'" :headers="headers" :limit="1"
-                                        :on-success="handleReplaceSuccess" :on-exceed="handleReplaceExceed"
-                                        :before-upload="beforeUpload" :show-file-list="false">
+                                    <el-button-group
+                                        style="display: flex;align-items: center; justify-content: center;  flex-wrap: nowrap;">
+                                        <el-button v-if="scope.row.status == 0 && scope.row.abandoned == 0" link
+                                            type="primary" v-hasPermi="['business:electronicDrawings:examine']"
+                                            @click="handlePreview(scope.row)">审核
+                                        </el-button>
+                                        <el-button v-if="scope.row.status == 1" link type="success" plain
+                                            v-hasPermi="['business:electronicDrawings:raift']"
+                                            @click="handlePreview(scope.row)">批准</el-button>
+
+                                        <!-- <el-upload style="display: flex;align-items: center; justify-content: center;"
+                                            :action="webHost + '/common/upload'" :headers="headers" :limit="1"
+                                            :on-success="handleReplaceSuccess" :on-exceed="handleReplaceExceed"
+                                            :before-upload="beforeUpload" :show-file-list="false">
+                                            <el-button v-if="scope.row.status == 2 && scope.row.abandoned == 0" link
+                                                type="warning" plain
+                                                v-hasPermi="['business:electronicDrawings:replace']">替换</el-button>
+                                        </el-upload> -->
+
+                                        <el-button v-if="scope.row.status == 2 && scope.row.abandoned == 0" link
+                                            type="warning" v-hasPermi="['business:electronicDrawings:replace']"
+                                            @click="replaceClick(scope.row)">替换
+                                        </el-button>
+
+                                        <el-button
+                                            v-if="(scope.row.status == 0 || scope.row.status == 1) && scope.row.abandoned == 0"
+                                            link type="danger" v-hasPermi="['business:electronicDrawings:NG']"
+                                            @click="handleDrawingNG(scope.row)">NG
+                                        </el-button>
                                         <el-button v-if="scope.row.status == 2 && scope.row.abandoned == 0" link
-                                            type="warning" plain
-                                            v-hasPermi="['business:electronicDrawings:replace']">替换</el-button>
-                                    </el-upload>
-
-                                    <el-button
-                                        v-if="(scope.row.status == 0 || scope.row.status == 1) && scope.row.abandoned == 0"
-                                        link type="danger" v-hasPermi="['business:electronicDrawings:NG']"
-                                        @click="handleDrawingNG(scope.row)">NG
-                                    </el-button>
-                                    <el-button v-if="scope.row.status == 2 && scope.row.abandoned == 0" link type="danger"
-                                        v-hasPermi="['business:electronicDrawings:remove']"
-                                        @click="handleDrawingRemove(scope.row)">作废
-                                    </el-button>
+                                            type="danger" v-hasPermi="['business:electronicDrawings:remove']"
+                                            @click="handleDrawingRemove(scope.row)">作废
+                                        </el-button>
+                                    </el-button-group>
                                 </template>
                             </el-table-column>
                         </el-table>
@@ -119,7 +124,7 @@
         </div>
 
         <!-- 添加图纸对话框 -->
-        <el-dialog title="上传文件" v-model="open" width="500px" append-to-body>
+        <el-dialog title="上传文件" v-model="open" width="500px" @close="cancel" append-to-body>
             <el-form ref="drawingRef" :model="form" :rules="rules" label-width="120px" v-loading="formLoading">
 
 
@@ -139,7 +144,7 @@
                         <template #append>
                             <el-upload :disabled="!form.technologicalProcessDetailId" :action="webHost + '/common/upload'"
                                 :headers="headers" :limit="1" :on-success="handleSuccess" :on-exceed="handleExceed"
-                                :before-upload="beforeUpload" :show-file-list="false">
+                                :before-upload="beforeUpload" :show-file-list="false" ref="uploadrefss">
                                 <el-button icon="Upload"></el-button>
                             </el-upload>
                         </template>
@@ -174,7 +179,8 @@ const hostUrl = import.meta.env.VITE_HOST_URL
 const { proxy } = getCurrentInstance();
 const { drawing_status } = proxy.useDict("drawing_status");
 const { drawing_type } = proxy.useDict("drawing_type");
-
+const uploadrefss = ref()
+const parentName = ref("")
 const total = ref(0)
 const route = useRoute();
 const coverName = ref("")
@@ -188,7 +194,7 @@ const technologicalDetailId = ref(null)
 const open = ref(false)
 const draform = ref({})
 const currentDrawing = ref({})
-const replaceForm  = ref({})
+const replaceForm = ref({})
 const repeatingDrawings = ref([])
 const loading = ref(false);
 const drawingList = ref([])
@@ -206,6 +212,7 @@ const data = reactive({
     form: {
         pageNum: 1,
         pageSize: 10,
+        parentId: null,
         technologicalProcessDetailId: null,
         groupDetailList: [],
         code: "",
@@ -327,6 +334,7 @@ function getDrawing() {
 /**上传成功回调 */
 function handleSuccess(row) {
     form.value.url = row.fileName
+
     var fileDrawing = {}
     fileDrawing.drawingName = row.originalFilename
     fileDrawing.technologicalProcessDetailId = currentTechnologicalDetail.value.id
@@ -342,7 +350,7 @@ function handleSuccess(row) {
                 formLoading.value = false
             } else {
                 //判断重名文件状态是否已发行需要替换
-                if (repeatingDrawings.value[0].status == 0) {
+                if (repeatingDrawings.value[0].status == 2) {
                     proxy.$modal.msgWarning("待审核中已有相同文件");
                     var item = {}
                     item = repeatingDrawings.value[0]
@@ -381,12 +389,38 @@ function handleReplaceSuccess(row) {
     handleReplace(item)
 
 }
+
+function replaceClick(row) {
+    form.value.parentId = row.id
+    form.value.technologicalProcessDetailId = row.technologicalProcessDetailId
+    open.value = true
+}
 function submitForm() {
     proxy.$refs["drawingRef"].validate((valid) => {
         console.log(proxy.$refs["drawingRef"])
         if (valid) {
-            open.value = false
-            saveDrawingDetail()
+
+            if (form.value.parentId) {
+                proxy.$modal
+                    .confirm("是否确认替换图纸?")
+                    .then(function () {
+                        if (currentTechnologicalDetail.value.id !== undefined && currentTechnologicalDetail.value.id !== null && currentTechnologicalDetail.value.id !== 'undefined') {
+                            form.value.technologicalProcessDetailId = currentTechnologicalDetail.value.id
+                        }
+                        return replace(form.value);
+                    })
+                    .then(() => {
+                        reset()
+                        getList();
+                        open.value = false
+                        proxy.$modal.msgSuccess("替换成功");
+                    })
+                    .catch(() => { });
+            } else {
+                console.log(form.value, 79)
+                saveDrawingDetail()
+            }
+
         }
     });
 }
@@ -395,6 +429,7 @@ function saveDrawingDetail() {
     if (currentTechnologicalDetail.value.id !== undefined && currentTechnologicalDetail.value.id !== null && currentTechnologicalDetail.value.id !== 'undefined') {
         form.value.technologicalProcessDetailId = currentTechnologicalDetail.value.id
     }
+
     form.value.drawingName = coverName.value
 
     var itemList = []
@@ -404,7 +439,7 @@ function saveDrawingDetail() {
             reset();
             getList();
             formLoading.value = false
-
+            open.value = false
         }
     })
 }
@@ -431,16 +466,17 @@ function reset() {
         drawingName: null,
         type: false
     };
-    currentProduct.value = {}
     currentTechnologicalDetail.value = {}
-    currentTechnological.value = {}
     coverName.value = ''
     repeatingDrawings.value = []
     proxy.resetForm("drawingRef");
 }
 // 取消按钮
 function cancel() {
+    uploadrefss.value.clearFiles()
+
     open.value = false
+
     reset()
 }
 /**版本change事件 */

+ 7 - 0
src/views/business/drawingAuditing/index.vue

@@ -77,6 +77,11 @@
                         <el-table-column label="工序" prop="processAlias" align="center" />
                         <el-table-column label="图纸" prop="drawingName" align="center" />
                         <el-table-column label="类型" prop="pattern" align="center" />
+                        <el-table-column label="状态" width="80px" prop="status" align="center">
+                                <template #default="scope">
+                                    <dict-tag :options="drawing_status" :value="scope.row.status" />
+                                </template>
+                            </el-table-column>
                         <el-table-column label="制作人" prop="producer" align="center" />
                         <el-table-column label="操作" width="150" align="center">
                             <template #default="scope">
@@ -116,6 +121,8 @@ const { yes_no } = proxy.useDict("yes_no");
 const drawingTabel = ref(null)
 const selections = ref([]);
 const total = ref(0);
+const { drawing_status } = proxy.useDict("drawing_status");
+
 const drawingList = ref([]);
 const loading = ref(false);
 const patternLabels = ref([{

+ 8 - 1
src/views/business/drawingRatify/index.vue

@@ -77,6 +77,11 @@
                         <el-table-column label="工序" prop="processAlias" align="center" />
                         <el-table-column label="图纸" prop="drawingName" align="center" />
                         <el-table-column label="类型" prop="pattern" align="center" width="60"/>
+                        <el-table-column label="状态" width="80px" prop="status" align="center">
+                                <template #default="scope">
+                                    <dict-tag :options="drawing_status" :value="scope.row.status" />
+                                </template>
+                            </el-table-column>
                         <el-table-column label="制作人" prop="producer" align="center" width="100"/>
                         <el-table-column label="审核人" prop="reviewer" align="center" width="100"/>
                         <el-table-column label="操作" width="150" align="center">
@@ -113,6 +118,8 @@ const { proxy } = getCurrentInstance();
 const webHost = import.meta.env.VITE_APP_PRODUCTION_API;
 /**字典数组 */
 const { equipment_status } = proxy.useDict("equipment_status");
+const { drawing_status } = proxy.useDict("drawing_status");
+
 const { yes_no } = proxy.useDict("yes_no");
 const drawingTabel = ref(null)
 const selections = ref([]);
@@ -129,7 +136,7 @@ const patternLabels = ref([{
 const data = reactive({
     queryParams: {
         status: 1,
-        abandoned:1,
+        abandoned:0,
         pageNum: 1,
         pageSize: 10,
     },

+ 7 - 0
src/views/business/electronicDrawings/index.vue

@@ -189,6 +189,7 @@ function handleQueryProduct() {
 	getList()
 }
 function handleProduct(row) {
+	technologicalprocessDetailList.value = []
 	openVersoinForm.value = true
 	currentTechnological.value = {}
 	console.log(row)
@@ -198,6 +199,12 @@ function handleProduct(row) {
 	getTechnological(technological).then(res => {
 		if (res.code == 200) {
 			technologicalProcessList.value = res.data
+			
+			if(technologicalProcessList.value.length>0){
+				currentProduct.value.technologicalprocessId = technologicalProcessList.value[0].value
+				currentTechnological.value.id = technologicalProcessList.value[0].value
+				handelDetails()
+			}
 		}
 	})
 

+ 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>

+ 8 - 3
src/views/business/product/index.vue

@@ -188,7 +188,7 @@
 </template>
 
 <script setup>
-import { listProduct, delProduct } from '@/api/business/product'
+import { listProduct, delProduct,getProductTotal } from '@/api/business/product'
 import { getP2Product } from '@/api/business/p2.js'
 import productForm from './form'
 import processChoice from './DialogProcessChoice'
@@ -203,7 +203,7 @@ const { product_type } = proxy.useDict('product_type')
 const { product_dtype } = proxy.useDict('product_dtype')
 const { product_status_code } = proxy.useDict('product_status_code')
 const { production_type_code } = proxy.useDict('production_type_code')
-
+const productTotal = ref(0)
 /** 产品变量 */
 const productList = ref([])
 const productLoading = ref(false)
@@ -266,7 +266,12 @@ function getList() {
 		getProcuctDrawing().then(res=>{
 		console.log(res,4446)
 		productDrawing.value = res.data
-		drawingRatio.value = (productDrawing.value / total.value *100).toFixed(2)
+		getProductTotal().then(response=>{
+			console.log(response.data)
+			productTotal.value = response.data
+			drawingRatio.value = (productDrawing.value / productTotal.value *100).toFixed(2)
+		})
+		
 	})
 	})
 }

+ 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,