Compare commits

..

No commits in common. "93bb48e45d5e763f535b0358ca88c4e7ba2e6226" and "78106a56db3a533d56eb962c356f7570083ada11" have entirely different histories.

5 changed files with 420 additions and 671 deletions

View File

@ -12,10 +12,7 @@
<!-- 填空 --> <!-- 填空 -->
<view class="tinput"> <view class="tinput">
<view class="text1"> <view class="text1"> <text class="hong1">*</text> 标题</view>
<text class="hong1">*</text>
标题
</view>
<view class="you"> <view class="you">
<input type="text" placeholder="请输入标题" v-model="newsTitle"> <input type="text" placeholder="请输入标题" v-model="newsTitle">
</view> </view>
@ -28,10 +25,7 @@
</view> </view>
</view> --> </view> -->
<view class="tinput"> <view class="tinput">
<view class="text1"> <view class="text1"> <text class="hong1">*</text> 封面图</view>
<text class="hong1">*</text>
封面图
</view>
<view class="you"> <view class="you">
<text>请上传封面图片</text> <text>请上传封面图片</text>
<!-- <input type="text" placeholder="请上传封面图片"> --> <!-- <input type="text" placeholder="请上传封面图片"> -->
@ -47,30 +41,20 @@
:previewFullImage="true" :previewFullImage="true"
:maxCount="1" :maxCount="1"
></u-upload> ></u-upload>
<view v-if="type === 'null'" class="tinput" style="display: flex;justify-content: space-between">
<text class="text1">设置可见</text>
<view>
<radio :checked="!ifShow" @click="changeShow(null)">全部可见</radio>
<radio :checked="ifShow === '01'" style="margin-left: 0.5rem" @click="changeShow('01')">员工可见</radio>
<radio :checked="ifShow === '02'" style="margin-left: 0.5rem" @click="changeShow('02')">用户可见</radio>
</view>
</view>
<view class="xinput"> <view class="xinput">
<Rboy-editor ref="RboyEditor" @uploadFile="uploadFile" :count="6"></Rboy-editor> <Rboy-editor ref="RboyEditor" @uploadFile="uploadFile" :count="6"></Rboy-editor>
</view> </view>
<view class="xinput" v-if="type == 'hygg'"> <view class="xinput" v-if="type == 'hygg'">
<view class="text1"> <view class="text1"> <text class="hong1">*</text> 分类</view>
<text class="hong1">*</text>
分类
</view>
<view class="xz"> <view class="xz">
<view :class="{'xlan':maneizhi == index}" class="kuang" v-for="(item,index) in taplist" :key="index" <view :class="{'xlan':maneizhi == index}" class="kuang" v-for="(item,index) in taplist" :key="index" @click="getzhi2(index,item.value)">
@click="getzhi2(index,item.value)">
<view class="">{{item.label}}</view> <view class="">{{item.label}}</view>
</view> </view>
</view> </view>
</view> </view>
<view class="tinput"> <view class="tinput">
<view class="text1"> 上传视频</view> <view class="text1"> 上传视频</view>
<view class="you"> <view class="you">
@ -104,7 +88,6 @@ import RboyEditor from "@/components/Rboy-editor/Rboy-editor"
import request from '../../utils/request' import request from '../../utils/request'
import config from '@/config' import config from '@/config'
import upload from '@/utils/upload.js' import upload from '@/utils/upload.js'
export default{ export default{
data(){ data(){
return{ return{
@ -122,7 +105,7 @@ export default {
carzhi:0, carzhi:0,
maneizhi:0, maneizhi:0,
taplist:[], taplist:[],
ifShow: null,
} }
}, },
onLoad(option) { onLoad(option) {
@ -136,9 +119,6 @@ export default {
RboyEditor, RboyEditor,
}, },
methods:{ methods:{
changeShow(value) {
this.ifShow = value
},
async set_content() { async set_content() {
this.$refs.RboyEditor.editor_setContents(this.detail) this.$refs.RboyEditor.editor_setContents(this.detail)
}, },
@ -205,7 +185,7 @@ export default {
url:'/common/upload', url:'/common/upload',
filePath: url, filePath: url,
}).then((res)=>{ }).then((res)=>{
this.newsCover = res.data.url this.newsCover = res.fileName
}) })
}, },
@ -256,11 +236,11 @@ export default {
let data={ let data={
newsTitle:this.newsTitle, newsTitle:this.newsTitle,
newsCover:this.newsCover, newsCover:this.newsCover,
newsContent:this.newsContent, newsContent:this.newsContent,
videoUrl:this.videoUrl, videoUrl:this.videoUrl,
category:this.value, category:this.value,
type:this.type, type:this.type,
ifShow: this.ifShow
} }
let res = await request({ let res = await request({
url: '/appInspection/news/add', url: '/appInspection/news/add',
@ -312,11 +292,9 @@ export default {
padding: 0px 12px; padding: 0px 12px;
} }
.top-icon{ .top-icon{
margin-bottom: 45px; margin-bottom: 45px;
} }
.c-top{ .c-top{
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
@ -327,19 +305,16 @@ export default {
background-color: white; background-color: white;
padding-top: 40px; padding-top: 40px;
} }
.c-title{ .c-title{
font-size: 18px; font-size: 18px;
font-weight: bold font-weight: bold
} }
.top{ .top{
box-sizing: border-box; box-sizing: border-box;
padding: 0px 15px; padding: 0px 15px;
width: 100%; width: 100%;
background-color: white; background-color: white;
} }
.top-box{ .top-box{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -347,14 +322,12 @@ export default {
box-sizing: border-box; box-sizing: border-box;
padding: 20px 0px; padding: 20px 0px;
} }
.tb-left{ .tb-left{
height: 100%; height: 100%;
width: 80%; width: 80%;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.uicon{ .uicon{
width: 18px; width: 18px;
height: 18px; height: 18px;
@ -368,37 +341,31 @@ export default {
font-weight: bold; font-weight: bold;
margin-right: 6px; margin-right: 6px;
} }
.tb-right{ .tb-right{
width: 20px; width: 20px;
height: 26px; height: 26px;
image{ image{
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
.text1{ .text1{
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
color: #363636; color: #363636;
} }
.hong1{ .hong1{
margin-top: 5px; margin-top: 5px;
font-size: 12px; font-size: 12px;
font-weight: 400; font-weight: 400;
color: #FF5453; color: #FF5453;
} }
.hong2{ .hong2{
margin-top: 5px; margin-top: 5px;
font-size: 12px; font-size: 12px;
font-weight: 400; font-weight: 400;
} }
.tinput{ .tinput{
width: 100%; width: 100%;
display: flex; display: flex;
@ -410,7 +377,6 @@ export default {
margin-top: 14px; margin-top: 14px;
margin-bottom: 14px; margin-bottom: 14px;
} }
.xinput{ .xinput{
width: 100%; width: 100%;
background: white; background: white;
@ -418,17 +384,14 @@ export default {
padding: 16px; padding: 16px;
margin-top: 14px; margin-top: 14px;
} }
.you{ .you{
text-align: right; text-align: right;
} }
.xz{ .xz{
margin-top: 10px; margin-top: 10px;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.kuang{ .kuang{
width: 80px; width: 80px;
height: 23px; height: 23px;
@ -441,13 +404,11 @@ export default {
font-size: 14px; font-size: 14px;
margin-right: 15px; margin-right: 15px;
} }
.xlan{ .xlan{
background: #CDE7FF !important; background: #CDE7FF !important;
color: #1D62FF !important; color: #1D62FF !important;
border: 1px solid #2A96FE; border: 1px solid #2A96FE;
} }
.anniu{ .anniu{
width: 100%; width: 100%;
background: linear-gradient(180deg, #3F61C0 0%, #0D2E8D 100%); background: linear-gradient(180deg, #3F61C0 0%, #0D2E8D 100%);

View File

@ -76,8 +76,8 @@
</view> </view>
<u-popup :round="10" :show="show" @close="close" :mask-click="false" @open="open"> <u-popup :round="10" :show="show" @close="close" @open="open">
<view class="pop-box scrollable-content"> <view class="pop-box">
<view class="s-title">添加员工</view> <view class="s-title">添加员工</view>
<view class="on-input"> <view class="on-input">
<view class="s-huix">姓名</view> <view class="s-huix">姓名</view>
@ -87,57 +87,8 @@
<view class="s-huix">电话</view> <view class="s-huix">电话</view>
<view class=""><input v-model="phoneNum" type="text" placeholder="请输入手机号"></view> <view class=""><input v-model="phoneNum" type="text" placeholder="请输入手机号"></view>
</view> </view>
<view class="on-input">
<view class="s-huix">学历</view>
<view class="" @click="showEducation = true"><input v-model="educationText" type="text"
placeholder="请选择学历"></view>
</view>
<view class="on-input">
<view class="s-huix">身份证号</view>
<view class=""><input v-model="idNumber" type="text" placeholder="请输入身份证号"></view>
</view>
<view class="on-input">
<view class="s-huix">入职时间</view>
<view class="" @click="showJoinedDate = true"><input :value="formattedJoinedDate" type="text"
placeholder="请选择入职时间"></view>
</view>
<view class="on-input">
<view class="s-huix">转正时间</view>
<view class="" @click="showFormalDate = true"><input :value="formattedFormalDate" type="text"
placeholder="请选择转正时间"></view>
</view>
<view class="on-input">
<view class="s-huix">购买保险时间</view>
<view class="" @click="showSafeDate = true"><input :value="formattedSafeDate" type="text"
placeholder="请选择购买保险时间"></view>
</view>
<view class="on-input">
<view class="s-huix">附件</view>
<view class="" @click="addFile"><input type="text" placeholder="添加附件"></view>
</view>
<view v-for="(item, index) in files">
<view class="on-input">
<view class="s-huix">名称</view>
<view class=""><input v-model="item.name" type="text" placeholder="请输入附件名称"></view>
</view>
<u-upload v-if="!item.fileUrl"
@afterRead="uploadFilePromise($event, index)"
name="6"
multiple
:maxCount="1"
width="100%"
height="140px"
>
</u-upload>
<view v-else class="image-container">
<image :src="item.fileUrl" style="width: 100%;height: 140px;"></image>
<view @click="deletedUrl(index)" class="close-button">
<text>x</text>
</view>
</view>
</view>
<view class=""> <view class="">
<view class="s-huix" style="text-align: left">岗位</view> <view class="s-huix">岗位</view>
<view class="warp-flax"> <view class="warp-flax">
<view class="flasxbox" :class="{ 'gwcss' : gwindex == index }" v-for="(item,index) in renList" <view class="flasxbox" :class="{ 'gwcss' : gwindex == index }" v-for="(item,index) in renList"
:key="index" @click="xgang(index,item.id)"> :key="index" @click="xgang(index,item.id)">
@ -151,43 +102,12 @@
</view> </view>
</view> </view>
</u-popup> </u-popup>
<u-picker :show="showEducation" ref="uPicker" :columns="educations"
@confirm="chooseEducation" @cancel="showEducation = false"
keyName="label"></u-picker>
<u-datetime-picker
:show="showJoinedDate"
v-model="joinedDate"
@cancel="showJoinedDate = false"
@confirm="chooseJoinDate"
mode="date"
return-type='string'
></u-datetime-picker>
<u-datetime-picker
:show="showFormalDate"
v-model="formalDate"
@cancel="showFormalDate = false"
@confirm="chooseFormalDate"
mode="date"
return-type='string'
></u-datetime-picker>
<u-datetime-picker
:show="showSafeDate"
v-model="safeDate"
@cancel="showSafeDate = false"
@confirm="chooseSafeDate"
mode="date"
return-type='string'
></u-datetime-picker>
</view> </view>
</template> </template>
<script> <script>
import config from '@/config' import config from '@/config'
import request from '../../utils/request'; import request from '../../utils/request';
import {getDictDataByType, formatDate} from "../../utils/utils";
import upload from '@/utils/upload.js'
export default { export default {
data() { data() {
@ -224,18 +144,6 @@ export default {
gwid: 0, gwid: 0,
roleId:undefined, roleId:undefined,
addRoleId:undefined, addRoleId:undefined,
education: null,
educationText: null,
idNumber: null,
joinedDate: null,
formalDate: null,
safeDate: null,
educations: [],
showEducation: false,
showJoinedDate: false,
showFormalDate: false,
showSafeDate: false,
files: []
} }
}, },
onLoad() { onLoad() {
@ -265,58 +173,7 @@ export default {
this.partnerId = uni.getStorageSync('partnerId') this.partnerId = uni.getStorageSync('partnerId')
// this.getindex() // this.getindex()
}, },
computed: {
formattedJoinedDate() {
if (!this.joinedDate) return '';
return formatDate(this.joinedDate); // formatDate'yyyy-MM-dd'
},
formattedFormalDate() {
if (!this.formalDate) return '';
return formatDate(this.formalDate); // formatDate'yyyy-MM-dd'
},
formattedSafeDate() {
if (!this.safeDate) return '';
return formatDate(this.safeDate); // formatDate'yyyy-MM-dd'
},
},
methods: { methods: {
uploadFilePromise(event, index) {
upload({
url: '/common/upload',
filePath: event.file[0].url,
}).then((res) => {
this.files[index].name = event.file[0].name
this.files[index].fileUrl = config.baseImageUrl + "/" + res.data.url
})
},
deletedUrl(index) {
this.files.splice(index, 1)
},
addFile() {
if (this.files.length === 0 || this.files[0].fileUrl !== null) {
this.files.unshift({
name: "未命名",
fileUrl: null
})
}
},
chooseJoinDate(e) {
this.joinedDate = formatDate(e.value)
this.showJoinedDate = false
},
chooseFormalDate(e) {
this.formalDate = formatDate(e.value)
this.showFormalDate = false
},
chooseSafeDate(e) {
this.safeDate = formatDate(e.value)
this.showSafeDate = false
},
chooseEducation(e) {
this.educationText = e.value[0].label
this.education = e.value[0].value
this.showEducation = false
},
toInfo(item){ toInfo(item){
request({ request({
url: '/company/staff/getByUserId?id=' + item.id, url: '/company/staff/getByUserId?id=' + item.id,
@ -367,7 +224,6 @@ export default {
}, },
showpopup() { showpopup() {
this.show = true this.show = true
this.educations = [getDictDataByType("company_staff_edu")]
}, },
async getindex() { async getindex() {
if(this.workName != ''){ if(this.workName != ''){
@ -480,6 +336,7 @@ export default {
userType:'01', userType:'01',
roleId:this.gwid, roleId:this.gwid,
password:'123456' password:'123456'
} }
let res = await request({ let res = await request({
url: '/system/user/create', url: '/system/user/create',
@ -498,26 +355,6 @@ export default {
roleIds: roleIds roleIds: roleIds
} }
}) })
const staffData = {
userId: res.data,
name: this.realName,
tel: this.phoneNum,
joinedDate: this.joinedDate,
idNumber: this.idNumber,
education: this.education,
formalDate: this.formalDate,
safeDate: this.safeDate,
fileNames: this.files.length > 0 ? this.files.map(item => item.name).join(",") : "",
fileUrls: this.files.length > 0 ? this.files.map(item => {
return item.fileUrl.replace(config.baseImageUrl + "/", "")
}).join(",") : ""
}
const staffRes = await request({
url: '/company/staff/createByExistUser',
method: 'post',
data: staffData
})
uni.showToast({ uni.showToast({
title: "添加成功" title: "添加成功"
}) })
@ -675,8 +512,7 @@ export default {
} }
.s-huix { .s-huix {
width: 30%; width: 20%;
text-align: right;
} }
.s-img { .s-img {
@ -784,7 +620,6 @@ export default {
box-sizing: border-box; box-sizing: border-box;
padding-bottom: 5px; padding-bottom: 5px;
margin: 10px; margin: 10px;
justify-content: space-between;
} }
.tjiao { .tjiao {
@ -834,38 +669,4 @@ export default {
box-sizing: border-box; box-sizing: border-box;
white-space: nowrap; white-space: nowrap;
} }
.on-input input {
text-align: right;
padding-right: 1rem
}
/* 添加到你的样式文件中 */
.image-container {
position: relative; /* 使子元素可以相对于此容器进行绝对定位 */
width: 100%;
height: 140px;
}
.close-button {
position: absolute;
top: 5px; /* 调整距离顶部的距离 */
right: 5px; /* 调整距离右侧的距离 */
width: 24px; /* 圆的直径 */
height: 24px;
background-color: #ff0000;
color: white;
border-radius: 50%; /* 使按钮呈现圆形 */
display: flex;
//align-items: center;
justify-content: center;
font-size: 16px; /* 调整“X”的字体大小 */
cursor: pointer; /* 鼠标悬停时显示为指针 */
}
.scrollable-content {
max-height: calc(80vh - 40px); /* 设置最大高度为视口高度的80%,减去弹出框的圆角和边距 */
overflow-y: auto; /* 启用垂直滚动 */
padding: 15px; /* 保持与现有padding一致 */
}
</style> </style>

View File

@ -10,8 +10,9 @@
<!-- html --> <!-- html -->
<view class="c-content" v-if="flag"> <view class="c-content" v-if="flag">
<view class="cont-gongs">{{ obj.publishUnit }}</view> <view class="cont-gongs">{{ obj.publishUnit }}</view>
<u-parse :content="obj.newsContent" :tagStyle="style"></u-parse> <u-parse :content="obj.newsContent" :tagStyle="style"></u-parse>
<view class="videobox" v-if="videoList != null && videoList !== ''"> <view class="videobox" v-if="videoList != null ">
<video :src="baseUrl+ videoList" controls></video> <video :src="baseUrl+ videoList" controls></video>
</view> </view>
<view class="cont-time">{{ getDate(createTime) || new Date() }}</view> <view class="cont-time">{{ getDate(createTime) || new Date() }}</view>

View File

@ -27,7 +27,7 @@
<view v-if="tapindex === 0"> <view v-if="tapindex === 0">
<view class="c-b-top"> <view class="c-b-top">
<view class="t-left"> <view class="t-left">
<image :src="baseImageUrl+getUrl(item.newsCover)" mode="aspectFill"></image> <image :src="baseImageUrl+item.newsCover" mode="aspectFill"></image>
</view> </view>
<view class="t-right"> <view class="t-right">
<view class="t-tilte">{{ item.newsTitle }}</view> <view class="t-tilte">{{ item.newsTitle }}</view>
@ -59,7 +59,7 @@
</view> </view>
</view> </view>
<view class="circle-notification" v-if="ifSend" @click="toAdd"> <view class="circle-notification" v-if="ifSend">
+ +
</view> </view>
@ -154,21 +154,6 @@ export default {
tabBar, tabBar,
}, },
methods: { methods: {
getUrl(value){
if (!value){
return ""
}
if (value[0] === '/'){
return value
}else {
return "/" + value
}
},
toAdd(){
uni.navigateTo({
url: '/pages/authority/newadd?type=' + null
})
},
getIfSend() { getIfSend() {
request({ request({
url: '/system/inspectionNews/ifSend', url: '/system/inspectionNews/ifSend',
@ -246,6 +231,7 @@ export default {
} }
let total = res.total let total = res.total
this.totalPages = Math.ceil(total / this.pageSize); this.totalPages = Math.ceil(total / this.pageSize);
}, },