123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279 |
- <template>
- <div class="addPredetermine">
- <ul class="detailUl">
- <li class="detailLi">
- <span class="liName">
- <span style="color: red;margin-right: 5rpx">*</span>
- 项目/企业名称
- </span>
- <span class="liInfo">{{ companyName }}</span>
- </li>
- <li class="detailLi2">
- <span class="liName" style="margin-bottom: 24rpx">
- 项目/企业简介
- </span>
- <van-field
- :value="form.projectInfo"
- autosize
- type="textarea"
- placeholder="请输入文字进行报事报修描述"
- class="myField"
- maxlength="800"
- show-word-limit
- @change="changeProjectInfo"
- />
- </li>
- <li class="detailLi2">
- <span class="liName" style="margin-bottom: 24rpx">
- <span style="color: red;margin-right: 5rpx">*</span>
- 企业需求
- </span>
- <van-field
- :value="form.companyNeed"
- autosize
- type="textarea"
- placeholder="请输入文字进行报事报修描述"
- class="myField"
- maxlength="800"
- show-word-limit
- @change="changeCompanyNeed"
- />
- </li>
- <li class="detailLi">
- <span class="liName">
- <span style="color: red;margin-right: 5rpx">*</span>
- 项目/企业联系人
- </span>
- <input class="liInfo" placeholder="请输入" v-model="form.projectManager"></input>
- </li>
- <li class="detailLi" style="border-bottom: none">
- <span class="liName">
- <span style="color: red;margin-right: 5rpx">*</span>
- 联系电话
- </span>
- <input class="liInfo" placeholder="请输入" v-model="form.managerPhone"></input>
- </li>
- </ul>
- <div class="whiteBoard">
- <div class="boardTitle">关于房源</div>
- <div class="boardInfo">
- <div class="boardItem">{{ roomInfo.groupName }}</div>
- <div class="boardItem">{{ roomInfo.floorDiscName }}</div>
- <div class="boardItem">{{ roomInfo.buildName }}</div>
- <div class="boardItem">{{ roomInfo.roomNo }}</div>
- </div>
- </div>
- <button @tap="submit()" class="toYy">提交预定</button>
- </div>
- </template>
- <script>
- import {getByCodes, getUserLocalStorageInfo, getRoomInfo, parkRoomSlateAdd, getParkRoomSlateInfoById, parkRoomSlateEdit} from "@/js_sdk/http";
- export default {
- name: "addPredetermine",
- onLoad(options) {
- this.roomId = options.roomId
- this.id = options.id
- if(options.id){
- uni.setNavigationBarTitle({
- title: '编辑预定',
- });
- this.getById()
- }
- this.getRoomById()
- },
- data(){
- return{
- id: '',
- roomId: '',
- companyName: getUserLocalStorageInfo().username,
- getUserLocalStorageInfo: getUserLocalStorageInfo(),
- form:{
- },
- roomInfo:{
- groupName: '',
- floorDiscName: '',
- buildName: '',
- roomNo: ''
- }
- }
- },
- methods:{
- changeProjectInfo(e){
- this.form.projectInfo = e.detail
- },
- changeCompanyNeed(e){
- this.form.companyNeed = e.detail
- },
- getRoomById(){
- getRoomInfo(this.roomId).then(res=>{
- if(res){
- this.roomInfo = res
- }
- })
- },
- submit(){
- if(this.id){
- this.edit()
- }else {
- this.add()
- }
- },
- add(){
- this.form.projectName = this.companyName
- this.form.companyId = getUserLocalStorageInfo().userId
- this.form.createdBy = getUserLocalStorageInfo().userId
- this.form.userId = getUserLocalStorageInfo().userId
- this.form.roomIds= this.roomId
- parkRoomSlateAdd(this.form).then((res) => {
- if(res.code == '200'){
- this.$showToast("填报成功");
- uni.navigateBack({});
- }else {
- this.$showToast(res.msg);
- }
- }).catch(err=>{
- })
- },
- edit(){
- this.form.updatedBy = getUserLocalStorageInfo().userId
- this.form.userId = getUserLocalStorageInfo().userId
- parkRoomSlateEdit(this.form).then((res) => {
- if(res.code == '200'){
- this.$showToast("填报成功");
- uni.navigateBack({});
- }else {
- this.$showToast(res.msg);
- }
- }).catch(err=>{
- })
- },
- getById(){
- const data = {
- id: this.id
- }
- getParkRoomSlateInfoById(data).then(res=>{
- if(res.code == '200'){
- this.form = res.data
- }
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .addPredetermine{
- .detailUl{
- margin-top: 20rpx;
- background: white;
- padding: 24rpx 32rpx;
- .liName{
- font-size: 32rpx;
- color: rgba(51, 51, 51, 1);
- white-space: nowrap;
- .callNumber{
- color: rgba(24, 23, 42, 1);
- font-size: 36rpx;
- font-weight: 600;
- }
- .callName{
- color: rgba(102, 102, 102, 1);
- font-size: 28rpx;
- }
- }
- .phoneIcon{
- width: 64rpx;
- height: 64rpx;
- }
- .detailLi{
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 32rpx 0;
- border-bottom: 2rpx solid #E6E6E6;
- .liInfo{
- display: inline-block;
- text-align: right;
- max-width: 428rpx;
- color: rgba(102, 102, 102, 1);
- font-size: 32rpx;
- line-height: 38rpx;
- overflow: hidden;
- word-wrap: break-word;
- }
- }
- .detailLi2{
- display: flex;
- flex-direction: column;
- padding: 32rpx 0;
- border-bottom: 2rpx solid #E6E6E6;
- .detailLi2BoxTop{
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- margin: 12rpx 0;
- .checkItem{
- width: 160rpx;
- height: 64rpx;
- font-size: 28rpx;
- color: #666666;
- display: flex;
- align-items: center;
- justify-content: center;
- background: #F5F7FA;
- border-radius: 8rpx;
- margin: 12rpx 0;
- }
- .checked{
- background: #0365F9;
- color: white;
- }
- }
- }
- .van-cell {
- background: #F5F7FA !important;
- border-radius: 8rpx;
- font-size: 28rpx;
- }
- }
- .whiteBoard{
- padding: 32rpx;
- background: white;
- margin-top: 24rpx;
- min-height: 260rpx;
- box-sizing: border-box;
- .boardTitle{
- color: rgba(51, 51, 51, 1);
- font-size: 32rpx;
- margin-bottom: 24rpx;
- }
- .boardInfo{
- display: flex;
- flex-wrap: wrap;
- color: rgba(51, 51, 51, 1);
- font-size: 32rpx;
- .boardItem{
- margin-right: 24rpx;
- }
- }
- }
- .toYy{
- width: 654rpx;
- height: 96rpx;
- background: rgba(3, 101, 249, 1);
- margin: 64rpx 48rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 36rpx;
- color: white;
- }
- }
- </style>
|