feat: 增加提交素材
This commit is contained in:
@ -31,11 +31,14 @@
|
|||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="120" align="center">
|
<el-table-column label="操作" width="200" align="center">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button type="text" size="small" @click="updateStatus(row)" :disabled="updateDis(row)">
|
<el-button type="text" size="small" @click="updateStatus(row)" :disabled="updateDis(row)">
|
||||||
修改状态
|
修改状态
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button type="text" size="small" @click="submitMaterial(row)" :disabled="updateDis(row)">
|
||||||
|
提交素材
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -67,6 +70,24 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 提交素材弹框 -->
|
||||||
|
<div class="dialog" v-if="materialDialog">
|
||||||
|
<div class="head_box">
|
||||||
|
<span class="title">提交素材</span>
|
||||||
|
<div>
|
||||||
|
<el-button type="primary" size="small" :loading="materialLoading" @click="submitMaterialAction">保存</el-button>
|
||||||
|
<el-button size="small" @click="closeMaterialDialog">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form_cnt">
|
||||||
|
<el-form :model="materialForm" label-width="80px">
|
||||||
|
<el-form-item label="附件">
|
||||||
|
<UploadFile v-model="materialForm.fj" :limit="2" :isImg="false" :isAll="true" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@ -74,7 +95,7 @@ import FormMessage from "@/components/aboutTable/FormMessage.vue";
|
|||||||
import UploadFile from "@/components/MyComponents/Upload/index.vue";
|
import UploadFile from "@/components/MyComponents/Upload/index.vue";
|
||||||
// import ChooseUser from "@/components/ChooseList/ChooseUser/index.vue"
|
// import ChooseUser from "@/components/ChooseList/ChooseUser/index.vue"
|
||||||
import { ref, defineExpose, reactive, defineEmits, getCurrentInstance, watch, computed } from "vue";
|
import { ref, defineExpose, reactive, defineEmits, getCurrentInstance, watch, computed } from "vue";
|
||||||
import { sjzlAddEntity, sjzlEditEntity, sjzlGetInfo, sjzlPerfectlnfo, sjzlFstz, sjzlQryp } from '@//api/yj.js'
|
import { sjzlAddEntity, sjzlEditEntity, sjzlGetInfo, sjzlPerfectlnfo, sjzlFstz, sjzlQryp, sjzlPerfectSorce } from '@//api/yj.js'
|
||||||
import { getItem } from '@//utils/storage.js'
|
import { getItem } from '@//utils/storage.js'
|
||||||
|
|
||||||
const emit = defineEmits(["updateDate", "getList"]);
|
const emit = defineEmits(["updateDate", "getList"]);
|
||||||
@ -105,6 +126,13 @@ const statusDialog = ref(false) // 修改状态弹框
|
|||||||
const statusLoading = ref(false)
|
const statusLoading = ref(false)
|
||||||
const statusForm = ref({ fj: [] }) // 修改状态表单
|
const statusForm = ref({ fj: [] }) // 修改状态表单
|
||||||
const currentRow = ref({}) // 当前操作的行
|
const currentRow = ref({}) // 当前操作的行
|
||||||
|
|
||||||
|
// 提交素材相关
|
||||||
|
const materialDialog = ref(false) // 提交素材弹框
|
||||||
|
const materialLoading = ref(false)
|
||||||
|
const materialForm = ref({ fj: [] }) // 提交素材表单
|
||||||
|
const materialRow = ref({}) // 当前操作的行
|
||||||
|
|
||||||
/** 外面行数据 */
|
/** 外面行数据 */
|
||||||
const outRow = ref({})
|
const outRow = ref({})
|
||||||
const noticeLoading = ref(false) // 下发通知加载状态
|
const noticeLoading = ref(false) // 下发通知加载状态
|
||||||
@ -304,6 +332,44 @@ const closeStatusDialog = () => {
|
|||||||
statusLoading.value = false
|
statusLoading.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 提交素材
|
||||||
|
const submitMaterial = (row) => {
|
||||||
|
const cyypList = Array.isArray(listQuery.value.cyypList) ? listQuery.value.cyypList : []
|
||||||
|
/** 找原来的对象 */
|
||||||
|
const curr = cyypList.find(item2 => item2.ypbmdm == row.ypbmdm) || {}
|
||||||
|
materialRow.value = { ...curr, row }
|
||||||
|
materialForm.value = { fj: [] }
|
||||||
|
materialDialog.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交素材操作
|
||||||
|
const submitMaterialAction = async () => {
|
||||||
|
try {
|
||||||
|
materialLoading.value = true
|
||||||
|
const params = {
|
||||||
|
id: materialRow.value.id,
|
||||||
|
fj: materialForm.value.fj?.length > 0 ? getFjString(materialForm.value.fj) : '',
|
||||||
|
}
|
||||||
|
|
||||||
|
const res = await sjzlPerfectSorce(params)
|
||||||
|
proxy.$message({ type: "success", message: "提交素材成功" })
|
||||||
|
|
||||||
|
closeMaterialDialog()
|
||||||
|
if (outRow.value.id) { getDataById(outRow.value.id) }
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
} finally {
|
||||||
|
materialLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭提交素材弹框
|
||||||
|
const closeMaterialDialog = () => {
|
||||||
|
materialDialog.value = false
|
||||||
|
materialForm.value = { fj: [] }
|
||||||
|
materialLoading.value = false
|
||||||
|
}
|
||||||
|
|
||||||
// 下发通知
|
// 下发通知
|
||||||
const sendNotice = () => {
|
const sendNotice = () => {
|
||||||
proxy.$confirm('确认下发通知?', '提示', {
|
proxy.$confirm('确认下发通知?', '提示', {
|
||||||
|
|||||||
Reference in New Issue
Block a user