|
@@ -1,21 +1,29 @@
|
|
<template>
|
|
<template>
|
|
- <avue-crud
|
|
|
|
- ref="crudRef"
|
|
|
|
- v-model:search="search"
|
|
|
|
- v-model="form"
|
|
|
|
- :data="data"
|
|
|
|
- :option="option"
|
|
|
|
- v-model:page="page"
|
|
|
|
- @row-save="createRow"
|
|
|
|
- @row-update="updateRow"
|
|
|
|
- @row-del="deleteRow"
|
|
|
|
- @selection-change="selectionChange"
|
|
|
|
- @sortable-change="onSortChange"
|
|
|
|
- @search-change="searchChange"
|
|
|
|
- @search-reset="resetChange"
|
|
|
|
- @size-change="dataList"
|
|
|
|
- @current-change="dataList"
|
|
|
|
- />
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <avue-crud
|
|
|
|
+ ref="crudRef"
|
|
|
|
+ v-model:search="search"
|
|
|
|
+ v-model="form"
|
|
|
|
+ :data="data"
|
|
|
|
+ :option="option"
|
|
|
|
+ v-model:page="page"
|
|
|
|
+ @row-save="createRow"
|
|
|
|
+ @row-update="updateRow"
|
|
|
|
+ @row-del="deleteRow"
|
|
|
|
+ @selection-change="selectionChange"
|
|
|
|
+ @sortable-change="onSortChange"
|
|
|
|
+ @search-change="searchChange"
|
|
|
|
+ @search-reset="resetChange"
|
|
|
|
+ @size-change="dataList"
|
|
|
|
+ @current-change="dataList"
|
|
|
|
+ />
|
|
|
|
+ <CommonTable
|
|
|
|
+ ref="commonTableRef"
|
|
|
|
+ :tableTitle="tableTitle"
|
|
|
|
+ :tableType="commonTableType"
|
|
|
|
+ @selected-sure="onSelectedFinish"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
<script setup>
|
|
<script setup>
|
|
import { ref, getCurrentInstance } from "vue";
|
|
import { ref, getCurrentInstance } from "vue";
|
|
@@ -50,7 +58,11 @@ const { selectionChange, multipleUpdate } = Methords; //选中和批量删除事
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
|
|
|
const startCreat = () => {
|
|
const startCreat = () => {
|
|
- crudRef.value && crudRef.value.rowAdd();
|
|
|
|
|
|
+ if (props.tableType === "wuliaocaiji") {
|
|
|
|
+ commonTableRef.value && commonTableRef.value.startSelect();
|
|
|
|
+ } else {
|
|
|
|
+ crudRef.value && crudRef.value.rowAdd();
|
|
|
|
+ }
|
|
};
|
|
};
|
|
|
|
|
|
const saveSortData = async () => {
|
|
const saveSortData = async () => {
|
|
@@ -65,6 +77,21 @@ const onSortChange = () => {
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+// ============公共弹窗table选择相关,物料采集等使用===============
|
|
|
|
+const commonTableRef = ref({});
|
|
|
|
+const commonTableType = ref("MARTERIAL");
|
|
|
|
+const onSelectedFinish = (itemValue) => {
|
|
|
|
+ crudRef.value && crudRef.value.rowAdd();
|
|
|
|
+ if (props.tableType === "wuliaocaiji") {
|
|
|
|
+ form.value.itemName = itemValue.materialName;
|
|
|
|
+ form.value.itemCode = itemValue.materialCode;
|
|
|
|
+ form.value.itemModel = itemValue.spec;
|
|
|
|
+ form.value.num = 1;
|
|
|
|
+ form.value.traceType = "S";
|
|
|
|
+ form.value.unit = itemValue.unitDictValue;
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
url.value = tableConfig[props.tableType].url;
|
|
url.value = tableConfig[props.tableType].url;
|
|
option.value = Object.assign(option.value, {
|
|
option.value = Object.assign(option.value, {
|
|
@@ -83,9 +110,10 @@ watch(
|
|
console.log("faslegb");
|
|
console.log("faslegb");
|
|
url.value = tableConfig[props.tableType].url;
|
|
url.value = tableConfig[props.tableType].url;
|
|
option.value = Object.assign(option.value, {
|
|
option.value = Object.assign(option.value, {
|
|
- menu: false,
|
|
|
|
- highlightCurrentRow: true,
|
|
|
|
addBtn: false,
|
|
addBtn: false,
|
|
|
|
+ searchShow: false,
|
|
|
|
+ header: false,
|
|
|
|
+ sortable: true,
|
|
column: tableConfig[props.tableType].column,
|
|
column: tableConfig[props.tableType].column,
|
|
});
|
|
});
|
|
dataList();
|
|
dataList();
|