|
@@ -1,100 +1,56 @@
|
|
|
<template>
|
|
|
<div class="user">
|
|
|
<div class="tree">
|
|
|
- <treeList
|
|
|
- title="物料分类"
|
|
|
- submitType="2"
|
|
|
- :data="treeListData"
|
|
|
- v-model="sourceList.pagination.productClassifyId"
|
|
|
- @change="treeChange"
|
|
|
- @changeTreeList="getTreeList"
|
|
|
- >
|
|
|
+ <treeList title="物料分类" submitType="2" :data="treeListData" v-model="sourceList.pagination.productClassifyId" @change="treeChange"
|
|
|
+ @changeTreeList="getTreeList">
|
|
|
</treeList>
|
|
|
</div>
|
|
|
<div class="content">
|
|
|
- <byTable
|
|
|
- :source="sourceList.data"
|
|
|
- :pagination="sourceList.pagination"
|
|
|
- :config="config"
|
|
|
- :loading="loading"
|
|
|
- highlight-current-row
|
|
|
- :selectConfig="selectConfig"
|
|
|
- :table-events="{
|
|
|
+ <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
|
|
|
+ :selectConfig="selectConfig" :table-events="{
|
|
|
//element talbe事件都能传
|
|
|
select: select,
|
|
|
- }"
|
|
|
- :action-list="[]"
|
|
|
- @get-list="getList"
|
|
|
- >
|
|
|
+ }" :action-list="[]" @get-list="getList">
|
|
|
<template #pic="{ item }">
|
|
|
<div v-if="item.fileList.length > 0">
|
|
|
- <img
|
|
|
- :src="item.fileList[0].fileUrl"
|
|
|
- class="pic"
|
|
|
- @click="handleClickFile(item.fileList[0])"
|
|
|
- />
|
|
|
+ <img :src="item.fileList[0].fileUrl" class="pic" @click="handleClickFile(item.fileList[0])" />
|
|
|
</div>
|
|
|
<div v-else></div>
|
|
|
</template>
|
|
|
</byTable>
|
|
|
</div>
|
|
|
- <el-dialog
|
|
|
- :title="modalType == 'add' ? '添加' : '编辑'"
|
|
|
- v-model="dialogVisible"
|
|
|
- width="500"
|
|
|
- v-loading="loading"
|
|
|
- >
|
|
|
- <byForm
|
|
|
- :formConfig="formConfig"
|
|
|
- :formOption="formOption"
|
|
|
- v-model="formData.data"
|
|
|
- :rules="rules"
|
|
|
- ref="byform"
|
|
|
- >
|
|
|
+ <div class="right">
|
|
|
+ <div style="margin-bottom:30px">
|
|
|
+ <TitleInfo :content="'已选择配件'"></TitleInfo>
|
|
|
+ </div>
|
|
|
+ <el-tag style="margin-right: 10px; margin-bottom: 10px" type="info" v-for="(good, index) in goodList" :key="good.productId">
|
|
|
+ {{ good.productName }}
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+ <el-dialog :title="modalType == 'add' ? '添加' : '编辑'" v-model="dialogVisible" width="500" v-loading="loading">
|
|
|
+ <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
|
|
|
<template #productPic>
|
|
|
<div>
|
|
|
- <el-upload
|
|
|
- v-model:fileList="fileList"
|
|
|
- action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
|
- :data="uploadData"
|
|
|
- list-type="picture-card"
|
|
|
- :on-remove="handleRemove"
|
|
|
- :on-success="handleSuccess"
|
|
|
- :before-upload="handleBeforeUpload"
|
|
|
- >
|
|
|
- <el-icon><Plus /></el-icon>
|
|
|
+ <el-upload v-model:fileList="fileList" action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" :data="uploadData"
|
|
|
+ list-type="picture-card" :on-remove="handleRemove" :on-success="handleSuccess" :before-upload="handleBeforeUpload">
|
|
|
+ <el-icon>
|
|
|
+ <Plus />
|
|
|
+ </el-icon>
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
</template>
|
|
|
</byForm>
|
|
|
<template #footer>
|
|
|
<el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="submitForm('byform')"
|
|
|
- size="large"
|
|
|
- :loading="submitLoading"
|
|
|
- >
|
|
|
+ <el-button type="primary" @click="submitForm('byform')" size="large" :loading="submitLoading">
|
|
|
确 定
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
- <el-dialog
|
|
|
- title="Excel导入"
|
|
|
- v-model="openExcelDialog"
|
|
|
- width="400"
|
|
|
- v-loading="loading"
|
|
|
- >
|
|
|
+ <el-dialog title="Excel导入" v-model="openExcelDialog" width="400" v-loading="loading">
|
|
|
<template #footer>
|
|
|
- <el-button @click="openExcelDialog = false" size="large"
|
|
|
- >取 消</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="submitExcel()"
|
|
|
- size="large"
|
|
|
- :loading="submitLoading"
|
|
|
- >
|
|
|
+ <el-button @click="openExcelDialog = false" size="large">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitExcel()" size="large" :loading="submitLoading">
|
|
|
确 定
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -108,8 +64,16 @@ import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
import byTable from "@/components/byTable/index";
|
|
|
import byForm from "@/components/byForm/index";
|
|
|
import treeList from "@/components/product/treeList";
|
|
|
+import TitleInfo from "@/components/TitleInfo/index.vue";
|
|
|
|
|
|
-import { computed, defineComponent, ref } from "vue";
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
+const props = defineProps({
|
|
|
+ alreadySelectData: Array,
|
|
|
+});
|
|
|
+const goodList = ref([]);
|
|
|
+onMounted(() => {
|
|
|
+ goodList.value = proxy.deepClone(props.alreadySelectData);
|
|
|
+});
|
|
|
const loading = ref(false);
|
|
|
const submitLoading = ref(false);
|
|
|
const materialUnit = ref([]);
|
|
@@ -138,7 +102,6 @@ let rules = ref({
|
|
|
name: [{ required: true, message: "请输入物料名称", trigger: "blur" }],
|
|
|
unit: [{ required: true, message: "请选择单位", trigger: "change" }],
|
|
|
});
|
|
|
-const { proxy } = getCurrentInstance();
|
|
|
const selectConfig = computed(() => {
|
|
|
return [
|
|
|
{
|
|
@@ -473,7 +436,11 @@ const handleClickFile = (file) => {
|
|
|
};
|
|
|
|
|
|
const handleSelect = (row) => {
|
|
|
- proxy.$emit("handleSelect", toRaw(row));
|
|
|
+ goodList.value.push({
|
|
|
+ ...row,
|
|
|
+ productName: row.name,
|
|
|
+ });
|
|
|
+ proxy.$emit("handleSelect", row);
|
|
|
};
|
|
|
|
|
|
const getDict = () => {
|
|
@@ -500,7 +467,12 @@ getDict();
|
|
|
width: 300px;
|
|
|
}
|
|
|
.content {
|
|
|
- width: calc(100% - 320px);
|
|
|
+ width: calc(100% - 320px - 170px);
|
|
|
+ }
|
|
|
+ .right {
|
|
|
+ padding-left: 10px;
|
|
|
+ width: 170px;
|
|
|
+ border-left: 1px solid #eee;
|
|
|
}
|
|
|
}
|
|
|
.pic {
|