tearOldPipe.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <template>
  2. <view class="background">
  3. <view class="uni-list">
  4. <view class="container">
  5. <view>
  6. 小区
  7. </view>
  8. <view class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('xq')">
  9. <span>{{attributeXQ}}</span>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="uni-list">
  14. <view class="container">
  15. <view class="uni-list-cell-left">
  16. 楼栋
  17. </view>
  18. <view class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('ld')">
  19. <span>{{attributeLD}}</span>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="uni-list" style="margin-top: 10;">
  24. <view class="container">
  25. <view class="uni-list-cell-left">
  26. 单元
  27. </view>
  28. <view class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('dy')">
  29. <span>{{attributeDY}}</span>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="uni-list">
  34. <view class="container">
  35. <view class="uni-list-cell-left">
  36. 房间
  37. </view>
  38. <view class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('fj')">
  39. <span>{{attributeFJ}}</span>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="container">
  44. <view class="title">是否按照施工图纸施工</view>
  45. <switch checked @change="switch2Change" />
  46. </view>
  47. <SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="communityName"
  48. subtitleKey="address" v-model="communityName"></SelectPicker>
  49. </view>
  50. </template>
  51. <script>
  52. import SelectPicker from '../../../components/selectPicker/select_picker.vue'
  53. export default {
  54. components: {
  55. SelectPicker
  56. },
  57. data() {
  58. return {
  59. type: '',
  60. open: false,
  61. selectList: [],
  62. XQValue: {},
  63. LDValue: {},
  64. DYValue: {},
  65. FJValue: {},
  66. XQList: [{
  67. "communityName": "乐彩花园",
  68. "address": "乐彩花园(新华路东100米)",
  69. "id": "00"
  70. }, {
  71. "communityName": "进行蓉城",
  72. "address": "运河城万佳广场(兴隆桥北街)",
  73. "id": "01"
  74. }, {
  75. "communityName": "万达华府1、2号院",
  76. "address": "万达华府",
  77. "id": "02"
  78. }, {
  79. "communityName": "万达华府8--10号楼",
  80. "address": "万达华府",
  81. "id": "03"
  82. }, {
  83. "communityName": "万达华府2--8号楼",
  84. "address": "万达华府",
  85. "id": "04"
  86. }, {
  87. "communityName": "万达华府1--3号楼",
  88. "address": "万达华府",
  89. "id": "05"
  90. }],
  91. index: 0,
  92. address: null,
  93. title: 'picker',
  94. transformerValue: '请选择楼栋',
  95. LDList: [{
  96. "communityName": "1栋",
  97. "address": "乐彩花园(新华路东100米)",
  98. "id": "000"
  99. }, {
  100. "communityName": "2栋",
  101. "address": "运河城万佳广场(兴隆桥北街)",
  102. "id": "001"
  103. }, {
  104. "communityName": "3栋",
  105. "address": "万达华府",
  106. "id": "002"
  107. }, {
  108. "communityName": "4栋",
  109. "address": "万达华府",
  110. "id": "003"
  111. }, {
  112. "communityName": "5栋",
  113. "address": "万达华府",
  114. "id": "004"
  115. }, {
  116. "communityName": "6栋",
  117. "address": "万达华府",
  118. "id": "005"
  119. }],
  120. DYList: [{
  121. "communityName": "一单元",
  122. "address": "乐彩花园(新华路东100米)",
  123. "id": "011"
  124. }, {
  125. "communityName": "二单元",
  126. "address": "运河城万佳广场(兴隆桥北街)",
  127. "id": "012"
  128. }, {
  129. "communityName": "三单元",
  130. "address": "万达华府",
  131. "id": "013"
  132. }, {
  133. "communityName": "四单元",
  134. "address": "万达华府",
  135. "id": "014"
  136. }, {
  137. "communityName": "五单元",
  138. "address": "万达华府",
  139. "id": "015"
  140. }, {
  141. "communityName": "六单元",
  142. "address": "万达华府",
  143. "id": "016"
  144. }],
  145. FJList: [{
  146. "communityName": "101",
  147. "address": "乐彩花园(新华路东100米)",
  148. "id": "021"
  149. }, {
  150. "communityName": "201",
  151. "address": "运河城万佳广场(兴隆桥北街)",
  152. "id": "022"
  153. }, {
  154. "communityName": "301",
  155. "address": "万达华府",
  156. "id": "023"
  157. }, {
  158. "communityName": "401",
  159. "address": "万达华府",
  160. "id": "024"
  161. }, {
  162. "communityName": "501",
  163. "address": "万达华府",
  164. "id": "025"
  165. }, {
  166. "communityName": "601",
  167. "address": "万达华府",
  168. "id": "026"
  169. }],
  170. }
  171. },
  172. onLoad() {
  173. uni.setNavigationBarTitle({
  174. title: '旧改工程-室内'
  175. })
  176. },
  177. computed: {
  178. attributeXQ() {
  179. return this.XQValue.communityName ? this.XQValue.communityName : "请选择小区"
  180. },
  181. attributeLD() {
  182. return this.LDValue.communityName ? this.LDValue.communityName : "请选择楼栋"
  183. },
  184. attributeDY() {
  185. return this.DYValue.communityName ? this.DYValue.communityName : "请选择单元"
  186. },
  187. attributeFJ() {
  188. return this.FJValue.communityName ? this.FJValue.communityName : "请选择房间"
  189. }
  190. },
  191. methods: {
  192. //判断是否选择
  193. isEmpty(str) {
  194. return (!str || 0 === str.length);
  195. },
  196. pickerShow(e) {
  197. this.type = e; //赋值类型
  198. if (e == 'xq') {
  199. this.open = true;
  200. this.selectList = this.XQList;
  201. } else if (e == 'ld') {
  202. if (this.isEmpty(this.XQValue.id)) {
  203. uni.showToast({
  204. title: '请选择小区',
  205. icon: 'error',
  206. duration: 1000
  207. });
  208. } else {
  209. this.open = true;
  210. this.selectList = this.LDList;
  211. }
  212. } else if (e == 'dy') {
  213. if (this.isEmpty(this.LDValue.id)) {
  214. uni.showToast({
  215. title: '请选择楼栋',
  216. icon: 'error',
  217. duration: 1000
  218. });
  219. } else {
  220. this.open = true;
  221. this.selectList = this.DYList;
  222. }
  223. } else if (e == 'fj') {
  224. if (this.isEmpty(this.DYValue.id)) {
  225. uni.showToast({
  226. title: '请选择单元',
  227. icon: 'error',
  228. duration: 1000
  229. });
  230. } else {
  231. this.open = true;
  232. this.selectList = this.FJList;
  233. }
  234. }
  235. },
  236. bindPickerChange(e) {
  237. console.log('picker发送选择改变,携带值为', e.detail.value)
  238. this.index = e.detail.value
  239. },
  240. bindDateChange(e) {
  241. this.date = e.detail.value
  242. },
  243. switch2Change(e) {
  244. console.log('switch2 发生 change 事件,携带值为', e.detail.value)
  245. },
  246. changeSelect(item, index) {
  247. this.index = index;
  248. this.address = item.communityName;
  249. this.open = false;
  250. if (this.type == 'xq') {
  251. this.XQValue = item;
  252. } else if (this.type == 'ld') {
  253. this.LDValue = item;
  254. } else if (this.type == 'dy') {
  255. this.DYValue = item;
  256. } else if (this.type == 'fj') {
  257. this.FJValue = item;
  258. }
  259. },
  260. //关闭弹窗
  261. close(e) {
  262. this.open = false
  263. }
  264. }
  265. }
  266. </script>
  267. <style>
  268. .container {
  269. display: flex;
  270. margin-left: 10px;
  271. margin-top: 10px;
  272. margin-right: 10px;
  273. align-items: flex-start;
  274. justify-content: space-between;
  275. }
  276. .text {
  277. font-size: 16px;
  278. color: #333;
  279. }
  280. .background {
  281. border: 15px solid hsla(0, 0%, 100%, .5);
  282. background: white;
  283. background-clip: padding-box;
  284. /*从padding开始往外面裁剪背景*/
  285. }
  286. </style>