|
@@ -0,0 +1,202 @@
|
|
|
+<template>
|
|
|
+ <div class="form" style="padding-bottom: 60px">
|
|
|
+ <van-nav-bar
|
|
|
+ title="任务流转"
|
|
|
+ left-text="返回"
|
|
|
+ left-arrow
|
|
|
+ @click-left="onClickLeft"
|
|
|
+ >
|
|
|
+ </van-nav-bar>
|
|
|
+ <testForm
|
|
|
+ v-model="formData.data"
|
|
|
+ :formOption="formOption"
|
|
|
+ :formConfig="formConfig"
|
|
|
+ :rules="rules"
|
|
|
+ @onSubmit="onSubmit"
|
|
|
+ ref="formDom"
|
|
|
+ >
|
|
|
+ <template #file>
|
|
|
+ <div>aa</div>
|
|
|
+ </template>
|
|
|
+ </testForm>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { ref, reactive, getCurrentInstance, onMounted } from "vue";
|
|
|
+import { showSuccessToast, showFailToast } from "vant";
|
|
|
+import { useRoute } from "vue-router";
|
|
|
+import testForm from "@/components/testForm/index.vue";
|
|
|
+const proxy = getCurrentInstance().proxy;
|
|
|
+const route = useRoute();
|
|
|
+const formDom = ref(null);
|
|
|
+const formData = reactive({
|
|
|
+ data: {
|
|
|
+ list: [],
|
|
|
+ },
|
|
|
+});
|
|
|
+const rules = {
|
|
|
+ warehouseName: [{ required: true, message: "仓库名称不能为空" }],
|
|
|
+ productName: [{ required: true, message: "物品名称不能为空" }],
|
|
|
+ quantity: [{ required: true, message: "入库数量不能为空" }],
|
|
|
+};
|
|
|
+const formOption = reactive({
|
|
|
+ readonly: false, //用于控制整个表单是否只读
|
|
|
+ disabled: false,
|
|
|
+ labelAlign: "top",
|
|
|
+ scroll: true,
|
|
|
+ labelWidth: "62pk",
|
|
|
+ submitBtnText: "提交",
|
|
|
+ btnConfig: {
|
|
|
+ isNeed: false,
|
|
|
+ prop: "list",
|
|
|
+ plain: true,
|
|
|
+ listTitle: "",
|
|
|
+ listConfig: [],
|
|
|
+ clickFn: () => {},
|
|
|
+ },
|
|
|
+});
|
|
|
+const formConfig = ref([]);
|
|
|
+const getDict = () => {
|
|
|
+ proxy.get("/system/user/list?pageNum=1&pageSize=9999").then((res) => {
|
|
|
+ formConfig.value[6].data = res.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ label: item.userName,
|
|
|
+ value: item.userId,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const onClickLeft = () => history.back();
|
|
|
+const onSubmit = () => {
|
|
|
+ proxy.post("/productionTask/add", formData.data).then(
|
|
|
+ (res) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ showSuccessToast("添加成功");
|
|
|
+ proxy.$router.push("/main/task");
|
|
|
+ }, 500);
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ return showFailToast(err.message);
|
|
|
+ }
|
|
|
+ );
|
|
|
+};
|
|
|
+const getDetails = () => {
|
|
|
+ proxy.post("/productionTask/detail", { id: route.query.id }).then(
|
|
|
+ (res) => {
|
|
|
+ console.log(res, "ada");
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ return showFailToast(err.message);
|
|
|
+ }
|
|
|
+ );
|
|
|
+};
|
|
|
+const configData = [
|
|
|
+ [
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ label: "产品名称",
|
|
|
+ prop: "reamlke",
|
|
|
+ readonly: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ label: "产品SN",
|
|
|
+ prop: "reamlke",
|
|
|
+ readonly: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ label: "当前工序",
|
|
|
+ prop: "reamlke",
|
|
|
+ readonly: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ label: "工序图纸",
|
|
|
+ slotName: "file",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
+ title: "任务流转",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ label: "目标工序",
|
|
|
+ prop: "reamlke",
|
|
|
+ readonly: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "picker",
|
|
|
+ label: "负责人",
|
|
|
+ prop: "warehouseId",
|
|
|
+ itemType: "onePicker",
|
|
|
+ showPicker: false,
|
|
|
+ fieldNames: {
|
|
|
+ text: "label",
|
|
|
+ value: "value",
|
|
|
+ },
|
|
|
+ data: [],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ label: "产品名称",
|
|
|
+ prop: "reamlke",
|
|
|
+ readonly: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ label: "产品SN",
|
|
|
+ prop: "reamlke",
|
|
|
+ readonly: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ label: "当前工序",
|
|
|
+ prop: "reamlke",
|
|
|
+ readonly: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ label: "工序图纸",
|
|
|
+ slotName: "file",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+];
|
|
|
+onMounted(() => {
|
|
|
+ if (route.query.type === "10") {
|
|
|
+ formConfig.value = configData[0];
|
|
|
+ formOption.submitBtnText = "提交";
|
|
|
+ getDict();
|
|
|
+ } else {
|
|
|
+ formConfig.value = configData[0];
|
|
|
+ formOption.submitBtnText = "提交入库";
|
|
|
+ }
|
|
|
+});
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.row {
|
|
|
+ display: flex;
|
|
|
+ padding: 5px 10px 0 10px;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ .title {
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+ .delete {
|
|
|
+ width: 20px;
|
|
|
+ cursor: pointer;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|