| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409 |
- <template>
- <div>
- <el-card class="mb20">
- <template #header>
- <div class="card-header">
- <span>证书办理服务介绍</span>
- </div>
- </template>
- <div class="df">
- <div>
- <el-image
- v-if="certOperationIntroduce.imageUrl"
- class="mb10"
- style="width: 200px; height: 200px"
- fit="cover"
- :preview-src-list="[certOperationIntroduce.imageUrl]"
- :src="certOperationIntroduce.imageUrl"
- ></el-image>
- <el-upload
- class="df aic jcfe"
- :action="
- store.state.baseurl +
- '/sys/basic/config/ship/upload/introduce/img'
- "
- :show-file-list="false"
- :data="{ configType: 1 }"
- :on-success="
- (res) => uploadCertSuccess(res, certOperationIntroduce)
- "
- >
- <el-button type="primary">
- {{ certOperationIntroduce.imageUrl ? "重新" : "" }}上传图片
- </el-button>
- </el-upload>
- </div>
- <div class="ml20">
- <div style="margin-bottom: 15px">
- <el-input
- type="textarea"
- v-model="certOperationIntroduce.textContent"
- placeholder="请输入证书办理服务介绍"
- style="width: 400px; height: 200px"
- ></el-input>
- </div>
- <div class="df jcfe">
- <el-button
- type="primary"
- @click="updateShipIntroduceContent(1, certOperationIntroduce)"
- >
- 更新证书办理服务介绍
- </el-button>
- </div>
- </div>
- </div>
- </el-card>
- <el-card class="mb20">
- <template #header>
- <div class="card-header df aic">
- <span class="mr10">证书办理联系人</span>
- <el-button type="primary" @click="addShipContact">
- 添加联系人
- </el-button>
- </div>
- <el-dialog v-model="showModifyDialog" title="修改联系人" width="500px">
- <el-form
- class="ml20 mt20"
- :model="modifyForm"
- :rules="formRules"
- label-width="100px"
- >
- <el-form-item class="mb20" label="办事处" prop="officeName">
- <el-input class="w300" v-model="modifyForm.officeName" />
- </el-form-item>
- <el-form-item class="mb20" label="联系人" prop="contactPerson">
- <el-input class="w300" v-model="modifyForm.contactPerson" />
- </el-form-item>
- <el-form-item class="mb20" label="手机号" prop="contactPhone">
- <el-input class="w300" v-model="modifyForm.contactPhone" />
- </el-form-item>
- </el-form>
- <template #footer>
- <div class="df aic jcfe mb10" style="padding-right: 50px">
- <el-button @click="showModifyDialog = false">取消</el-button>
- <el-button type="primary" @click="submitModifyForm">
- 确定
- </el-button>
- </div>
- </template>
- </el-dialog>
- </template>
- <el-table :data="shipCertOperationList" style="width: 800px" border>
- <el-table-column type="index" label="序号" width="60" align="center" />
- <el-table-column prop="officeName" label="办事处" align="center" />
- <el-table-column
- prop="contactPerson"
- label="联系人"
- width="160"
- align="center"
- />
- <el-table-column
- prop="contactPhone"
- label="手机号"
- width="160"
- align="center"
- />
- <el-table-column label="操作" width="180" align="center">
- <template #default="scope">
- <el-button
- type="primary"
- size="small"
- @click="modifyShipCertOperation(scope.row)"
- >
- 修改
- </el-button>
- <el-button
- type="danger"
- size="small"
- @click="deleteShipCertOperation(scope.row)"
- >
- 删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-card>
- <el-card class="mb20">
- <template #header>
- <div class="card-header">
- <span>法律援助服务介绍</span>
- </div>
- </template>
- <div class="df">
- <div>
- <el-image
- v-if="legalAidIntroduce.imageUrl"
- class="mb10"
- style="width: 200px; height: 200px"
- fit="cover"
- :preview-src-list="[legalAidIntroduce.imageUrl]"
- :src="legalAidIntroduce.imageUrl"
- ></el-image>
- <el-upload
- class="df aic jcfe"
- :action="
- store.state.baseurl +
- '/sys/basic/config/ship/upload/introduce/img'
- "
- :show-file-list="false"
- :data="{ configType: 2 }"
- :on-success="(res) => uploadCertSuccess(res, legalAidIntroduce)"
- >
- <el-button type="primary">
- {{ legalAidIntroduce.imageUrl ? "重新" : "" }}上传图片
- </el-button>
- </el-upload>
- </div>
- <div class="ml20">
- <div style="margin-bottom: 15px">
- <el-input
- type="textarea"
- v-model="legalAidIntroduce.textContent"
- placeholder="请输入法律援助服务介绍"
- style="width: 400px; height: 200px"
- ></el-input>
- </div>
- <div class="df jcfe">
- <el-button
- type="primary"
- @click="updateShipIntroduceContent(2, legalAidIntroduce)"
- >
- 更新法律援助服务介绍
- </el-button>
- </div>
- </div>
- </div>
- </el-card>
- <el-card class="mb20">
- <template #header>
- <div class="card-header">
- <span>法律援助律师/团队介绍</span>
- </div>
- </template>
- <div class="df">
- <div>
- <el-image
- v-if="lawyerIntroduce.imageUrl"
- class="mb10"
- style="width: 200px; height: 200px"
- fit="cover"
- :preview-src-list="[lawyerIntroduce.imageUrl]"
- :src="lawyerIntroduce.imageUrl"
- ></el-image>
- <el-upload
- class="df aic jcfe"
- :action="
- store.state.baseurl +
- '/sys/basic/config/ship/upload/introduce/img'
- "
- :show-file-list="false"
- :data="{ configType: 3 }"
- :on-success="(res) => uploadCertSuccess(res, lawyerIntroduce)"
- >
- <el-button type="primary">
- {{ lawyerIntroduce.imageUrl ? "重新" : "" }}上传图片
- </el-button>
- </el-upload>
- </div>
- <div class="ml20">
- <div style="margin-bottom: 15px">
- <el-input
- type="textarea"
- v-model="lawyerIntroduce.textContent"
- placeholder="请输入法律援助律师/团队介绍
- "
- style="width: 400px; height: 200px"
- ></el-input>
- </div>
- <div class="df jcfe">
- <el-button
- type="primary"
- @click="updateShipIntroduceContent(3, lawyerIntroduce)"
- >
- 更新律师/团队介绍
- </el-button>
- </div>
- </div>
- </div>
- </el-card>
- </div>
- </template>
- <script setup>
- import { onMounted, ref } from "vue";
- import api from "apis/fetch";
- import store from "store";
- import { ElNotification } from "element-plus";
- const baseurl = import.meta.env.VITE_BASEURL;
- import _ from "lodash";
- const certOperationIntroduce = ref({});
- const lawyerIntroduce = ref({});
- const legalAidIntroduce = ref({});
- const shipCertOperationList = ref([]);
- async function getShipIntroduceInfo() {
- let { data } = await api.getShipIntroduceInfo();
- if (data.status === 0) {
- certOperationIntroduce.value = data.result.certOperationIntroduce;
- lawyerIntroduce.value = data.result.lawyerIntroduce;
- legalAidIntroduce.value = data.result.legalAidIntroduce;
- } else {
- certOperationIntroduce.value = {};
- lawyerIntroduce.value = {};
- legalAidIntroduce.value = {};
- }
- }
- async function getShipCertOperationList() {
- let { data } = await api.getShipCertOperationList({
- currentPage: 1,
- size: 100,
- });
- if (data.status === 0) {
- shipCertOperationList.value = data.result;
- } else {
- shipCertOperationList.value = [];
- }
- }
- function uploadCertSuccess(res, target) {
- if (res.status === 0) {
- target.imageUrl = res.result;
- ElNotification.success({
- title: "成功",
- message: res.msg,
- });
- } else {
- ElNotification.error({
- title: "失败",
- message: res.msg,
- });
- }
- }
- async function deleteShipCertOperation(row) {
- try {
- await ElMessageBox.confirm("确定要删除该联系人吗?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- });
- const { data } = await api.deleteShipCertOperation({
- certOperationId: row.id,
- });
- if (data.status === 0) {
- ElNotification.success({
- title: "成功",
- message: data.msg,
- });
- await getShipCertOperationList();
- }
- } catch (error) {}
- }
- const isEditMode = ref(false);
- function addShipContact() {
- isEditMode.value = false;
- modifyForm.value = { officeName: "", contactPerson: "", contactPhone: "" };
- showModifyDialog.value = true;
- }
- const showModifyDialog = ref(false);
- const modifyForm = ref({
- id: 0,
- officeName: "",
- contactPerson: "",
- contactPhone: "",
- });
- const formRules = {
- officeName: [
- { required: true, message: "请输入办事处名称", trigger: "blur" },
- ],
- contactPerson: [{ required: true, message: "请输入联系人", trigger: "blur" }],
- contactPhone: [
- { required: true, message: "请输入手机号", trigger: "blur" },
- { pattern: /^1[3-9]\d{9}$/, message: "手机号格式不正确", trigger: "blur" },
- ],
- };
- async function modifyShipCertOperation(row) {
- try {
- isEditMode.value = true;
- modifyForm.value = _.cloneDeep(row);
- showModifyDialog.value = true;
- const apiMethod = isEditMode.value
- ? api.updateShipCertOperation({
- id: modifyForm.value.id,
- ...modifyForm.value,
- })
- : api.addShipCertOperation(modifyForm.value);
- const { data } = await apiMethod;
- if (data.status === 0) {
- ElNotification.success({
- title: "成功",
- message: data.msg,
- });
- await getShipCertOperationList();
- }
- } catch (error) {}
- }
- async function submitModifyForm() {
- try {
- await ElMessageBox.confirm("确定要保存修改吗?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- });
- const { data } = await api.modifyShipCertOperation({
- ...modifyForm.value,
- certOperationId: modifyForm.value.id,
- });
- if (data.status === 0) {
- ElNotification.success({
- title: "成功",
- message: data.msg,
- });
- await getShipCertOperationList();
- } else {
- ElNotification.error({
- title: "失败",
- message: data.msg,
- });
- }
- showModifyDialog.value = false;
- } catch (error) {}
- }
- async function updateShipIntroduceContent(configType, target) {
- let { data } = await api.updateShipIntroduceContent({
- configType,
- textContent: target.textContent,
- });
- if (data.status === 0) {
- ElNotification.success({
- title: "成功",
- message: data.msg,
- });
- } else {
- ElNotification.error({
- title: "失败",
- message: data.msg,
- });
- }
- }
- onMounted(() => {
- getShipIntroduceInfo();
- getShipCertOperationList();
- });
- </script>
- <style scoped>
- /* */
- :deep() .el-textarea__inner {
- height: 200px;
- }
- .w300 {
- width: 300px;
- }
- </style>
|