|
@@ -1,22 +1,19 @@
|
|
|
<template>
|
|
|
-
|
|
|
-
|
|
|
<div class="mainContentBox">
|
|
|
<avue-form
|
|
|
ref="formRef"
|
|
|
v-model="form"
|
|
|
:option="option"
|
|
|
@submit="rowSave"
|
|
|
- >
|
|
|
-
|
|
|
- </avue-form>
|
|
|
+ />
|
|
|
<avue-crud
|
|
|
ref="crudRef"
|
|
|
- v-model:search="search"
|
|
|
v-model="form"
|
|
|
+ v-model:page="page"
|
|
|
+ v-model:search="search"
|
|
|
:data="data"
|
|
|
:option="option"
|
|
|
- v-model:page="page"
|
|
|
+ search-option="false"
|
|
|
@row-save="createRow"
|
|
|
@row-update="updateRow"
|
|
|
@row-del="deleteRow"
|
|
@@ -25,17 +22,16 @@
|
|
|
@size-change="dataList"
|
|
|
@current-change="dataList"
|
|
|
@selection-change="selectionChange"
|
|
|
- search-option="false"
|
|
|
>
|
|
|
<template #menu-left="{ size }">
|
|
|
<el-button
|
|
|
:disabled="toDeleteIds.length < 1"
|
|
|
- type="danger"
|
|
|
- icon="el-icon-delete"
|
|
|
:size="size"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ type="danger"
|
|
|
@click="multipleDelete"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
<CommonTable
|
|
@@ -45,146 +41,148 @@
|
|
|
@selected-sure="onSelectedFinish"
|
|
|
/>
|
|
|
</div>
|
|
|
-
|
|
|
</template>
|
|
|
-<script setup lang="ts">
|
|
|
- import { ref, getCurrentInstance } from "vue";
|
|
|
- import { useCrud } from "@/hooks/userCrud";
|
|
|
- import ButtonPermKeys from "@/common/configs/buttonPermission";
|
|
|
- import { useCommonStoreHook } from "@/store";
|
|
|
+<script lang="ts" setup>
|
|
|
+import { ref, getCurrentInstance } from "vue";
|
|
|
+import { useCrud } from "@/hooks/userCrud";
|
|
|
+import ButtonPermKeys from "@/common/configs/buttonPermission";
|
|
|
+import { useCommonStoreHook } from "@/store";
|
|
|
|
|
|
- const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
|
- import { useDictionaryStore } from "@/store";
|
|
|
- import {
|
|
|
- addStationDevice,
|
|
|
- } from "@/api/station";
|
|
|
- const test = () => {
|
|
|
- isShowTable.value = true;
|
|
|
- tableType.value = tableType.value == 1 ? 2 : 1;
|
|
|
- };
|
|
|
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
|
+import { useDictionaryStore } from "@/store";
|
|
|
+import { addStationDevice } from "@/api/station";
|
|
|
|
|
|
- // 传入一个url,后面不带/
|
|
|
- const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
- useCrud({
|
|
|
- src: "/api/v1/base/capacity",
|
|
|
- });
|
|
|
- const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
|
- Methords; //增删改查
|
|
|
- const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
|
- const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
|
- // checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
|
|
|
- // const permission = reactive({
|
|
|
- // delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
|
|
|
- // addBtn: checkPerm(buttonPermission.PLAN.BTNS.order_add),
|
|
|
- // editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
|
|
|
- // menu: true,
|
|
|
- // });
|
|
|
- function rowSave(form,done,loading) {
|
|
|
- console.info(form);
|
|
|
- createRow(form,done,loading);
|
|
|
-
|
|
|
- }
|
|
|
- const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
+const test = () => {
|
|
|
+ isShowTable.value = true;
|
|
|
+ tableType.value = tableType.value == 1 ? 2 : 1;
|
|
|
+};
|
|
|
|
|
|
- onMounted(() => {
|
|
|
- // console.log("crudRef", crudRef)
|
|
|
- search.value.productionLineId=props.productionLineId;
|
|
|
- dataList();
|
|
|
+// 传入一个url,后面不带/
|
|
|
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
+ useCrud({
|
|
|
+ src: "/api/v1/base/capacity",
|
|
|
});
|
|
|
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
|
+ Methords; //增删改查
|
|
|
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
|
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
|
+// checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
|
|
|
+// const permission = reactive({
|
|
|
+// delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
|
|
|
+// addBtn: checkPerm(buttonPermission.PLAN.BTNS.order_add),
|
|
|
+// editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
|
|
|
+// menu: true,
|
|
|
+// });
|
|
|
+function rowSave(form, done) {
|
|
|
+ createRow(form, done, done);
|
|
|
+}
|
|
|
|
|
|
- /**
|
|
|
- * 上传excel相关
|
|
|
- */
|
|
|
- const uploadRef = ref(null);
|
|
|
- const uploadFinished = () => {
|
|
|
- // 上传完成后的刷新操作
|
|
|
- page.currentPage = 1;
|
|
|
- dataList();
|
|
|
- };
|
|
|
- const importExcelData = () => {
|
|
|
- if (uploadRef.value) {
|
|
|
- uploadRef.value.show("/api/v1/base/stationDevice");
|
|
|
- }
|
|
|
- };
|
|
|
- const ctableRef=ref(null);
|
|
|
- const deviceList=()=>{
|
|
|
- ctableRef.value.startSelect();
|
|
|
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ // console.log("crudRef", crudRef)
|
|
|
+ search.value.productionLineId = props.productionLineId;
|
|
|
+ dataList();
|
|
|
+});
|
|
|
+
|
|
|
+/**
|
|
|
+ * 上传excel相关
|
|
|
+ */
|
|
|
+const uploadRef = ref(null);
|
|
|
+const uploadFinished = () => {
|
|
|
+ // 上传完成后的刷新操作
|
|
|
+ page.currentPage = 1;
|
|
|
+ dataList();
|
|
|
+};
|
|
|
+const importExcelData = () => {
|
|
|
+ if (uploadRef.value) {
|
|
|
+ uploadRef.value.show("/api/v1/base/stationDevice");
|
|
|
}
|
|
|
- // 设置表格列或者其他自定义的option
|
|
|
- option.value = Object.assign(option.value, {
|
|
|
- selection: true,
|
|
|
- labelWidth: 200,
|
|
|
- span: 20,
|
|
|
- column: [{
|
|
|
+};
|
|
|
+const ctableRef = ref(null);
|
|
|
+const deviceList = () => {
|
|
|
+ ctableRef.value.startSelect();
|
|
|
+};
|
|
|
+// 设置表格列或者其他自定义的option
|
|
|
+option.value = Object.assign(option.value, {
|
|
|
+ selection: true,
|
|
|
+ labelWidth: 200,
|
|
|
+ span: 20,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
label: "物料编号",
|
|
|
prop: "materialCode",
|
|
|
- display:false,
|
|
|
+ display: false,
|
|
|
},
|
|
|
- {
|
|
|
- label: "物料名称",
|
|
|
- prop: "materialName",
|
|
|
- rules: [{
|
|
|
+ {
|
|
|
+ label: "物料名称",
|
|
|
+ prop: "materialName",
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
required: true,
|
|
|
message: "请选择物料名称",
|
|
|
- trigger: "blur"
|
|
|
- }],
|
|
|
- click: ({ value, column }) => {
|
|
|
- ctableRef.value.startSelect();
|
|
|
-
|
|
|
+ trigger: "change",
|
|
|
},
|
|
|
+ ],
|
|
|
+ click: ({ value, column }) => {
|
|
|
+ ctableRef.value.startSelect();
|
|
|
},
|
|
|
- {
|
|
|
- label: "产线",
|
|
|
- prop: "productionLineName",
|
|
|
- display:false,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "产线id",
|
|
|
- prop: "productionLineId",
|
|
|
- display:false,
|
|
|
- hide:true
|
|
|
- },
|
|
|
- {
|
|
|
- label: "产能",
|
|
|
- prop: "capacity",
|
|
|
- type:"number",
|
|
|
- rules: [{
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "产线",
|
|
|
+ prop: "productionLineName",
|
|
|
+ display: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "产线id",
|
|
|
+ prop: "productionLineId",
|
|
|
+ display: false,
|
|
|
+ hide: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "产能",
|
|
|
+ prop: "capacity",
|
|
|
+ type: "number",
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
required: true,
|
|
|
message: "请填写产能",
|
|
|
- trigger: "blur"
|
|
|
- }],
|
|
|
- },
|
|
|
- {
|
|
|
- label: "最小齐套数",
|
|
|
- prop: "minCapacity",
|
|
|
- type:"number",
|
|
|
- rules: [{
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "最小齐套数",
|
|
|
+ prop: "minCapacity",
|
|
|
+ type: "number",
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
required: true,
|
|
|
message: "请填写产能",
|
|
|
- trigger: "blur"
|
|
|
- }],
|
|
|
- },],
|
|
|
- delBtn: false,
|
|
|
- editBtn: false,
|
|
|
- viewBtn: false,
|
|
|
- addBtn:false,
|
|
|
- menu: false,
|
|
|
- });
|
|
|
- const props = defineProps({
|
|
|
- productionLineId: {
|
|
|
- type: Number,
|
|
|
- default: () => {
|
|
|
- return 0;
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- const onSelectedFinish=(selectedValue)=>{
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ delBtn: false,
|
|
|
+ editBtn: false,
|
|
|
+ viewBtn: false,
|
|
|
+ addBtn: false,
|
|
|
+ menu: false,
|
|
|
+});
|
|
|
+const props = defineProps({
|
|
|
+ productionLineId: {
|
|
|
+ type: Number,
|
|
|
+ default: () => {
|
|
|
+ return 0;
|
|
|
+ },
|
|
|
+ },
|
|
|
+});
|
|
|
|
|
|
- form.value.materialCode=selectedValue.materialCode;
|
|
|
- form.value.materialName=selectedValue.materialName;
|
|
|
+const onSelectedFinish = (selectedValue) => {
|
|
|
+ form.value.materialCode = selectedValue.materialCode;
|
|
|
+ form.value.materialName = selectedValue.materialName;
|
|
|
|
|
|
- form.value.productionLineId=props.productionLineId;
|
|
|
- }
|
|
|
+ form.value.productionLineId = props.productionLineId;
|
|
|
+};
|
|
|
</script>
|
|
|
-
|