|
@@ -38,102 +38,69 @@
|
|
|
width="800"
|
|
|
v-loading="loading"
|
|
|
>
|
|
|
- <el-form
|
|
|
- :model="formData.data"
|
|
|
+ <byForm
|
|
|
+ :formConfig="formConfig"
|
|
|
+ :formOption="formOption"
|
|
|
+ v-model="formData.data"
|
|
|
:rules="rules"
|
|
|
- ref="formDom"
|
|
|
- label-position="top"
|
|
|
+ ref="byform"
|
|
|
>
|
|
|
- <div style="margin-bottom: 10px; font-size: 14px">基础信息</div>
|
|
|
- <el-row>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="供应商" prop="supplyId">
|
|
|
- <el-select
|
|
|
- v-model="formData.data.supplyId"
|
|
|
- placeholder="请选择"
|
|
|
- style="width: 100%"
|
|
|
- disabled
|
|
|
+ <template #products>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-table :data="formData.data.stockTransferDetailsList">
|
|
|
+ <el-table-column prop="productCode" label="物品类型" />
|
|
|
+ <el-table-column prop="productCode" label="物品编码" />
|
|
|
+ <el-table-column prop="productName" label="物品名称" />
|
|
|
+ <el-table-column prop="productSpec" label="规格型号" />
|
|
|
+ <el-table-column prop="productSpec" label="单位" />
|
|
|
+ <el-table-column prop="inQuantity" label="到货数量" />
|
|
|
+ <el-table-column prop="outQuantity" label="已质检" />
|
|
|
+ <el-table-column
|
|
|
+ prop="outQuantity"
|
|
|
+ label="质检合格"
|
|
|
+ min-width="150"
|
|
|
>
|
|
|
- <el-option
|
|
|
- v-for="item in supplierData"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="采购单号" prop="code">
|
|
|
- <el-input
|
|
|
- v-model="formData.data.code"
|
|
|
- placeholder="请输入"
|
|
|
- disabled
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <el-form-item
|
|
|
+ :prop="
|
|
|
+ 'stockTransferDetailsList.' + $index + '.outQuantity'
|
|
|
+ "
|
|
|
+ :rules="rules.outQuantity"
|
|
|
+ :inline-message="true"
|
|
|
+ >
|
|
|
+ <el-input-number
|
|
|
+ v-model="row.outQuantity"
|
|
|
+ :precision="2"
|
|
|
+ :controls="false"
|
|
|
+ :min="0"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="inQuantity"
|
|
|
+ label="质检不合格"
|
|
|
+ min-width="150"
|
|
|
>
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <div style="margin-bottom: 10px; font-size: 14px">到货明细</div>
|
|
|
- <el-form-item>
|
|
|
- <el-table :data="formData.data.qualityDetailList">
|
|
|
- <el-table-column
|
|
|
- prop="productType"
|
|
|
- label="货品类型"
|
|
|
- :formatter="(row) => (row.productType == 1 ? '产品' : '物料')"
|
|
|
- />
|
|
|
- <el-table-column prop="productCode" label="货品编码" />
|
|
|
- <el-table-column prop="productName" label="货品名称" />
|
|
|
- <el-table-column prop="productSpec" label="规格型号" />
|
|
|
- <el-table-column prop="productUnit" label="单位" />
|
|
|
- <el-table-column prop="count" label="到货数量" />
|
|
|
- <el-table-column prop="sumQualityCount" label="已质检" />
|
|
|
- <el-table-column
|
|
|
- prop="qualifiedCount"
|
|
|
- label="质检合格"
|
|
|
- min-width="150"
|
|
|
- >
|
|
|
- <template #default="{ row, $index }">
|
|
|
- <el-form-item
|
|
|
- :prop="'qualityDetailList.' + $index + '.qualifiedCount'"
|
|
|
- :rules="rules.qualifiedCount"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
- <el-input-number
|
|
|
- v-model="row.qualifiedCount"
|
|
|
- :precision="4"
|
|
|
- :controls="false"
|
|
|
- :min="0"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="noQualifiedCount"
|
|
|
- label="质检不合格"
|
|
|
- min-width="150"
|
|
|
- >
|
|
|
- <template #default="{ row, $index }">
|
|
|
- <el-form-item
|
|
|
- :prop="'qualityDetailList.' + $index + '.noQualifiedCount'"
|
|
|
- :rules="rules.noQualifiedCount"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
- <el-input-number
|
|
|
- v-model="row.noQualifiedCount"
|
|
|
- :precision="4"
|
|
|
- :controls="false"
|
|
|
- :min="0"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <el-form-item
|
|
|
+ :prop="'stockTransferDetailsList.' + $index + '.inQuantity'"
|
|
|
+ :rules="rules.inQuantity"
|
|
|
+ :inline-message="true"
|
|
|
+ >
|
|
|
+ <el-input-number
|
|
|
+ v-model="row.inQuantity"
|
|
|
+ :precision="2"
|
|
|
+ :controls="false"
|
|
|
+ :min="0"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </byForm>
|
|
|
<template #footer>
|
|
|
<el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
|
<el-button
|
|
@@ -150,17 +117,9 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-/* eslint-disable vue/no-unused-components */
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
import byTable from "@/components/byTable/index";
|
|
|
import byForm from "@/components/byForm/index";
|
|
|
-import FileUpload from "@/components/FileUpload/index";
|
|
|
-import { computed, defineComponent, ref, watch } from "vue";
|
|
|
-import { getToken } from "@/utils/auth";
|
|
|
-
|
|
|
-const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 上传文件服务器地址
|
|
|
-const headers = ref({ Authorization: "Bearer " + getToken() });
|
|
|
-const uploadData = ref({});
|
|
|
const loading = ref(false);
|
|
|
const submitLoading = ref(false);
|
|
|
const sourceList = ref({
|
|
@@ -173,7 +132,6 @@ const sourceList = ref({
|
|
|
});
|
|
|
let dialogVisible = ref(false);
|
|
|
let modalType = ref("add");
|
|
|
-let fileList = ref([]);
|
|
|
let rules = ref({
|
|
|
name: [{ required: true, message: "请输入供应商名称", trigger: "blur" }],
|
|
|
qualifiedCount: [
|
|
@@ -214,7 +172,7 @@ const config = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "到货单号",
|
|
|
+ label: "采购单号",
|
|
|
prop: "code",
|
|
|
},
|
|
|
},
|
|
@@ -226,71 +184,36 @@ const config = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "物品类型",
|
|
|
+ label: "物流/快递公司",
|
|
|
prop: "productType",
|
|
|
},
|
|
|
- render(type) {
|
|
|
- return type == 1 ? "产品" : type == 2 ? "物料" : "";
|
|
|
- },
|
|
|
},
|
|
|
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "物品编码",
|
|
|
+ label: "物流/快递单号",
|
|
|
prop: "productCode",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "物品名称",
|
|
|
+ label: "采购员",
|
|
|
prop: "productName",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "规格型号",
|
|
|
+ label: "采购时间",
|
|
|
prop: "productSpec",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "单位",
|
|
|
- prop: "productUnit",
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- attrs: {
|
|
|
- label: "到货数量",
|
|
|
- prop: "count",
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- attrs: {
|
|
|
- label: "质检合格",
|
|
|
- prop: "qualifiedCount",
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- attrs: {
|
|
|
- label: "质检不合格",
|
|
|
- prop: "noQualifiedCount",
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- attrs: {
|
|
|
label: "质检状态",
|
|
|
- prop: "status",
|
|
|
- },
|
|
|
- render(type) {
|
|
|
- return type == 0
|
|
|
- ? "未质检"
|
|
|
- : type == 10
|
|
|
- ? "部分质检"
|
|
|
- : type == 20
|
|
|
- ? "已质检"
|
|
|
- : "";
|
|
|
+ prop: "productUnit",
|
|
|
},
|
|
|
},
|
|
|
+
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "操作",
|
|
@@ -300,19 +223,20 @@ const config = computed(() => {
|
|
|
// 渲染 el-button,一般用在最后一列。
|
|
|
renderHTML(row) {
|
|
|
return [
|
|
|
- {
|
|
|
- attrs: {
|
|
|
- label: "质检",
|
|
|
- type: "primary",
|
|
|
- text: true,
|
|
|
- disabled: row.status == 20,
|
|
|
- },
|
|
|
- el: "button",
|
|
|
- click() {
|
|
|
- selectDataOne.value = [row];
|
|
|
- start(10);
|
|
|
- },
|
|
|
- },
|
|
|
+ row.status == 20
|
|
|
+ ? {
|
|
|
+ attrs: {
|
|
|
+ label: "质检",
|
|
|
+ type: "primary",
|
|
|
+ text: true,
|
|
|
+ },
|
|
|
+ el: "button",
|
|
|
+ click() {
|
|
|
+ selectDataOne.value = [row];
|
|
|
+ start(10);
|
|
|
+ },
|
|
|
+ }
|
|
|
+ : {},
|
|
|
];
|
|
|
},
|
|
|
},
|
|
@@ -328,9 +252,44 @@ const formOption = reactive({
|
|
|
itemWidth: 100,
|
|
|
rules: [],
|
|
|
});
|
|
|
-const formConfig = computed(() => {});
|
|
|
-const formDom = ref(null);
|
|
|
+const formConfig = reactive([
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
+ title: "到货信息",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "outWarehouseId",
|
|
|
+ label: "供应商",
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "inWarehouseId",
|
|
|
+ label: "物流快递信息",
|
|
|
+ placeholder: "物流/快递公司",
|
|
|
+ itemWidth: 20,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "remark",
|
|
|
+ label: " ",
|
|
|
+ itemWidth: 30,
|
|
|
+ placeholder: "物流/快递单号",
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
+ title: "质检明细",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "products",
|
|
|
+ },
|
|
|
+]);
|
|
|
|
|
|
+const byform = ref(null);
|
|
|
const getList = async (req) => {
|
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
|
loading.value = true;
|
|
@@ -353,7 +312,7 @@ const getList = async (req) => {
|
|
|
};
|
|
|
|
|
|
const submitForm = () => {
|
|
|
- formDom.value.validate((valid) => {
|
|
|
+ byform.value.handleSubmit((valid) => {
|
|
|
const list = formData.data.qualityDetailList;
|
|
|
for (let i = 0; i < list.length; i++) {
|
|
|
const e = list[i];
|
|
@@ -394,15 +353,7 @@ const submitForm = () => {
|
|
|
const getDtl = (row) => {
|
|
|
modalType.value = "edit";
|
|
|
dialogVisible.value = true;
|
|
|
-
|
|
|
// proxy.post("/productionProcesses/detail", { id: row.id }).then((res) => {
|
|
|
- // fileList.value = [
|
|
|
- // {
|
|
|
- // id: "",
|
|
|
- // fileName: res.fileName,
|
|
|
- // path: "",
|
|
|
- // },
|
|
|
- // ];
|
|
|
// formData.data = res;
|
|
|
// dialogVisible.value = true;
|
|
|
// });
|
|
@@ -444,24 +395,24 @@ const start = (type) => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-watch(selectData, (newVal, oldVal) => {
|
|
|
- if (newVal.length == 0) {
|
|
|
- sourceList.value.data.forEach((x) => {
|
|
|
- if (x.status < 20) {
|
|
|
- x.isCheck = true;
|
|
|
- } else {
|
|
|
- x.isCheck = false;
|
|
|
- }
|
|
|
- });
|
|
|
- } else if (newVal.length == 1) {
|
|
|
- const current = newVal[0];
|
|
|
- sourceList.value.data.forEach((x) => {
|
|
|
- if (x.arrivalId !== current.arrivalId || x.status == 20) {
|
|
|
- x.isCheck = false;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-});
|
|
|
+// watch(selectData, (newVal, oldVal) => {
|
|
|
+// if (newVal.length == 0) {
|
|
|
+// sourceList.value.data.forEach((x) => {
|
|
|
+// if (x.status < 20) {
|
|
|
+// x.isCheck = true;
|
|
|
+// } else {
|
|
|
+// x.isCheck = false;
|
|
|
+// }
|
|
|
+// });
|
|
|
+// } else if (newVal.length == 1) {
|
|
|
+// const current = newVal[0];
|
|
|
+// sourceList.value.data.forEach((x) => {
|
|
|
+// if (x.arrivalId !== current.arrivalId || x.status == 20) {
|
|
|
+// x.isCheck = false;
|
|
|
+// }
|
|
|
+// });
|
|
|
+// }
|
|
|
+// });
|
|
|
|
|
|
onMounted(() => {});
|
|
|
</script>
|