修改
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
<input class="input-con" v-model="fromValue.title" placeholder="请输入标题" />
|
||||
</view>
|
||||
<view class="content-input">
|
||||
<view class="input-titile"><text class="input-required">*</text>联系人</view>
|
||||
<view class="input-titile"><text class="input-required">*</text>内容</view>
|
||||
<!-- <input class="input-con" v-model="fromValue.contactName" placeholder="请输入联系人" /> -->
|
||||
<unieditor @init-data="receiveInitData"/>
|
||||
<unieditor v-if="shows" @init-data="receiveInitData" :content="fromValue.content" />
|
||||
</view>
|
||||
<view class="content-input">
|
||||
<view class="input-titile">备注</view>
|
||||
@@ -47,13 +47,20 @@ let fromValue = reactive({
|
||||
status:'0',
|
||||
});
|
||||
let type=ref('add')
|
||||
onLoad((options = {}) => {
|
||||
|
||||
let id=ref('')
|
||||
let shows=ref(false)
|
||||
onLoad((options) => {
|
||||
id.value=options.id
|
||||
if(options.id){
|
||||
type.value='edit'
|
||||
getDetail()
|
||||
}else{
|
||||
getInfo()
|
||||
}
|
||||
});
|
||||
|
||||
// 监听页面显示,接收从技能查询页面返回的数据
|
||||
onShow(() => {
|
||||
getDetail()
|
||||
// 通过事件总线接收技能选择结果
|
||||
// uni.$on('skillSelected', handleSkillSelected);
|
||||
});
|
||||
@@ -65,10 +72,14 @@ onShow(() => {
|
||||
// 监听字典数据加载完成,自动更新学历显示
|
||||
|
||||
const receiveInitData = (initData) => {
|
||||
fromValue.content=initData.value;
|
||||
if(initData.value=="<p><br></p>"){
|
||||
|
||||
}else{
|
||||
fromValue.content=initData.value;
|
||||
}
|
||||
console.log('子组件初始化数据:', initData)
|
||||
}
|
||||
function getDetail(){
|
||||
function getInfo(){
|
||||
// if(userInfo.userId){
|
||||
$api.myRequest("/train/public/train/organ/getTrainByUnifiedSocialCreditCode", {
|
||||
tags: "913700001630477270",
|
||||
@@ -80,13 +91,32 @@ function getDetail(){
|
||||
fromValue.entProvince = res.data.organProvince;
|
||||
fromValue.entCounty = res.data.organCounty;
|
||||
fromValue.entCity = res.data.organCity;
|
||||
shows.value=true;
|
||||
}
|
||||
})
|
||||
// }else{
|
||||
// $api.msg('请先登录');
|
||||
// }
|
||||
}
|
||||
|
||||
function getDetail(){
|
||||
$api.myRequest("/train/public/announcement/selectById", {
|
||||
id: id.value,
|
||||
}, "GET", 9100, {
|
||||
Authorization: `Bearer ${uni.getStorageSync('token')}`,
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
fromValue.id = res.data.id;
|
||||
fromValue.title = res.data.title;
|
||||
fromValue.content= res.data.content;
|
||||
fromValue.remark= res.data.remark;
|
||||
fromValue.entProvince = res.data.entProvince;
|
||||
fromValue.entCounty = res.data.entCounty;
|
||||
fromValue.entCity = res.data.entCity;
|
||||
shows.value=true;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const confirm = () => {
|
||||
if (!fromValue.title) {
|
||||
@@ -98,6 +128,7 @@ const confirm = () => {
|
||||
const params = {
|
||||
...fromValue,
|
||||
};
|
||||
debugger
|
||||
if(type.value=='add'){
|
||||
$api.myRequest('/train/public/announcement/add', {
|
||||
...fromValue,
|
||||
|
||||
Reference in New Issue
Block a user