Commit 0b1c327a9b246712ebb45e1265b5c61c8fcfbb11
1 parent
8704577c
Exists in
charge
fix:基础表格文字右对齐、文件上传大小限制20M、选择框回显值区分
Showing
2 changed files
with
35 additions
and
23 deletions
Show diff stats
components/basisCellCard/basisCellCard.vue
... | ... | @@ -8,7 +8,7 @@ |
8 | 8 | <view class="w40 text-gray"> |
9 | 9 | {{item.name}} |
10 | 10 | </view> |
11 | - <view class="w80 flex justify-end"> | |
11 | + <view class="w80 flex justify-end text-right"> | |
12 | 12 | <view class="" v-if="item.type === 'tag' && item.value"> |
13 | 13 | <u-tag :text="item.value" :bgColor="item.bgColor" :color="item.color" :borderColor="item.borderColor"></u-tag> |
14 | 14 | </view> | ... | ... |
pages/charge/visitsAndFees/createaVisit.vue
... | ... | @@ -197,11 +197,12 @@ |
197 | 197 | </view> |
198 | 198 | |
199 | 199 | <!-- 字典选择 --> |
200 | - <u-picker :show="pickerShow" ref="uPicker" closeOnClickOverlay :columns="columns" @cancel="pickerShow = false" | |
201 | - @close="pickerShow = false" keyName="label" @confirm="confirm" :defaultIndex="[0]"></u-picker> | |
200 | + <u-picker :show="pickerShow" :showSearch="currentName === 'vlgOrCmty' || currentName === 'userName'" ref="uPicker" | |
201 | + closeOnClickOverlay :columns="columns" @cancel="pickerShow = false" @close="pickerShow = false" keyName="label" | |
202 | + @confirm="confirm"></u-picker> | |
202 | 203 | |
203 | 204 | <!-- 公司选择 --> |
204 | - <u-picker :show="gsShow" ref="gsPicker" closeOnClickOverlay :title="gsName" :columns="companyList" | |
205 | + <u-picker showSearch :show="gsShow" ref="gsPicker" closeOnClickOverlay :title="gsName" :columns="companyList" | |
205 | 206 | @cancel="gsShow = false" @close="gsShow = false" keyName="label" @confirm="gsConfirm" |
206 | 207 | @change="changeHandler"></u-picker> |
207 | 208 | |
... | ... | @@ -283,7 +284,8 @@ |
283 | 284 | remark: "", |
284 | 285 | attachmentFile: "", |
285 | 286 | }, |
286 | - fileSize:20971520, //限制文件大小为20M | |
287 | + fileSize: 20971520, //限制文件大小为20M | |
288 | + defaultIndex: {}, | |
287 | 289 | copyModel: {}, |
288 | 290 | rules: { |
289 | 291 | billingPersonName: [{ |
... | ... | @@ -398,13 +400,15 @@ |
398 | 400 | required: false, |
399 | 401 | message: '请填写用户编号', |
400 | 402 | trigger: ['blur', 'change'] |
401 | - }, { | |
402 | - validator: (rule, value, callback) => { | |
403 | - return uni.$u.test.digits(value) | |
404 | - }, | |
405 | - message: '用户编号不正确', | |
406 | - trigger: ['change', 'blur'], | |
407 | - }], | |
403 | + }, | |
404 | + // { | |
405 | + // validator: (rule, value, callback) => { | |
406 | + // return uni.$u.test.digits(value) | |
407 | + // }, | |
408 | + // message: '用户编号不正确', | |
409 | + // trigger: ['change', 'blur'], | |
410 | + // } | |
411 | + ], | |
408 | 412 | userIdCard: [{ |
409 | 413 | required: true, |
410 | 414 | message: '请填写身份证号', |
... | ... | @@ -637,7 +641,7 @@ |
637 | 641 | type: "input", |
638 | 642 | key: "visitDetailedAddress", |
639 | 643 | show: true, |
640 | - disabled:true | |
644 | + disabled: true | |
641 | 645 | }, { |
642 | 646 | label: '上传图片', |
643 | 647 | required: true, |
... | ... | @@ -758,7 +762,7 @@ |
758 | 762 | }, |
759 | 763 | onLoad(data) { |
760 | 764 | this.init(); |
761 | - console.log('data===?',data); | |
765 | + console.log('data===?', data); | |
762 | 766 | if (data.objData) { |
763 | 767 | let obj = JSON.parse(data.objData); |
764 | 768 | this.model = { |
... | ... | @@ -866,9 +870,9 @@ |
866 | 870 | if (!this.$isDing) { |
867 | 871 | return |
868 | 872 | } |
869 | - var host= window.location.origin + '/'; | |
873 | + var host = window.location.origin + '/'; | |
870 | 874 | // let currentUrl = window.location.href; |
871 | - console.log("钉钉定位",host) | |
875 | + console.log("钉钉定位", host) | |
872 | 876 | // let currentUrl = "http://192.168.0.53:8001/" |
873 | 877 | let data = { |
874 | 878 | url: host |
... | ... | @@ -999,11 +1003,11 @@ |
999 | 1003 | value: item.vlgOrCmty, |
1000 | 1004 | label: `${item.vlgOrCmty}(${item.urbRurCls})`, |
1001 | 1005 | urbRurCls: item.urbRurCls, |
1002 | - province:item.province, | |
1003 | - city:item.city, | |
1004 | - district:item.district, | |
1005 | - street:item.street, | |
1006 | - address:`${item.province}${item.city}${item.district}${item.street}` | |
1006 | + province: item.province, | |
1007 | + city: item.city, | |
1008 | + district: item.district, | |
1009 | + street: item.street, | |
1010 | + address: `${item.province}${item.city}${item.district}${item.street}` | |
1007 | 1011 | })); |
1008 | 1012 | this.columns = [col]; |
1009 | 1013 | } else if (item.key === 'userName') { |
... | ... | @@ -1038,6 +1042,9 @@ |
1038 | 1042 | let dictArr = this.getDictDatas(dict); |
1039 | 1043 | this.columns = [dictArr]; |
1040 | 1044 | } |
1045 | + let defaultIndex = this.defaultIndex[this.currentName]; | |
1046 | + console.log("是否有默认值", defaultIndex) | |
1047 | + this.$refs.uPicker.setIndexs(defaultIndex ? [defaultIndex] : [0], true) | |
1041 | 1048 | this.pickerShow = true; |
1042 | 1049 | console.log(this.columns); |
1043 | 1050 | // console.log("字典数组", dictArr); |
... | ... | @@ -1068,6 +1075,9 @@ |
1068 | 1075 | let dict = item.dict; |
1069 | 1076 | let dictArr = this.getDictDatas(dict); |
1070 | 1077 | this.columns = [dictArr]; |
1078 | + let defaultIndex = this.defaultIndex[this.currentName]; | |
1079 | + console.log("是否有默认值", defaultIndex) | |
1080 | + this.$refs.uPicker.setIndexs(defaultIndex ? [defaultIndex] : [0], true) | |
1071 | 1081 | this.pickerShow = true; |
1072 | 1082 | }, |
1073 | 1083 | // 选择弹出层确认 |
... | ... | @@ -1110,6 +1120,8 @@ |
1110 | 1120 | } else { |
1111 | 1121 | this.model[this.currentName] = e.value[0].value |
1112 | 1122 | } |
1123 | + this.defaultIndex[this.currentName] = e.indexs[0]; | |
1124 | + console.log("默认值", this.defaultIndex) | |
1113 | 1125 | this.pickerShow = false; |
1114 | 1126 | }, |
1115 | 1127 | // 项目公司切换 |
... | ... | @@ -1344,8 +1356,8 @@ |
1344 | 1356 | // extension: ['.doc', '.xlsx', '.docx'], |
1345 | 1357 | success: async (res) => { |
1346 | 1358 | let size = res.tempFiles[0].size |
1347 | - console.log("上传附件",res); | |
1348 | - if(size > this.fileSize){ | |
1359 | + console.log("上传附件", res); | |
1360 | + if (size > this.fileSize) { | |
1349 | 1361 | uni.$u.toast("请上传20M以内的文件"); |
1350 | 1362 | return |
1351 | 1363 | } | ... | ... |