Ver código fonte

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

ezhizao_zx 1 ano atrás
pai
commit
45e443a6ef

+ 8 - 0
src/api/business/p2.js

@@ -37,6 +37,14 @@ export function getP2NeedCheckProcess(type) {
     method: 'get'
   })
 }
+// 查询p2中计划单的单批重量
+export function getProductionLotAmount(data) {
+  return request({
+    url: baseUrl + '/business/sfc10500/getLotAmount',
+    method: 'get',
+    params: data
+  })
+}
 // 查询productionPlan详细
 export function getProductionPlan(id) {
   return request({

+ 148 - 0
src/views/business/productionBatch/computedMaterialForm.vue

@@ -0,0 +1,148 @@
+<template>
+  <el-drawer
+    title="外协投产计算"
+    :with-header="false"
+    v-model="visible"
+    direction="rtl"
+    size="25%"
+  >
+    <div class="form-container column-container">
+      <div style="display: flex; justify-content: center; font-size: 28px">
+        外协投产计算
+      </div>
+      <el-form
+        ref="formRef"
+        class="master-container"
+        :model="form"
+        label-width="120px"
+      >
+        <el-row :gutter="20">
+          <el-col :span="18">
+            <el-form-item
+              label="领料量(KG)"
+              prop="materialpickUpQuantity"
+              label-width="100px"
+            >
+              <el-input-number
+                v-model="form.materialpickUpQuantity"
+                :min="0"
+                :precision="2"
+                style="width: 200px; margin-left: 30px"
+                controls-position="right"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="18">
+            <el-form-item
+              label="单批量(KG)"
+              prop="peqty"
+              label-width="100px"
+              style="margin-top: 30px"
+            >
+              <span>{{ form.peqty }}</span>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="18">
+            <el-form-item
+              label="批数"
+              prop="lotNumber"
+              label-width="100px"
+              style="margin-top: 30px"
+            >
+              <span style="margin-left: 50px">{{ form.lotNumber }}</span>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div class="bottom-buttons">
+        <el-button size="large" style="width: 200px;height: 50px;" type="info"  @click="handleCancel">取 消</el-button>
+      <el-button size="large" style="width: 200px;height: 50px;" type="primary"  @click="handleSave"
+        >填入</el-button
+      >
+    </div>
+    </div>
+  </el-drawer>
+</template>
+<script setup>
+import {getProductionLotAmount} from "@/api/business/p2.js"
+const { proxy } = getCurrentInstance();
+/** 父组件传参 */
+const props = defineProps({
+  singleSelected: {
+    type: Function,
+    default: null,
+  },
+});
+
+const { singleSelected } = toRefs(props);
+/** 字典数组区 */
+/** 表单抽屉 页变量 */
+const form = ref({});
+const visible = ref(false);
+const detailInfo = ref({})
+
+/***********************  方法区  ****************************/
+/** 打开抽屉 */
+function open(data) {
+  reset();
+  detailInfo.value = proxy.deepClone(data);
+  console.log(detailInfo.value)
+  getProductionLotAmount({lotno:detailInfo.value.productionPlanNo,lotseq:detailInfo.value.lineNumber}).then(res =>{
+    if(res.code == 200) {
+      form.value.peqty = res.data
+       visible.value = true;
+    }
+  }
+)
+ 
+}
+
+/** 取消按钮 */
+function cancel() {
+  visible.value = false;
+  reset();
+}
+
+/** 表单重置 */
+function reset() {
+  form.value = {
+    lotNumber: 0,
+  };
+  proxy.resetForm("formRef");
+}
+
+// 外协商选择带回
+const handleSingleSelectedSupplier = (data) => {
+  console.log(data);
+  form.value.supplierId = data.id;
+  form.value.lossLimit = data.lossLimit;
+  form.value.supplierName = data.name;
+  form.value.deliveryMethod = data.deliveryMethod;
+  form.value.freightPrice = data.freightPrice;
+  form.value.settlementType = data.settlementType;
+  if (form.value.deliveryMethod == 1) {
+    form.value.freightAmount = form.value.freightPrice * totalCarriersNum.value;
+  } else {
+    form.value.freightAmount = 0.0;
+  }
+};
+
+/** 暴露给父组件的方法 */
+defineExpose({
+  open,
+});
+</script>
+<style scoped>
+.bottom-buttons {
+  position: absolute;
+  bottom: 0; /* 定位到页面底部 */
+  left: 50%; /* 向左移动50% */
+  transform: translateX(-50%); /* 向左移动自身宽度的50%,实现居中 */
+  text-align: center; /* 使按钮水平居中 */
+  width: 100%; /* 宽度设为100% */
+}
+</style>

+ 9 - 1
src/views/business/productionBatch/form.vue

@@ -29,6 +29,8 @@
                 @input="handleUpdateLotNumber"
                 :min="0"
               />
+              <el-button style="margin-left: 10px;" type="primary" @click="handleComputedMaterial"
+        >外协投料计算</el-button>
             </el-form-item>
             <el-form-item label="下达日期" prop="issuanceDate">
               <el-date-picker
@@ -77,6 +79,8 @@
           </el-col>
         </el-row>
       </el-form>
+      <!-- 计算外协领料 -->
+      <form-computed-material ref="formComputedMaterialRef"/>
     </div>
     <template #footer>
       <el-button type="primary" icon="Check" @click="handleSave"
@@ -92,7 +96,7 @@ import {
   getLastLotStatus,
 } from "@/api/business/planDetailSubDetail.js";
 import { updateLotCodeStatus } from "@/api/business/productionPlanDetail.js";
-
+import formComputedMaterial from "./computedMaterialForm.vue"
 const { proxy } = getCurrentInstance();
 const emit = defineEmits(["handleSaveSuccess"]);
 
@@ -334,6 +338,10 @@ function handleSave() {
     }
   });
 }
+//外协投料计算
+function handleComputedMaterial() {
+  proxy.$refs.formComputedMaterialRef.open(detailsRow.value);
+}
 /** 取消按钮 */
 function handleCancel() {
   visible.value = false;

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

@@ -469,6 +469,7 @@ function handleAddSubDetail(row) {
   newDetail.productionPlanId = row.productionPlanId;
   newDetail.productionPlanDetailId = row.id;
   newDetail.productionPlanNo = row.productionPlanNo;
+  newDetail.lineNumber = row.lineNumber
   //生产计划总投产量
   newDetail.productionQuantityTotal = row.productionQuantity;
   newDetail.productId = row.productId;