Jelajahi Sumber

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

zhuzeyu 1 tahun lalu
induk
melakukan
907d19d709

+ 19 - 28
src/views/business/daywork/form.vue

@@ -37,7 +37,8 @@
               <el-date-picker
                 v-model="form.startTime"
                 type="datetime"
-                value-format="YYYY-MM-DD hh:mm:ss "
+                value-format="YYYY-MM-DD HH:mm:ss "
+                :clearable="false"
                 :editable="false"
                 placeholder="请选择开始时间"
                 @change="handleTotalTime"
@@ -88,8 +89,9 @@
               <el-date-picker
                 v-model="form.endTime"
                 type="datetime"
-                value-format="YYYY-MM-DD hh:mm:ss "
+                value-format="YYYY-MM-DD HH:mm:ss "
                 :editable="false"
+                :clearable = "false"
                 placeholder="请选择结束时间"
                 @change="handleTotalTime"
               />
@@ -112,7 +114,6 @@
                 v-model.trim="form.prodNum"
                 :precision="0"
                 controls-position="right"
-                @change="handleComputedRejectNum"
                 style="width: 220px"
               />
             </el-form-item>
@@ -185,20 +186,19 @@
                 :precision="0"
                 :min="0"
                 controls-position="right"
-                @change="handleComputedRejectNum"
               />
             </template>
           </el-table-column>
           <el-table-column
             prop="reason"
-            label="废原因"
+            label="废原因"
             align="center"
             width="300px"
           >
             <template #default="scope">
               <el-select
                 v-model="scope.row.reason"
-                placeholder="请选择废原因"
+                placeholder="请选择废原因"
               >
                 <el-option
                   v-for="cause in waste_causes"
@@ -246,7 +246,6 @@ const processList = ref([]);
 const visible = ref(false);
 const editStatus = ref(true);
 const rejectAmount = ref(0);
-const totalRejectNum = ref(0);
 const workingHoursTime =ref('')
 const detailsRow = {
   id: null,
@@ -254,11 +253,8 @@ const detailsRow = {
   reason: "",
 };
 const validateprodNum = (rule, value, callback) => {
-  const max = detailInfo.value.maxProdNum;
   if (value <= 0) {
     callback(new Error("投产量应大于0"));
-  } else if (value > max) {
-    callback(new Error(`投产量不能超过` + max));
   } else {
     callback();
   }
@@ -379,18 +375,6 @@ function handleMultipleSelected() {
   close();
 }
 
-//计算废弃信息内的废品数量,相应更改合格数
-function handleComputedRejectNum() {
-  totalRejectNum.value = 0;
-  for (let i = 0; i < form.value.groupRejectList.length; i++) {
-    totalRejectNum.value += form.value.groupRejectList[i].rejectNum;
-  }
-  if (form.value.prodNum - totalRejectNum.value < 0) {
-    form.value.qualifiedNum = 0;
-  } else {
-    form.value.qualifiedNum = form.value.prodNum - totalRejectNum.value;
-  }
-}
 /**
  * 对话框关闭 事件
  */
@@ -422,6 +406,17 @@ const handleSave = () => {
       rejectAmount.value = 0;
       var reasonList = [];
       var flag = true;
+      //判断工序是否是尾序
+      var lastProcess = false;
+      if(form.value.processId == processList.value[processList.value.length - 1].value){
+        lastProcess = true;
+      }
+      if(lastProcess) {
+        if(form.value.status > 3) {
+          flag = false;
+          proxy.$modal.msgError("尾序不能选择该状态");
+        }
+      }
       if (form.value.status <= 1) {
         if (form.value.qualifiedNum > 0) {
           flag = false;
@@ -463,13 +458,10 @@ const handleSave = () => {
             "废品总数不能超过投产数,当前废品总数为" + rejectAmount.value
           );
         } else {
-          if (parseInt(form.value.prodNum) - rejectAmount.value >= 0) {
-            form.value.qualifiedNum =
-              parseInt(form.value.prodNum) - rejectAmount.value;
-          } else {
+          if (parseInt(form.value.prodNum) - rejectAmount.value < 0) {
             proxy.$modal.msgError("废品总数加合格数不能超过投产数");
             form.value.qualifiedNum = 0;
-          }
+          } 
         }
       }
       //workinghours
@@ -495,7 +487,6 @@ const handleSave = () => {
 //删除废弃信息
 function handleDeleteReject(row) {
   form.value.groupRejectList.splice(form.value.groupRejectList.indexOf(row), 1);
-  handleComputedRejectNum();
 }
 //添加废弃信息
 function handleAddReject() {

+ 2 - 8
src/views/business/daywork/index.vue

@@ -70,7 +70,7 @@
             </el-table-column>
             <el-table-column fixed="right" label="操作" align="center" width="70px">
               <template #default="scope">
-                <el-button  link type="warning" icon="Edit" @click="handleUpdateDayworkItem(scope.row,scope.$index)" >编辑</el-button>
+                <el-button  link type="warning" icon="Edit" @click="handleUpdateDayworkItem(scope.row)" >编辑</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -196,17 +196,11 @@ function handleDeptChange() {
   getDayworks()
 }
 
-function handleUpdateDayworkItem(row,index) {
+function handleUpdateDayworkItem(row) {
   row.technologicalProcessId = queryItemParams.value.technologicalProcessId
   row.deptId =  queryDayworkParams.value.deptId
   row.dayworkId = currentDaywork.value.id
   row.lotId = currentDaywork.value.lotId
-  if(index == 0) {
-    row.maxProdNum = currentDaywork.value.oneLotQuantity
-  }
-  else {
-    row.maxProdNum = dayworkItemList.value[index-1].qualifiedNum
-  }
   proxy.$refs.dayworkItemRef.open(row)
 }
 

+ 0 - 1
src/views/business/equipment/index.vue

@@ -285,7 +285,6 @@ const categoryTable = ref(null);
 const currentCategory = ref({});
 const equipmentCategoryList = ref([]);
 const name = ref("");
-const pagerCount = ref(4)
 const equipmentCategoryTotal = ref(0);
 const equipmentTable = ref(null);
 const equipmentList = ref([]);

+ 103 - 0
src/views/business/productionBatch/DialogCheckMaterial.vue

@@ -0,0 +1,103 @@
+<template>
+  <!-- 添加或修改项目信息对话框 -->
+  <el-dialog
+    title="领料信息"
+    v-model="visible"
+    width="1100px"
+    append-to-body
+    draggable
+  >
+    <div class="form-container">
+      <el-table
+        ref="furnaceNoRef"
+        :data="furnaceNoInfoList"
+        row-key="id"
+        size="small"
+        v-loading="loading"
+        border
+        height="370px"
+        header-row-class-name="list-header-row"
+        row-class-name="list-row"
+      ><el-table-column type="index" label="行号" width="50" align="center" />
+       <el-table-column label="厂家" align="center" width="100px" prop="factory" />
+        <el-table-column label="炉号" align="center" width="100px" prop="furnaceNumber" />
+        <el-table-column label="牌号" align="center" width="100px" prop="brandNumber" />
+        <el-table-column label="规格" align="center" width="70" prop="spec" />
+        <el-table-column label="材料直径" align="center" width="80" prop="diameter" />
+        <el-table-column label="形状" align="center" width="60" prop="shape" />
+        <el-table-column label="来料日期" align="center" width="100" prop="incomingDate" />
+        <el-table-column
+          label="技术要求1"
+          align="center"
+          prop="firstTechnicalRequirement"
+        />
+        <el-table-column
+          label="技术要求2"
+          align="center"
+          prop="secondTechnicalRequirement"
+        />
+      </el-table>
+    </div>
+    <template #footer>
+      <el-button type="primary" icon="Check" @click="submitForm"
+        >确 定</el-button
+      >
+      <!-- <el-button icon="Close" @click="cancel">取 消</el-button> -->
+    </template>
+  </el-dialog>
+</template>
+<script setup>
+import axios from "axios";
+import { getToken } from "@/utils/auth";
+
+const { proxy } = getCurrentInstance();
+/** 字典数组区 */
+/** 表单抽屉 页变量 */
+const visible = ref(false);
+const loading = ref(false);
+const furnaceNoInfoList = ref([]);
+const data = reactive({
+  form: {},
+});
+const { form, rules } = toRefs(data);
+/***********************  方法区  ****************************/
+/** 打开抽屉 */
+function open(row) {
+  loading.value = true;
+  furnaceNoInfoList.value = []
+  let token = "Bearer " + getToken();
+  axios({
+    headers: {
+      Authorization: token,
+    },
+    method: "get",
+    url: "http://120.46.159.163:7002/business/furnaceNoInfo/getFurnaceNoInfo",
+    params: {
+      productionPlanNo: row.productionPlanNo,
+      lineNumber: row.lineNumber,
+    }
+  }).then((res) => {
+    if (res.data.code === 200 && res.data.data.length>0) {
+      furnaceNoInfoList.value = res.data.data;
+    }
+    else {
+      furnaceNoInfoList.value = []
+    }
+  });
+  loading.value = false
+  visible.value = true;
+}
+/** 取消按钮 */
+function cancel() {
+  visible.value = false;
+}
+
+/** 提交按钮 */
+function submitForm() {
+  visible.value = false;
+}
+/** 暴露给父组件的方法 */
+defineExpose({
+  open,
+});
+</script>

+ 10 - 50
src/views/business/productionBatch/index.vue

@@ -27,7 +27,7 @@
             <el-table-column label="客户简称" prop="companyAlias" width="150" align="center" />
             <el-table-column label="生产计划单号" prop="productionPlanNo" width="110" align="center" />
             <el-table-column label="序号" width="60" prop="lineNumber" align="center" />
-            <el-table-column label="产品描述" prop="productDescription" align="center" />
+            <el-table-column label="产品描述" prop="productDescription" width="150" align="center" />
             <el-table-column label="图纸版本" prop="technologyVersion" width="70" align="center" />
             <el-table-column label="总投产量" prop="productionQuantity" width="80" align="center" />
             <el-table-column label="总批数" prop="totalLotNumber" width="80" align="center" />
@@ -42,14 +42,15 @@
             <el-table-column label="累计投产量" prop="pickUpQuantity" width="80" align="center" />
             <el-table-column label="累计投产批数" prop="lotTotalNumber" width="90" align="center" />
             <el-table-column label="库位" prop="storageLocation" width="80" align="center" />
-            <el-table-column label="领料部门" prop="requisitionDepartmentName" align="center" fixed="right">
+            <el-table-column label="领料部门" prop="requisitionDepartmentName" align="center" >
               <template #default="scope">
                 <span>{{ scope.row.requisitionDepartmentName }}</span>
               </template>
             </el-table-column>
             <el-table-column label="下达日期" prop="issueDate" width="120" align="center" />
-            <el-table-column label="操作" width="70" align="center" fixed="right">
+            <el-table-column  label="操作" width="200" align="center" fixed="right">
               <template #default="scope">
+                <el-button  link type="warning" icon="View" @click="handleCheckMarterialInfo(scope.row)" >领料信息 </el-button>
                 <el-button :disabled="!(queryParams.deptId == scope.row.requisitionDepartmentId) ||(scope.row.totalLotNumber == scope.row.lotTotalNumber) " link type="primary" icon="Postcard" @click="handleAddSubDetail(scope.row)" v-hasPermi="['business:productionBatch:add']">投产 </el-button>
               </template>
             </el-table-column>
@@ -101,53 +102,10 @@
           </div>
         </div>
       </section>
-      <!-- <section class="list-part-container" style="flex: 1">
-        <el-form class="list-search-container" :inline="true">
-          <el-form-item class="section-title" label="工序" />
-        </el-form>
-        <div class="el-table-container">
-          <div class="el-table-inner-container">
-            <el-table ref="processTable" :data="processList" highlight-current-row height="100%" @current-change="handleProcessCurrentChange">
-              <el-table-column type="index" label="行号" width="50" align="center" />
-              <el-table-column label="工序名称" prop="processAlias" align="center" />
-              <el-table-column label="工序编码" prop="processCode" align="center" />
-            </el-table>
-          </div>
-        </div>
-      </section>
-      <section class="list-part-container" style="flex: 1">
-        <el-form class="list-search-container" :inline="true">
-          <el-form-item class="section-title" label="设置设备" />
-          <el-form-item>
-            <el-button icon="Plus" type="primary" :disabled="!currentProcess.id" @click="openEquipment" v-hasPermi="['business:productionBatch:add']">选择设备</el-button>
-          </el-form-item>
-        </el-form>
-        <div class="el-table-container">
-          <div class="el-table-inner-container">
-            <el-table v-loading="equipmentLoading" :data="equipmentList" highlight-current-row height="100%" @selection-change="handleEquipmentSelectionChange">
-              <el-table-column type="index" label="行号" width="50" align="center" />
-              <el-table-column label="设备编码" prop="equipmentDetailCode" align="center">
-                <template #default="scope">
-                  <el-button link type="primary">{{ scope.row.equipmentDetailCode }}
-                  </el-button>
-                </template>
-              </el-table-column>
-              <el-table-column label="设备名称" prop="equipmentName" align="center" />
-
-              <el-table-column label="操作" width="60" align="center">
-                <template #default="scope">
-                  <el-button link type="danger" icon="delete" @click="handleEquipmentDelete(scope.row)" v-hasPermi="['business:productionBatch:remove']">删除
-                  </el-button>
-                </template>
-              </el-table-column>
-            </el-table>
-          </div>
-        </div>
-      </section> -->
     </section>
     <!-- 表单 -->
     <production-lot-form ref="productionRef" @handleSaveSuccess="handleFresh()" />
-    <!-- <equipment ref="equipmentRef" :get-list="handleProcessCurrentChange" :multipleSelected="equipmentSelected" :multiple="true" /> -->
+    <check-material ref="checkMaterialRef" />
   </div>
 </template>
 <script setup name="ProductionBatch">
@@ -157,7 +115,7 @@ import { savePlanDetailSubDetail, listPlanDetailSubDetail, delPlanDetailSubDetai
 import { saveBatchEquipment, listEquipment, delEquipment } from '@/api/business/productionPlanDetailEquipment.js'
 import { listTechnologicalProcessDetail } from '@/api/business/technologicalProcessDetail.js'
 import { updateLotCodeStatus } from '@/api/business/productionPlanDetail.js'
-import equipment from '@/views/dialog/equipment.vue'
+import checkMaterial from './DialogCheckMaterial.vue'
 import productionLotForm from './form'
 const { proxy } = getCurrentInstance()
 const { lot_code_status_code } = proxy.useDict('lot_code_status_code')
@@ -277,12 +235,14 @@ function handleEquipmentSelectionChange(selection) {
   equipmentSingle.value = selection.length != 1
   equipmentMultiple.value = !selection.length
 }
-
+//查询生产计划单的领料信息
+function handleCheckMarterialInfo(row) {
+  proxy.$refs.checkMaterialRef.open(row)
+}
 /** 生产计划明细 current-change 事件 */
 function handlePlanDetailCurrentChange(row) {
   if (row) {
     currentPlanDetail.value = row
-    console.log(queryParams.value.deptId)
     if(currentPlanDetail.value.requisitionDepartmentId == queryParams.value.deptId) {
       flag.value = true
     }

+ 0 - 3
src/views/business/reject/index.vue

@@ -70,9 +70,6 @@
               </template>
             </el-table-column>
             <el-table-column prop="abandonmentReason" label="废弃原因" align="center">
-              <template #default="scope">
-                <dict-tag :options="reason_for_abandonment" :value="scope.row.abandonmentReason" />
-              </template>
             </el-table-column>
           </el-table>
         </div>

+ 1 - 1
src/views/business/resourcePlan/index.vue

@@ -6,7 +6,7 @@
       <el-form class="list-search-container" ref="queryRef" :inline="true">
         <el-form-item class="section-title" label="资源组" />
         <el-form-item class="section-title" label="请选择当前工段:">
-          <el-select-v2 v-model="queryParams.deptId" clearable :options="deptList" placeholder="请选择工段" style="width: 100%" @change="handleChangeDeptId" />
+          <el-select-v2 v-model="queryParams.deptId" :options="deptList" placeholder="请选择工段" style="width: 100%" @change="handleChangeDeptId" />
         </el-form-item>
         <el-form-item label="资源组名称:">
           <el-input placeholder="请输入资源组名称" v-model.trim="queryParams.code" style="width: 150px" clearable  @keyup.enter="handleQuery" @keydown.enter.prevent  />