| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101 |
- <template>
- <view>
- <view class="overlay" v-if="showfx" @click="showwx">
- <image style="height: 100%;width: 100%;" src="/static/img/zz.png"></image>
- </view>
-
- <view :class="['custom-header', { 'is-back': isBack }, bgColor]">
- <view class="back-container" @click="handleBack">
- <view class="back-text">返回</view>
- </view>
- <view class="content-container">
- <view class="content-text">{{title}}</view>
- </view>
- </view>
-
- <form class="cu-list menu">
-
- <view class="titlebg2">
- <view class="titlet1" ></view>
- <view class="titlet2" >厂房信息</view>
- </view>
-
- <view class="show1">
-
- <view class="textbg">
- <view class="text1">
- 厂房编号
- </view>
- <input class="text44" v-model="inputForm.des6" placeholder="输入厂房编号" :disabled="ischeck"></input>
- </view>
-
- <view class="textbg">
- <view class="text1">
- 厂房名称
- </view>
- <input class="text44" v-model="inputForm.name" placeholder="输入厂房名称" :disabled="ischeck"></input>
- </view>
-
- <view class="textbg">
- <view class="text1">
- 所属园区
- </view>
- <view v-if="ischeck" class="text2" :class="inputForm.des8 === '需' ? 'text33' : 'text44'" >
- {{inputForm.des8}}
- </view>
-
- <picker v-else class="title2" @change="bindPickerChange" rangeKey="label" rangeValue="value" :range="parkList">
- <view class="text44" :class="{ placeholder: selectedPark === '请选择' }">{{ selectedPark }}</view>
- </picker>
-
- </view>
-
- <view class="textbg">
- <view class="text1">
- 详细位置
- </view>
- <input class="text44" v-model="inputForm.address" placeholder="输入详细位置" :disabled="ischeck"></input>
- </view>
-
- <view class="textbg">
- <view class="text1">
- 联系人
- </view>
-
- <button v-if="showloginbt" @click="tologin" class="cu-btn block bg-blue ">{{dengtxt}}</button>
- <input v-else class="text44" v-model="inputForm.lxr" placeholder="输入联系人" :disabled="ischeck"></input>
- </view>
-
- <view class="textbg">
- <view class="text1">
- 联系电话
- </view>
- <button v-if="showloginbt" @click="tologin" class="cu-btn block bg-blue ">{{dengtxt}}</button>
- <input v-else class="text44" v-model="inputForm.phone" placeholder="输入联系电话" :disabled="ischeck"></input>
- </view>
- </view>
- <view class="titlebg2">
- <view class="titlet1" ></view>
- <view class="titlet2" >基本信息</view>
- </view>
-
-
- <view class="textbg">
- <view class="text12">
- {{t1}}
- </view>
- <view v-if="ischeck" class="text44" >
- {{ inputForm.ownership===1 ? '国有' :
- inputForm.ownership===2 ? '集体' : '民营' }}
- </view>
-
- <picker v-else class="title2" @change="bindPickerChange2" rangeKey="label" rangeValue="value" :range="parkList2">
- <view class="text44" :class="{ placeholder: selectedownership === '请选择' }">{{ selectedownership }}</view>
- </picker>
-
- </view>
-
- <view class="textbg">
- <view class="text12">
- 产权
- </view>
- <view v-if="ischeck" class="text44" >
- {{selecteddes7}}
- </view>
-
- <picker v-else class="title2" @change="bindPickerChange4" rangeKey="label" rangeValue="value" :range="parkList4">
- <view class="text44" :class="{ placeholder: selecteddes7 === '请选择' }">{{ selecteddes7 }}</view>
- </picker>
-
- </view>
-
-
- <view class="textbg">
- <view class="text12">
- {{t2}}(亩)
- </view>
- <view class="text22">
- <input class="text44" v-model="inputForm.area" placeholder="输入占地面积" :disabled="ischeck"></input>
- </view>
- </view>
-
- <view class="textbg">
- <view class="text12">
- {{t3}}
- </view>
- <view v-if="ischeck" class="text44">
- {{inputForm.singleLayer===1 ? '单层' : '多层'}}
- </view>
- <picker v-else class="title2" @change="bindPickerChange3" rangeKey="label" rangeValue="value" :range="parkList3">
- <view class="text44" :class="{ placeholder: selectedsingleLayer === '请选择' }">{{ selectedsingleLayer }}</view>
- </picker>
- </view>
-
- <view class="textbg">
- <view class="text12">
- {{t4}}(㎡)
- </view>
- <view class="text221">
- <input class="text44" v-model="inputForm.idleArea" placeholder="输入占地面积" :disabled="ischeck"></input>
- </view>
-
- </view>
-
- <view class="textbg">
- <view class="text12">
- {{t5}}
- </view>
- <view class="text221">
- <input class="text44" v-model="inputForm.numberLayers" placeholder="输入层数" :disabled="ischeck"></input>
- </view>
- </view>
-
- <view class="textbg">
- <view class="text12">
- {{t6}}
- </view>
- <view class="text221">
- <input class="text44" v-model="inputForm.floorHeight" placeholder="输入层高" :disabled="ischeck"></input>
- </view>
- </view>
-
- <view class="textbg">
- <view class="text12">
- 适用产业
- </view>
-
- <!-- 回显(查看模式) -->
- <view v-if="ischeck" class="text44">
- {{ inputForm.des2 || '暂无' }}
- </view>
-
- <!-- 编辑(选择模式) -->
- <zqs-select
- v-else
- class="input2"
- :multiple="true"
- :list="industryList"
- label-key="label"
- value-key="value"
- placeholder=" 请选择"
- title="请选择适用产业"
- clearable
- v-model="selectedIndustry"
- @search="searchEvent"
- @change="selectChange2"
- ></zqs-select>
-
- </view>
-
-
- <view class="textbg">
- <view class="text12">
- 厂房装修
- </view>
- <view v-if="ischeck" class="text44">
- {{ inputForm.des3==='1' ? '毛坯' :
- inputForm.des3==='2' ? '精装' : '' }}
- </view>
- <picker v-else class="title2" @change="bindPickerChange6" rangeKey="label" rangeValue="value" :range="parkList6">
- <view class="text44" :class="{ placeholder: selecteddes3 === '请选择' }">{{ selecteddes3 }}</view>
- </picker>
- </view>
-
- <view class="textbg">
- <view class="text12">
- 长宽
- </view>
- <view class="text221">
- <input class="text44" v-model="inputForm.des4" placeholder="输入长宽" :disabled="ischeck"></input>
- </view>
- </view>
-
- <view class="textbg">
- <view class="text12">
- 承载负荷(kg/m²)
- </view>
- <view class="text221">
- <input class="text44" v-model="inputForm.des5" placeholder="输入承载负荷" :disabled="ischeck"></input>
- </view>
- </view>
-
- <view class="textbg">
- <view class="text12">
- 行车数量
- </view>
- <view class="text221">
- <input class="text44" v-model="inputForm.drivingCount" placeholder="输入行车数量" :disabled="ischeck"></input>
- </view>
- </view>
-
- <view class="textbg">
- <view class="text12">
- 行车承载负荷(吨)
- </view>
- <view class="text221">
- <input class="text44" v-model="inputForm.drivingLoad" placeholder="输入行车承载负荷" :disabled="ischeck"></input>
- </view>
- </view>
-
- <view class="textbg">
- <view class="text12">
- 洁净车间
- </view>
- <view v-if="ischeck" class="text44">
- {{ selectedcleanRoom }}
- </view>
- <picker v-else class="title2" @change="bindPickerChange5" rangeKey="label" rangeValue="value" :range="parkList5">
- <view class="text44" :class="{ placeholder: selectedcleanRoom === '请选择' }">{{ selectedcleanRoom }}</view>
- </picker>
- </view>
-
- <view class="textbg">
- <view class="text12">
- 水电气情况
- </view>
- <view class="text221">
- <input class="text44" v-model="inputForm.situation" placeholder="输入水电气情况" :disabled="ischeck"></input>
- </view>
- </view>
-
- <view v-if="!ischeck" class="textbg">
- <view class="text12">
- 纳入板块统计
- </view>
- <picker class="title2" @change="bindPickerChange7" rangeKey="label" rangeValue="value" :range="parkList7">
- <view class="text44" :class="{ placeholder: selectedispark === '请选择' }">{{ selectedispark }}</view>
- </picker>
- </view>
-
- <view class="textbg" >
- <view class="text12">
- 备注
- </view>
- <view class="text221">
- <input class="text44" v-model="inputForm.remark" placeholder="输入备注" :disabled="ischeck"></input>
- </view>
- </view>
-
- <view v-if="!showloginbt&&!ischeck" class="cu-form-group margin-top" style="0.5px solid #eee;margin-top: 10rpx;">
- <uni-file-picker style="margin-bottom: 10px;margin-top: 10rpx;" limit="1" ref="picFile" v-model="picLists"
- fileMediatype="image" mode="grid" title="平面图" :auto-upload="autoUpload" @select="select"
- @progress="progress" @success="success" @fail="fail" @delete="deleteFile"
- :imageStyles="imageStyles" :disabled="ischeck">
- </uni-file-picker>
- </view>
-
- <view v-if="!showloginbt&&!ischeck" class="cu-form-group margin-top" style="0.5px solid #eee;margin-top: 10rpx;">
- <uni-file-picker style="margin-bottom: 10px;margin-top: 10rpx;" limit="4" ref="picFile2" v-model="picLists2"
- fileMediatype="image" mode="grid" title="厂房图" :auto-upload="autoUpload" @select="select2"
- @progress="progress" @success="success" @fail="fail" @delete="deleteFile2"
- :imageStyles="imageStyles" :disabled="ischeck">
- </uni-file-picker>
- </view>
-
- <view style="height: 30rpx;background-color: white;"></view>
-
- <view class="padding-xl" v-if="showloginbt">
- <button @click="tologin" class="cu-btn block bg-blue margin-tb-sm lg">登录查看厂房照片</button>
- </view>
-
- <view class="titlebg2" v-if="swiperList2.length>0" >
- <view class="titlet1" ></view>
- <view class="titlet2" >平面图</view>
- </view>
-
- <view v-for="(item, index) in swiperList2" :key="'pic1-'+index" style="width: 100%;">
- <image :src="item.url" mode="widthFix" style="width: 100%;" >
- </image>
- </view>
-
- <view style="height: 40rpx;"></view>
-
- <view class="titlebg2" v-if="swiperList.length>0" >
- <view class="titlet1" ></view>
- <view class="titlet2" >厂房图</view>
- </view>
-
- <view v-for="(item, index) in swiperList" :key="'pic2-'+index" style="width: 100%;">
- <image :src="item.url" mode="widthFix" style="width: 100%;" >
- </image>
- </view>
-
- <view style="height: 40rpx;"></view>
- <view class="padding-xl" v-if="!ischeck">
- <button @click="save" class="cu-btn block bg-blue margin-tb-sm lg">提交</button>
- </view>
-
-
- </form>
- </view>
- </template>
- <script>
- import loginService from '@/api/auth/loginService.js'
- import { wxShare } from "@/common/wxutils.js";
- export default {
-
- data() {
- return {
- title: '厂房资源详情',
- isBack: true, // 是否显示返回按钮
- backText: '返回', // 返回按钮的文本
- bgColor: 'bg-blue', // 背景颜色
- ischeck: true,
- isAdd: true,
- autoUpload: false,
- swiperList: [],
- swiperList2: [],
- inputForm: {
- id: '',
- name: '',
- park: '',
- address: '',
- ownership: '',
- area: '',
- singleLayer: '',
- cleanRoom: '',
- numberLayers: '',
- floorHeight: '',
- idleArea: '',
- remark: '',
- state: '',
- des1: '',
- des2: '',
- des3: '',
- des4: '',
- des5: '',
- des6: '',
- des7: '',
- des8: '',
- des9: '',
- lxr: '',
- phone: '',
- drivingCount: '',
- drivingLoad: '',
- situation: '',
- pic1: '',
- pic2: '',
- ispark: '',
- },
- t1: '厂房权属',
- t2: '占地面积',
- t3: '单层/多层',
- t4: '面积',
- t5: '层数',
- t6: '层高',
- text1:'',
- text2:'',
- parkList: [],
- parkList2: [],
- parkList3: [],
- parkList4: [],
- parkList5: [],
- parkList6: [],
- parkList7: [{label: '是',value: '1'},{label: '否',value: '0'}],
- selectedPark:'请选择',
- selectedownership:'请选择',
- selectedsingleLayer:'请选择',
- selecteddes7:'请选择',
- selecteddes3:'请选择',
- selectedcleanRoom:'请选择',
- selectedispark:'请选择',
- // 适用产业
- industryList: [], // 字典数组
- selectedIndustry: [], // 当前选中的 value 数组
- showIndustryPicker: false,
- showIndustryPop: false ,
-
- dengtxt: '登录查看',
-
- picLists: [],
- picUrl: [],
- picLists2: [],
- picUrl2: [],
- imageStyles: {
- width: 90,
- height: 90
- },
-
- index:0,
- isLogin:"",
- showloginbt:true,
- username:"",
- isadmin:false,
- lyIndex: '',
- showLYList: [],
- showfx:false,
- rules: {
- name: { label: '厂房名称', required: true },
- park: { label: '所属园区', required: true },
- address: { label: '详细位置', required: true },
- ownership: { label: '厂房权属', required: true },
- area: { label: '占地面积', required: true, pattern: /^\d+(\.\d{1,2})?$/ },
- singleLayer: { label: '单层/多层', required: true },
- idleArea: { label: '面积', required: true, pattern: /^\d+(\.\d{1,2})?$/ },
- numberLayers: { label: '层数', required: true, pattern: /^\d+$/ },
- floorHeight: { label: '层高', required: true, pattern: /^\d+(\.\d{1,2})?$/ }
- }
- }
- },
- created() {
- },
- mounted() {
-
- },
- computed: {
- },
- onShow() {
- this.isLogin=this.$auth.checkisLogin();
- //判断是否能新增
- if(this.isLogin!=null){
- this.getRole();
-
- this.showloginbt=false;
- }
- },
- onLoad(query) {
- this.isLogin=this.$auth.checkisLogin();
- this.username=this.$auth.getUserInfo();
- if(this.username!=undefined&&this.username!=''&&this.username!=null&&this.isLogin!=null){
- if(this.username.loginName=='admin'){
- this.isadmin=true;
- }
- }
-
- Promise.all([
- loginService.getDictListBytype("sys_park"),
- loginService.getDictListBytype("sys_ownership"),
- loginService.getDictListBytype("sys_single_layer"),
- loginService.getDictListBytype("sys_property_right"),
- loginService.getDictListBytype("sys_clean_room"),
- loginService.getDictListBytype("sys_renovation"),
- loginService.getDictListBytype("sys_industry")
- ]).then(([park, own, layer, propertyright, cleanroom,renovation,industry]) => {
- this.parkList = park.data;
- this.parkList2 = own.data;
- this.parkList3 = layer.data;
- this.parkList4 = propertyright.data;
- this.parkList5 = cleanroom.data;
- this.parkList6 = renovation.data;
- this.industryList = industry.data;
- // 字典到位后再回显详情
- if (query.id) { // 有 id → 编辑/查看
- this.isAdd = false
- this.title = '厂房资源详情'
- return loginService.factoryqueryById(query.id)
- } else { // 无 id → 新增
- this.isAdd = true
- this.title = '新增厂房资源'
- return Promise.resolve({ data: {} }) // 空对象,走 setData 不会报错
- }
- }).then(({ data }) => {
- this.setData(data);
- });
-
- },
- methods: {
-
- handleBack() {
- this.$router.go(-1);
- },
-
- getRole() {
- let userInfo = uni.getStorageSync('WMS-userinfo')
- var officeId = userInfo.officeDTO.id;
- var roleIds = userInfo.roleIds;
- //区“企业大走访”办公室、政府管理员、厂房板块维护人员
- if (roleIds.indexOf("1910175386924417025") != -1||roleIds.indexOf("ade960e8f02544998b07397304c059c1") != -1||roleIds.indexOf("1996038972899717121") != -1) {
- this.ischeck = false;
- }
-
- },
-
- bindPickerChange(e) {
- const idx = e.detail.value
- const item = this.parkList[idx]
- this.selectedPark = item.label
- this.inputForm.park = item.value
- },
- bindPickerChange2(e) {
- const idx = e.detail.value
- const item = this.parkList2[idx]
- this.selectedownership = item.label
- this.inputForm.ownership = item.value
- },
- bindPickerChange3(e) {
- const idx = e.detail.value
- const item = this.parkList3[idx]
- this.selectedsingleLayer = item.label
- this.inputForm.singleLayer = item.value
- },
-
- bindPickerChange4(e) {
- const idx = e.detail.value
- const item = this.parkList4[idx]
- this.selecteddes7 = item.label
- this.inputForm.des7 = item.value
- },
-
- bindPickerChange5(e) {
- const idx = e.detail.value
- const item = this.parkList5[idx]
- this.selectedcleanRoom = item.label
- this.inputForm.cleanRoom = item.value
- },
-
- bindPickerChange6(e) {
- const idx = e.detail.value
- const item = this.parkList6[idx]
- this.selecteddes3 = item.label
- this.inputForm.des3 = item.value
- },
-
- bindPickerChange7(e) {
- const idx = e.detail.value
- const item = this.parkList7[idx]
- this.selectedispark = item.label
- this.inputForm.ispark = item.value
- },
-
- selectChange2() {
- // 此处为点击的事件
- //this.pickerData=this.pickerDataOld;
- console.log(this.selectedIndustry);
- },
- searchEvent(val) {
- //this.pickerData=this.filteredItems(val);
- },
-
- // industryChange(e){
- // this.selectedIndustry = e.detail.value
- // // 同时拼好 label 字符串
- // const labels = this.selectedIndustry.map(v =>
- // this.industryList.find(d => d.value === v)?.label
- // ).filter(Boolean)
- // this.inputForm.des1 = this.selectedIndustry.join(',')
- // this.inputForm.des2 = labels.join(',')
- // },
-
- // 弹窗点确定
- // confirmIndustry () {
- // // 把 value 数组 -> 字符串
- // this.inputForm.des1 = this.selectedIndustry.join(',')
- // // 把对应 label 拼成字符串
- // const dict = this.industryList
- // const labels = this.selectedIndustry.map(v => {
- // const item = dict.find(d => d.value === v)
- // return item ? item.label : ''
- // })
- // this.inputForm.des2 = labels.join(',')
- // this.showIndustryPicker = false
- // },
-
- // 回显(setData 里调用)
- fillIndustry () {
- // 后端是字符串,先拆成数组
- if (this.inputForm.des1) {
- this.selectedIndustry = this.inputForm.des1.split(',')
- } else {
- this.selectedIndustry = []
- }
- },
-
- validate() {
- for (const key in this.rules) {
- const rule = this.rules[key]
- const val = this.inputForm[key]
-
- if (rule.required && (!val || val === '请选择')) {
- uni.showToast({ title: `请填写${rule.label}`, icon: 'none' })
- return false
- }
- if (rule.pattern && !rule.pattern.test(val)) {
- uni.showToast({ title: `${rule.label}格式有误`, icon: 'none' })
- return false
- }
- }
- return true
- },
-
-
- // 获取上传进度
- progress(e) {
- console.log('上传进度:', e)
- },
- // 上传成功
- success(e) {
- console.log('上传成功')
- },
- // 上传失败
- fail(e) {
- console.log('上传失败:', e)
- },
- deleteFile(e) {
- this.picUrl.splice(e.index, 1)
- },
- deleteFile2(e) {
- this.picUrl2.splice(e.index, 1)
- },
- // 获取上传状态
- select(e) {
- console.log('选择文件:', e)
-
- var _this = this
- var i = 0
- upload()
-
- function upload() {
- if (i >= e.tempFiles.length) {
- return;
- }
- var item = e.tempFiles[i]
- uni.showLoading({
- title: "上传中",
- mask: true
- });
- uni.uploadFile({
- url: '/yd_qycpfb/file/upload?uploadPath=userdir', // 仅为示例,非真实的接口地址
- filePath: item.url,
- name: 'file',
- formData: {
- 'fileName': item.name
- },
- header: {
- 'token': _this.$auth.getUserToken()
- },
- success: (res) => {
- var data = res.data
- if (typeof data['error'] != "undefined") {
- uni.showToast({
- icon: 'none',
- title: '上传失败,请联系开发!'
- });
- _this.$refs.picFile.clearFiles(_this.picLists.length)
- } else {
- _this.picUrl.push({
- url: data,
- uuid: item.uuid
- })
- i++;
- upload()
- }
- },
- fail: () => {
- uni.hideLoading();
- uni.showToast({
- icon: 'none',
- title: '上传失败,请联系开发!'
- });
- _this.$refs.picFile.clearFiles(_this.picLists.length)
- },
- complete: function() {
- uni.hideLoading();
- }
- });
- }
- },
-
- select2(e) {
- console.log('选择文件:', e)
-
- var _this = this
- var i = 0
- upload()
-
- function upload() {
- if (i >= e.tempFiles.length) {
- return;
- }
- var item = e.tempFiles[i]
- uni.showLoading({
- title: "上传中",
- mask: true
- });
- uni.uploadFile({
- url: '/yd_qycpfb/file/upload?uploadPath=userdir', // 仅为示例,非真实的接口地址
- filePath: item.url,
- name: 'file',
- formData: {
- 'fileName': item.name
- },
- header: {
- 'token': _this.$auth.getUserToken()
- },
- success: (res) => {
- var data = res.data
- if (typeof data['error'] != "undefined") {
- uni.showToast({
- icon: 'none',
- title: '上传失败,请联系开发!'
- });
- _this.$refs.picFile2.clearFiles(_this.picLists2.length)
- } else {
- _this.picUrl2.push({
- url: data,
- uuid: item.uuid
- })
- i++;
- upload()
- }
- },
- fail: () => {
- uni.hideLoading();
- uni.showToast({
- icon: 'none',
- title: '上传失败,请联系开发!'
- });
- _this.$refs.picFile2.clearFiles(_this.picLists2.length)
- },
- complete: function() {
- uni.hideLoading();
- }
- });
- }
- },
-
- save(){
-
- if (!this.validate()) return
-
- this.inputForm.state=1;
-
- //产业
-
- const labels = this.selectedIndustry.map(v =>
- this.industryList.find(d => d.value === v)?.label
- ).filter(Boolean)
- this.inputForm.des1 = this.selectedIndustry.join(',')
- this.inputForm.des2 = labels.join(',')
-
- this.inputForm.pic1 = [];
- this.inputForm.pic2 = [];
- this.picUrl.forEach(item => {
- this.inputForm.pic1.push(item.url.replace('https://ydwqfw.com.cn/yd_qycpfbWeb/', ''))
- })
- this.picUrl2.forEach(item => {
- this.inputForm.pic2.push(item.url.replace('https://ydwqfw.com.cn/yd_qycpfbWeb/', ''))
- })
- this.inputForm.pic1 = this.inputForm.pic1.toString();
- this.inputForm.pic2 = this.inputForm.pic2.toString();
-
-
- uni.showLoading()
- loginService.savefactoryBuildings(this.inputForm).then(({
- data
- }) => {
- uni.hideLoading();
- uni.showToast({
- title: "厂房资源提交成功!",
- icon: "success"
- });
- uni.navigateTo({
- url: '/pages/factoryBuildings/factoryBuildingsList'
- })
- }).catch((e) => {
- uni.hideLoading();
- })
- },
-
- tologin(){
- uni.showLoading()
- uni.reLaunch({
- url: '/pages/login/factorylogin'
- })
- },
-
- setData(data){
- this.inputForm = this.recover(this.inputForm, data)
-
- const parkItem = this.parkList.find(p => p.value == data.park);
- // 把中文名赋给用来显示的变量
- this.selectedPark = parkItem ? parkItem.label : '请选择';
-
- /* 同理,如果权属、单层多层也需要回显,照抄两行即可 */
- const ownItem = this.parkList2.find(p => p.value == data.ownership);
- this.selectedownership = ownItem ? ownItem.label : '请选择';
-
- const layerItem = this.parkList3.find(p => p.value == data.singleLayer);
- this.selectedsingleLayer = layerItem ? layerItem.label : '请选择';
-
- const des7Item = this.parkList4.find(p => p.value == data.des7);
-
- this.selecteddes7 = des7Item ? des7Item.label : '请选择';
- console.log("产权:"+this.selecteddes7)
-
- const des3Item = this.parkList6.find(p => p.value == data.des3);
- this.selecteddes3 = des3Item ? des3Item.label : '请选择';
-
-
- /* ===== 洁净车间回显 ===== */
- const cleanItem = this.parkList5.find(p => p.value == data.cleanRoom)
- this.selectedcleanRoom = cleanItem ? cleanItem.label : '请选择'
-
- const isparkItem = this.parkList7.find(p => p.value == data.ispark)
- this.selectedispark = isparkItem ? isparkItem.label : '请选择'
- this.fillIndustry()
-
- if(this.isLogin!=null){
- // 回显图片
- if(this.inputForm.pic2!=undefined&&this.inputForm.pic2!=''){
- let pics=this.inputForm.pic2.split(",");
- pics.forEach(item => {
- if(item!=''){
- this.swiperList.push({
- 'url': "https://ydwqfw.com.cn/yd_qycpfbWeb/"+item,
- })
-
- this.picUrl2.push({
- 'url': "https://ydwqfw.com.cn/yd_qycpfbWeb/"+item,
- 'uuid': item
- })
- this.picLists2.push({
- 'url': "https://ydwqfw.com.cn/yd_qycpfbWeb/"+item,
- 'uuid': item
- })
-
- }
-
- })
- }
-
-
- let pics2=this.inputForm.pic1;
-
- if(pics2!=undefined&&pics2!=''){
- this.swiperList2.push({
- 'url': "https://ydwqfw.com.cn/yd_qycpfbWeb/"+pics2,
- })
-
- this.picUrl.push({
- 'url': "https://ydwqfw.com.cn/yd_qycpfbWeb/"+pics2,
- 'uuid': pics2
- })
- this.picLists.push({
- 'url': "https://ydwqfw.com.cn/yd_qycpfbWeb/"+pics2,
- 'uuid': pics2
- })
-
- }
-
-
-
-
-
-
- }
-
-
-
-
-
- },
- }
- }
- </script>
- <style>
- input,textarea{
- color: #8799a3;
- }
-
- .swiper {
- width: 750rpx;
- height: 310rpx;
- }
-
- .swiper-item {
- width: 750rpx;
- height: 310rpx;
- background-color: aliceblue;
- }
- .show1{
- background-color: #2752eb;
- padding-left: 8rpx;
- }
- .textbg{
- display: flex;
- background-color: white;
- padding-top: 29rpx;
- }
- .text1{
- width: 200rpx;
- margin-left: 30rpx;
- color: #333333;
- font-size: 30rpx;
- }
- .text12{
- width: 260rpx;
- margin-left: 30rpx;
- color: #000000;
- font-size: 29rpx;
- }
-
- .text2{
- flex: 1;
- color: #000000;
- font-size: 30rpx;
- padding-bottom: 2rpx;
- }
-
- .text33{
- flex: 1;
- color: #FF4500;
- font-size: 30rpx;
- padding-bottom: 2rpx;
- }
-
- .text44{
- flex: 1;
- color: #1E8AD7;
- font-size: 30rpx;
- padding-bottom: 2rpx;
-
- }
- .text44.placeholder {
- color: #999; /* 灰色,用于未选择时 */
- }
-
- .text22{
- flex: 1;
- color: #666666;
- font-size: 29rpx;
- padding-bottom: 2rpx;
- }
-
- .text221{
- flex: 1;
- color: #666666;
- font-size: 29rpx;
- padding-right:15rpx ;
- padding-bottom: 2rpx;
- }
- .text3{
- display: flex;
- color: #000000;
- }
- .phone{
- display: flex;
- color: #1E8AD7;
- padding-left: 5rpx;
- padding-right: 5rpx;
- font-size: 30rpx;
- align-items: center
- }
- .phoneimg{
- margin-left: 10rpx;
- width: 35rpx;
- height: 35rpx;
- }
- .titlebg2{
- display: flex;
- background-color: white;
- padding-left: 22rpx;
- padding-top: 35rpx;
- padding-bottom: 25rpx;
- margin-bottom: 2rpx;
- }
- .titlet1{
- width: 7rpx;
- margin-top: 7rpx;
- margin-bottom: 7rpx;
- background-color: #2752eb;
- margin-right: 8rpx;
- }
- .titlet2{
- font-weight: 800;
- color: #2752eb;
- }
- .overlay{
- position: fixed; /* 固定定位,覆盖整个页面 */
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background-color: rgba(255, 255, 255, 0.5); /* 半透明白色背景 */
- z-index: 1000; /* 确保遮罩在页面内容之上 */
- }
-
-
- .custom-header {
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 10px;
- width: 100%;
- }
-
- .is-back {
- position: relative;
- }
-
- .back-container {
- position: absolute;
- left: 10px;
- cursor: pointer;
- }
-
- .back-text {
- color: white; /* 返回按钮文本颜色 */
- }
-
- .content-container {
- flex: 1;
- text-align: center;
- }
-
- .content-text {
- color: white; /* 标题文本颜色 */
- font-weight: bold;
- }
-
- /* 背景颜色 */
- .bg-blue {
- background-color: #4285f4; /* 假设这是一个蓝色背景 */
- }
-
- .input2 {
- flex: 1;
- font-size: 30rpx;
- color: #1E8AD7; /* 想保持的蓝色 */
- padding-right: 20rpx;
- width: 100%;
- }
-
- /* 关键:把颜色强制透传到组件内部 input/占位节点 */
- .input2 .input, /* 有的版本用 .input */
- .input2 .uni-input, /* 有的版本用 .uni-input */
- .input2 input::placeholder,
- .input2 .placeholder {
- color: #1E8AD7 !important; /* 强制覆盖黑色 */
- }
- .input2 * {
- color: #1E8AD7 !important;
- }
-
-
- /* 强制让 zqs-select 内部所有文字都变成蓝色 */
- .input2,
- .input2 *,
- .input2 .input,
- .input2 .uni-input,
- .input2 .select-input,
- .input2 .select-tag,
- .input2 .placeholder,
- .input2 input,
- .input2 .input-placeholder,
- .input2 .uni-input-placeholder {
- color: #1E8AD7 !important;
- }
-
- /deep/ .input2 input {
- color: #1E8AD7 !important;
- font-size: 30rpx !important;
- }
- </style>
|