|
@@ -32,6 +32,11 @@
|
|
|
<el-form-item label="图稿名称:" prop="artworkName">
|
|
|
<el-input v-model="formData.data.artworkName" placeholder="请输入图稿名称" :maxlength="300" />
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="事业部:" prop="departmentId" v-if="proxy.useUserStore().user.deptId === '100'">
|
|
|
+ <el-select v-model="formData.data.departmentId" placeholder="请选择事业部" style="width: 100%" clearable>
|
|
|
+ <el-option v-for="item in departmentList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="图稿文件:" required style="width: 100%">
|
|
|
<el-upload
|
|
|
v-model:fileList="fileList"
|
|
@@ -70,11 +75,13 @@
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
+const departmentList = ref([]);
|
|
|
const sourceList = ref({
|
|
|
pagination: {
|
|
|
total: 0,
|
|
|
pageNum: 1,
|
|
|
pageSize: 30,
|
|
|
+ departmentId: proxy.useUserStore().user.deptId === "100" ? "" : proxy.useUserStore().user.deptId,
|
|
|
},
|
|
|
});
|
|
|
const tableData = ref([]);
|
|
@@ -91,6 +98,19 @@ const load = () => {
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
+const getDemandData = () => {
|
|
|
+ proxy.post("/department/page", { pageNum: 1, pageSize: 999 }).then((res) => {
|
|
|
+ if (res.rows && res.rows.length > 0) {
|
|
|
+ departmentList.value = res.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ dictKey: item.id,
|
|
|
+ dictValue: item.name,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+getDemandData();
|
|
|
const modalType = ref("add");
|
|
|
const openDialog = ref(false);
|
|
|
const formData = reactive({
|
|
@@ -98,6 +118,7 @@ const formData = reactive({
|
|
|
});
|
|
|
const rules = ref({
|
|
|
artworkName: [{ required: true, message: "请输入图稿名称", trigger: "blur" }],
|
|
|
+ departmentId: [{ required: true, message: "请选择事业部", trigger: "change" }],
|
|
|
});
|
|
|
const uploadData = ref({});
|
|
|
const fileList = ref([]);
|
|
@@ -150,6 +171,9 @@ const submitForm = () => {
|
|
|
formData.data.fileId = fileList.value[0].raw.id;
|
|
|
formData.data.fileName = fileList.value[0].raw.fileName;
|
|
|
formData.data.fileUrl = fileList.value[0].raw.fileUrl;
|
|
|
+ if (proxy.useUserStore().user.deptId !== "100") {
|
|
|
+ formData.data.departmentId = proxy.useUserStore().user.deptId;
|
|
|
+ }
|
|
|
proxy.post("/artworkLibrary/" + modalType.value, formData.data).then(() => {
|
|
|
ElMessage({
|
|
|
message: modalType.value == "add" ? "添加成功" : "编辑成功",
|
|
@@ -186,7 +210,6 @@ const clickUpdate = (row) => {
|
|
|
url: row.fileUrl,
|
|
|
},
|
|
|
];
|
|
|
- console.log(fileList.value, formData.data);
|
|
|
openDialog.value = true;
|
|
|
};
|
|
|
const clickDelete = (row) => {
|