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