|
@@ -39,7 +39,96 @@
|
|
width="800"
|
|
width="800"
|
|
v-loading="loading"
|
|
v-loading="loading"
|
|
>
|
|
>
|
|
- <arrivalAdd></arrivalAdd>
|
|
|
|
|
|
+ <el-form
|
|
|
|
+ :model="formData.data"
|
|
|
|
+ :rules="rules"
|
|
|
|
+ ref="formDom"
|
|
|
|
+ label-position="top"
|
|
|
|
+ >
|
|
|
|
+ <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
|
|
|
|
+ >
|
|
|
|
+ <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
|
|
|
|
+ >
|
|
|
|
+ </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.purchaseDetailList">
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="goodType"
|
|
|
|
+ label="货品类型"
|
|
|
|
+ :formatter="(row) => (row.goodType == 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="productUnit" label="到货数量" />
|
|
|
|
+ <el-table-column prop="productUnit" label="已质检" />
|
|
|
|
+ <el-table-column prop="count" label="质检合格" min-width="150">
|
|
|
|
+ <template #default="{ row, $index }">
|
|
|
|
+ <el-form-item
|
|
|
|
+ :prop="'purchaseDetailList.' + $index + '.count'"
|
|
|
|
+ :rules="rules.count"
|
|
|
|
+ :inline-message="true"
|
|
|
|
+ >
|
|
|
|
+ <el-input-number
|
|
|
|
+ v-model="row.count"
|
|
|
|
+ :precision="4"
|
|
|
|
+ :controls="false"
|
|
|
|
+ :min="0"
|
|
|
|
+ @change="handleChangeAmount"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="count" label="质检不合格" min-width="150">
|
|
|
|
+ <template #default="{ row, $index }">
|
|
|
|
+ <el-form-item
|
|
|
|
+ :prop="'purchaseDetailList.' + $index + '.count'"
|
|
|
|
+ :rules="rules.count"
|
|
|
|
+ :inline-message="true"
|
|
|
|
+ >
|
|
|
|
+ <el-input-number
|
|
|
|
+ v-model="row.count"
|
|
|
|
+ :precision="4"
|
|
|
|
+ :controls="false"
|
|
|
|
+ :min="0"
|
|
|
|
+ @change="handleChangeAmount"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
<template #footer>
|
|
<template #footer>
|
|
<el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
<el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
<el-button
|
|
<el-button
|
|
@@ -60,7 +149,6 @@
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
import byTable from "@/components/byTable/index";
|
|
import byTable from "@/components/byTable/index";
|
|
import byForm from "@/components/byForm/index";
|
|
import byForm from "@/components/byForm/index";
|
|
-import arrivalAdd from "./add.vue";
|
|
|
|
import FileUpload from "@/components/FileUpload/index";
|
|
import FileUpload from "@/components/FileUpload/index";
|
|
import { computed, defineComponent, ref } from "vue";
|
|
import { computed, defineComponent, ref } from "vue";
|
|
import { getToken } from "@/utils/auth";
|
|
import { getToken } from "@/utils/auth";
|
|
@@ -178,7 +266,6 @@ const config = computed(() => {
|
|
prop: "remarks",
|
|
prop: "remarks",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
-
|
|
|
|
{
|
|
{
|
|
attrs: {
|
|
attrs: {
|
|
label: "操作",
|
|
label: "操作",
|
|
@@ -196,7 +283,8 @@ const config = computed(() => {
|
|
},
|
|
},
|
|
el: "button",
|
|
el: "button",
|
|
click() {
|
|
click() {
|
|
- getDtl(row);
|
|
|
|
|
|
+ selectData.value = [row];
|
|
|
|
+ start();
|
|
},
|
|
},
|
|
},
|
|
},
|
|
];
|
|
];
|
|
@@ -206,9 +294,7 @@ const config = computed(() => {
|
|
});
|
|
});
|
|
|
|
|
|
let formData = reactive({
|
|
let formData = reactive({
|
|
- data: {
|
|
|
|
- type: "1",
|
|
|
|
- },
|
|
|
|
|
|
+ data: {},
|
|
});
|
|
});
|
|
const formOption = reactive({
|
|
const formOption = reactive({
|
|
inline: true,
|
|
inline: true,
|
|
@@ -216,51 +302,9 @@ const formOption = reactive({
|
|
itemWidth: 100,
|
|
itemWidth: 100,
|
|
rules: [],
|
|
rules: [],
|
|
});
|
|
});
|
|
-const byform = ref(null);
|
|
|
|
-const formConfig = computed(() => {
|
|
|
|
- return [
|
|
|
|
- {
|
|
|
|
- type: "radio",
|
|
|
|
- prop: "name",
|
|
|
|
- label: "供应商类型",
|
|
|
|
- required: true,
|
|
|
|
- border: true,
|
|
|
|
- data: [
|
|
|
|
- { label: "贸易商", value: "1" },
|
|
|
|
- { label: "工厂", value: "2" },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "input",
|
|
|
|
- prop: "name",
|
|
|
|
- label: "供应商名称",
|
|
|
|
- required: true,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "slot",
|
|
|
|
- slotName: "address",
|
|
|
|
- label: "地址",
|
|
|
|
- required: true,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "slot",
|
|
|
|
- slotName: "contact",
|
|
|
|
- label: "联系信息",
|
|
|
|
- required: true,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "slot",
|
|
|
|
- slotName: "fileSlot",
|
|
|
|
- label: "上传附件",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "input",
|
|
|
|
- label: "备注",
|
|
|
|
- prop: "remakes",
|
|
|
|
- itemType: "textarea",
|
|
|
|
- },
|
|
|
|
- ];
|
|
|
|
-});
|
|
|
|
|
|
+const formConfig = computed(() => {});
|
|
|
|
+const formDom = ref(null);
|
|
|
|
+
|
|
const getList = async (req) => {
|
|
const getList = async (req) => {
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
loading.value = true;
|
|
loading.value = true;
|
|
@@ -275,15 +319,9 @@ const getList = async (req) => {
|
|
}, 200);
|
|
}, 200);
|
|
});
|
|
});
|
|
};
|
|
};
|
|
-// const openModal = () => {
|
|
|
|
-// proxy.$router.push({
|
|
|
|
-
|
|
|
|
-// })
|
|
|
|
-// };
|
|
|
|
|
|
|
|
const submitForm = () => {
|
|
const submitForm = () => {
|
|
- byform.value.handleSubmit((valid) => {
|
|
|
|
- formData.data.fileList = fileList.value;
|
|
|
|
|
|
+ formDom.value.validate((valid) => {
|
|
submitLoading.value = true;
|
|
submitLoading.value = true;
|
|
proxy.post("/productionProcesses/" + modalType.value, formData.data).then(
|
|
proxy.post("/productionProcesses/" + modalType.value, formData.data).then(
|
|
(res) => {
|
|
(res) => {
|
|
@@ -306,53 +344,21 @@ const submitForm = () => {
|
|
|
|
|
|
const getDtl = (row) => {
|
|
const getDtl = (row) => {
|
|
modalType.value = "edit";
|
|
modalType.value = "edit";
|
|
- proxy.post("/productionProcesses/detail", { id: row.id }).then((res) => {
|
|
|
|
- fileList.value = [
|
|
|
|
- {
|
|
|
|
- id: "",
|
|
|
|
- fileName: res.fileName,
|
|
|
|
- path: "",
|
|
|
|
- },
|
|
|
|
- ];
|
|
|
|
- formData.data = res;
|
|
|
|
- dialogVisible.value = true;
|
|
|
|
- });
|
|
|
|
-};
|
|
|
|
-const handleBeforeUpload = async (file) => {
|
|
|
|
- const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
|
|
|
|
- uploadData.value = res.uploadBody;
|
|
|
|
- fileList.value = [
|
|
|
|
- {
|
|
|
|
- id: res.id,
|
|
|
|
- fileName: res.fileName,
|
|
|
|
- path: res.fileUrl,
|
|
|
|
- },
|
|
|
|
- ];
|
|
|
|
-};
|
|
|
|
-const handleClickFile = (row) => {
|
|
|
|
- ElMessage({
|
|
|
|
- message: "数据请求中,请稍后!",
|
|
|
|
- type: "success",
|
|
|
|
- });
|
|
|
|
- let id = row.id;
|
|
|
|
- proxy.post("/fileInfo/getList", { businessIdList: [id] }).then((res) => {
|
|
|
|
- const file = res[id][0];
|
|
|
|
- window.open(file.fileUrl, "_blank");
|
|
|
|
- });
|
|
|
|
-};
|
|
|
|
|
|
+ dialogVisible.value = true;
|
|
|
|
|
|
-const handlePreview = (file) => {
|
|
|
|
- console.log(file);
|
|
|
|
-};
|
|
|
|
-const handleSuccess = (file) => {
|
|
|
|
- console.log(file);
|
|
|
|
-};
|
|
|
|
-const handleRemove = (file) => {
|
|
|
|
- fileList.value = [];
|
|
|
|
-};
|
|
|
|
-const handleClose = (index) => {
|
|
|
|
- fileList.value.splice(index, 1);
|
|
|
|
|
|
+ // proxy.post("/productionProcesses/detail", { id: row.id }).then((res) => {
|
|
|
|
+ // fileList.value = [
|
|
|
|
+ // {
|
|
|
|
+ // id: "",
|
|
|
|
+ // fileName: res.fileName,
|
|
|
|
+ // path: "",
|
|
|
|
+ // },
|
|
|
|
+ // ];
|
|
|
|
+ // formData.data = res;
|
|
|
|
+ // dialogVisible.value = true;
|
|
|
|
+ // });
|
|
};
|
|
};
|
|
|
|
+
|
|
getList();
|
|
getList();
|
|
const selectData = ref([]);
|
|
const selectData = ref([]);
|
|
const selectRow = (data) => {
|
|
const selectRow = (data) => {
|
|
@@ -360,7 +366,9 @@ const selectRow = (data) => {
|
|
};
|
|
};
|
|
|
|
|
|
const start = () => {
|
|
const start = () => {
|
|
- console.log(selectData.value.length, "22");
|
|
|
|
|
|
+ modalType.value = "edit";
|
|
|
|
+ dialogVisible.value = true;
|
|
|
|
+ // console.log(selectData.value.length, "22");
|
|
// if (selectData.value.length > 0) {
|
|
// if (selectData.value.length > 0) {
|
|
// } else {
|
|
// } else {
|
|
// return ElMessage({
|
|
// return ElMessage({
|
|
@@ -369,6 +377,17 @@ const start = () => {
|
|
// });
|
|
// });
|
|
// }
|
|
// }
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+// 获取供应商数据
|
|
|
|
+const supplierData = ref([]);
|
|
|
|
+const getSupplierList = async (req) => {
|
|
|
|
+ proxy
|
|
|
|
+ .post("/supplierInfo/page", { pageNum: 1, pageSize: 9999 })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ supplierData.value = res.rows;
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+getSupplierList();
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|