|
@@ -1,17 +1,7 @@
|
|
|
<template>
|
|
|
- <a-modal
|
|
|
- :width="1200"
|
|
|
- v-model:visible="visible"
|
|
|
- :title="title"
|
|
|
- :confirm-loading="confirmLoading"
|
|
|
- @ok="handleOk"
|
|
|
- ok-text="提交"
|
|
|
- @cancel="handleCancel"
|
|
|
- cancel-text="取消"
|
|
|
- :keyboard="false"
|
|
|
- :mask-closable="false" >
|
|
|
- <a-form :model="dataModel" autocomplete="off">
|
|
|
- <a-divider orientation="left">基础信息管理</a-divider>
|
|
|
+ <div class="card-edit">
|
|
|
+ <a-form :model="dataModel" autocomplete="off" @finish="onFinish">
|
|
|
+ <a-divider orientation="left">运营机构信息</a-divider>
|
|
|
<a-row type="flex">
|
|
|
<a-col :span="8">
|
|
|
<a-form-item label="企业名称" name="companyName" :label-col="{span:8}" :rules="[{ required: true, message: '请输入企业名称!' }]">
|
|
@@ -29,11 +19,6 @@
|
|
|
<a-form-item label="负责人姓名" name="fzrName" :label-col="{span:8}" :rules="[{ required: true, message: '请输入负责人姓名!' }]">
|
|
|
<label v-if="opCategory==3">{{dataModel.fzrName}}</label>
|
|
|
<a-input v-model:value="dataModel.fzrName" placeholder=""/>
|
|
|
- <!--<a-date-picker name="feedbackDate2" v-model:value="dataModel.feedbackDate"
|
|
|
- value-format="YYYY-MM-DD" picker="date" placeholder="请选择问题反馈日期" />-->
|
|
|
- <!--<a-select ref="select" v-model:value="dataModel.problemCharacteristics"
|
|
|
- :options="problemAttrList" :field-names="{label:'name',value:'value'}"
|
|
|
- @change="loadData" :allow-clear="true"></a-select>-->
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
@@ -120,11 +105,16 @@
|
|
|
<a-textarea :auto-size="{ minRows: 4, maxRows: 10 }" v-model:value="dataModel.remarkDesc" :disabled="opCategory==3"
|
|
|
placeholder="备注" style="text-align: center;" />
|
|
|
</a-row>
|
|
|
+ <a-form-item class="buttom-btns">
|
|
|
+ <a-button @click="onClose">取消</a-button>
|
|
|
+ <a-button type="primary" html-type="submit">提交</a-button>
|
|
|
+ </a-form-item>
|
|
|
</a-form>
|
|
|
- </a-modal>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
import {computed, defineComponent, reactive, ref, toRefs} from "vue";
|
|
|
+import {useTabsViewStore} from "@/store/modules/tabsView";
|
|
|
import {getInstitutionByID, saveInstitution} from "@/api/baseSettings/institution";
|
|
|
import {getSiteList,getListByInstitutionID,getSiteByID} from "@/api/baseSettings/siteInfo";
|
|
|
import BUploadFile from "@/components/file/uploadFile.vue";
|
|
@@ -144,14 +134,11 @@ export default defineComponent({
|
|
|
default: null
|
|
|
}
|
|
|
},
|
|
|
- setup(props) {
|
|
|
- /*const feedbackDateDetail = ref();
|
|
|
- const resolveDateDetail = ref();*/
|
|
|
+ setup() {
|
|
|
const title = ref();
|
|
|
- const opCategory = ref<any>();
|
|
|
- const visible = ref<boolean>(false);
|
|
|
+ const opCategory = ref();
|
|
|
+ const tabsViewStore = useTabsViewStore();
|
|
|
const isAllowCommit = ref<boolean>(false);
|
|
|
- const confirmLoading = ref<boolean>(false);
|
|
|
const formData = reactive<InstitutionModel>({ dataModel:{}});
|
|
|
const pageParams = reactive({
|
|
|
pageIndex: 1,
|
|
@@ -187,23 +174,15 @@ export default defineComponent({
|
|
|
const allSites = ref<any>([]);
|
|
|
const manageSites = ref<any>([]);
|
|
|
|
|
|
- const loadData = (id: string) => {
|
|
|
- getInstitutionByID(id).then((result: any) => {
|
|
|
+ const loadData = (institutionID: any) => {
|
|
|
+ getAllSites();
|
|
|
+ getInstitutionByID(institutionID).then((result: any) => {
|
|
|
formData.dataModel = result;
|
|
|
console.log('dataModel',formData.dataModel);
|
|
|
GetManageSites(formData.dataModel.institutionID);
|
|
|
- /*feedbackDateDetail.value = dayjs(formState.dataModel.feedbackDate).format('YYYY-MM-DD');
|
|
|
- resolveDateDetail.value = formState.dataModel.resolveDate == null?"": dayjs(formState.dataModel.resolveDate).format('YYYY-MM-DD');*/
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- const show = (id: any,method:string,category:any) => {
|
|
|
- title.value ="运营机构管理-"+method;
|
|
|
- opCategory.value = category;
|
|
|
- loadData(id);
|
|
|
- visible.value = true;
|
|
|
- };
|
|
|
-
|
|
|
const getAllSites = () => {
|
|
|
pageParams.institutionID = '';
|
|
|
getSiteList(pageParams).then((result :any) => {
|
|
@@ -253,38 +232,36 @@ export default defineComponent({
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
|
|
|
- const handleOk = () => {
|
|
|
+ const onClose = (reload: any) => {
|
|
|
+ tabsViewStore.closeCurrentTabByPath('/baseSettings/institution/add');
|
|
|
+ tabsViewStore.closeCurrentTabByPath('/baseSettings/institution/edit');
|
|
|
+ tabsViewStore.openTab('/baseSettings/institution/index',{reload:reload});
|
|
|
+ };
|
|
|
+
|
|
|
+ const onFinish = () => {
|
|
|
validateSameSite();
|
|
|
- if (!isAllowCommit.value){
|
|
|
- message.error("不允许添加相同的站点!");
|
|
|
- }else if(formData.dataModel.companyName==null||formData.dataModel.companyAddress ==null||formData.dataModel.fzrName==null||
|
|
|
- formData.dataModel.fzrMobile==null||formData.dataModel.frName==null||formData.dataModel.frMobile==null||formData.dataModel.companyCode==null){
|
|
|
- message.error("请填写完整的机构信息!");
|
|
|
- isAllowCommit.value = false;
|
|
|
- }
|
|
|
if (isAllowCommit.value){
|
|
|
formData.dataModel.manageSites = manageSites.value;
|
|
|
saveInstitution(formData.dataModel).then(result => {
|
|
|
if (result) {
|
|
|
- visible.value = false;
|
|
|
- props.loadData();
|
|
|
+ onClose(1);
|
|
|
}
|
|
|
});
|
|
|
+ }else{
|
|
|
+ message.error("不允许添加相同的站点!");
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- const handleCancel = () => {
|
|
|
- visible.value = false;
|
|
|
- };
|
|
|
|
|
|
return {
|
|
|
...toRefs(formData),
|
|
|
+ loadData,
|
|
|
+ onClose,
|
|
|
+ onFinish,
|
|
|
title,
|
|
|
- visible,
|
|
|
opCategory,
|
|
|
- confirmLoading,
|
|
|
columns,
|
|
|
pageParams,
|
|
|
pagination,
|
|
@@ -292,9 +269,6 @@ export default defineComponent({
|
|
|
allSites,
|
|
|
manageSites,
|
|
|
isAllowCommit,
|
|
|
- /*feedbackDateDetail,
|
|
|
- resolveDateDetail,*/
|
|
|
- show,
|
|
|
getAllSites,
|
|
|
GetManageSites,
|
|
|
addSite,
|
|
@@ -302,12 +276,11 @@ export default defineComponent({
|
|
|
handleTableChange,
|
|
|
onSelectChange,
|
|
|
manageSitesChange,
|
|
|
- handleOk,
|
|
|
- handleCancel
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- this.getAllSites();
|
|
|
+ const id = history.state.params?.id;
|
|
|
+ this.loadData(id);
|
|
|
},
|
|
|
})
|
|
|
</script>
|