123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- <template>
- <div class="form">
- <van-nav-bar :title="'生产订单详情'" :left-text="$t('common.back')" left-arrow @click-left="onClickLeft">
- </van-nav-bar>
- <testForm v-model="formData.data" :formOption="formOption" :formConfig="formConfig" :rules="rules" @onSubmit="onSubmit" ref="formDom"></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: {},
- });
- const rules = {
- contractId: [
- {
- required: true,
- message: proxy.t("claim.contractCanNotBeEmpty"),
- },
- ],
- money: [
- {
- required: true,
- message: proxy.t("claim.relatedAmountCanNotBeEmpty"),
- },
- ],
- };
- const formOption = reactive({
- readonly: true, //用于控制整个表单是否只读
- disabled: false,
- labelAlign: "top",
- scroll: true,
- labelWidth: "62pk",
- submitBtnText: proxy.t("common.submit"),
- hiddenSubmitBtn: true,
- btnConfig: {
- isNeed: false,
- listTitle: "产品生产进度",
- prop: "produceOrderDetailList",
- plain: true,
- listConfig: [
- {
- type: "input",
- itemType: "text",
- label: "产品编码",
- prop: "productCode",
- },
- {
- type: "input",
- itemType: "text",
- label: "产品名称",
- prop: "productName",
- },
- {
- type: "input",
- itemType: "text",
- label: "产品数量",
- prop: "quantity",
- },
- {
- type: "input",
- itemType: "text",
- label: "完成数量",
- prop: "finishQuantity",
- },
- ],
- clickFn: () => {},
- },
- });
- const statusData = ref([
- {
- label: "未开始",
- value: "0",
- },
- {
- label: "进行中",
- value: "1",
- },
- {
- label: "已完成",
- value: "2",
- },
- ]);
- const contractProdTag = ref([]);
- const getDict = () => {
- proxy.getDictOne(["contract_prod_tag"]).then((res) => {
- contractProdTag.value = res["contract_prod_tag"].data.map((x) => ({
- label: x.dictValue,
- value: x.dictKey,
- }));
- formData.data.produceStatusName = proxy.dictValueLabel(
- formData.data.produceStatus,
- statusData.value
- );
- if (formData.data.prodTag) {
- formData.data.prodTagName = "";
- formData.data.prodTags = formData.data.prodTag.split(",");
- if (formData.data.prodTags && formData.data.prodTags.length > 0) {
- formData.data.prodTags.map((x, index) => {
- formData.data.prodTagName +=
- " " + proxy.dictValueLabel(x, contractProdTag.value);
- });
- }
- }
- });
- };
- const formConfig = reactive([
- {
- type: "input",
- label: "生产公司",
- prop: "companyName",
- itemType: "text",
- readonly: true,
- },
- {
- type: "input",
- label: "订单号",
- prop: "code",
- itemType: "text",
- readonly: true,
- },
- {
- type: "input",
- label: "下单时间",
- prop: "createTime",
- itemType: "text",
- readonly: true,
- },
- {
- type: "input",
- label: "交期",
- prop: "deliveryPeriod",
- itemType: "text",
- readonly: true,
- },
- {
- type: "input",
- label: "投产时间",
- prop: "produceTime",
- itemType: "text",
- readonly: true,
- },
- {
- type: "input",
- label: "生产状态",
- prop: "produceStatusName",
- itemType: "text",
- readonly: true,
- },
- {
- type: "input",
- label: "生产指示",
- prop: "prodTagName",
- itemType: "text",
- readonly: true,
- },
- ]);
- const onClickLeft = () => history.back();
- onMounted(() => {
- if (route.query && route.query.data) {
- formData.data = JSON.parse(route.query.data);
- getDict();
- }
- });
- </script>
- <style lang="scss" scoped>
- </style>
|