index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <template>
  2. <view>
  3. <view class="view-bg">
  4. <text class="title-txt">工程用料统计</text>
  5. <view>
  6. <view class="uni-list-cell">
  7. <view class="uni-list-cell-left">
  8. 小区
  9. </view>
  10. <view class="uni-list-cell-db">
  11. <picker @change="bindPickerVillageChange" :value="villageIndex" :range="villageList"
  12. range-key="name">
  13. <view class="uni-input">{{villageList[villageIndex].name}}</view>
  14. </picker>
  15. </view>
  16. </view>
  17. <view class="uni-list-cell">
  18. <view class="uni-list-cell-left">
  19. 规格
  20. </view>
  21. <view class="uni-list-cell-db">
  22. <picker @change="bindPickerSpecificationChange" :value="specificationIndex"
  23. :range="specificationList" range-key="name">
  24. <view class="uni-input">{{specificationList[specificationIndex].name}}</view>
  25. </picker>
  26. </view>
  27. </view>
  28. <view class="uni-list-cell">
  29. <view class="uni-list-cell-left">
  30. 材料
  31. </view>
  32. <view class="uni-list-cell-db">
  33. <picker @change="bindPickerMaterialChange" :value="materialIndex" :range="materialList"
  34. range-key="name">
  35. <view class="uni-input">{{materialList[materialIndex].name}}</view>
  36. </picker>
  37. </view>
  38. </view>
  39. </view>
  40. <uni-divider></uni-divider>
  41. <uni-table ref="table">
  42. <uni-tr>
  43. <uni-th width="20" align="center"></uni-th>
  44. <uni-th width="20" align="center">预计用量</uni-th>
  45. <uni-th width="20" align="center">实际用量</uni-th>
  46. </uni-tr>
  47. <uni-tr v-for="(item, index) in materialUsageList" :key="index">
  48. <uni-td>{{ item.name }}</uni-td>
  49. <uni-td>{{ item.estimatedUsage }}</uni-td>
  50. <uni-td>{{ item.actualUsage }}</uni-td>
  51. </uni-tr>
  52. </uni-table>
  53. </view>
  54. <view class="view-bg">
  55. <text class="title-txt">工程进度统计</text>
  56. <view>
  57. <view class="uni-list-cell">
  58. <view class="uni-list-cell-left">
  59. 小区
  60. </view>
  61. <view class="uni-list-cell-db">
  62. <picker @change="bindPickerVillageChange2" :value="villageIndex2" :range="villageList"
  63. range-key="name">
  64. <view class="uni-input">{{villageList[villageIndex2].name}}</view>
  65. </picker>
  66. </view>
  67. </view>
  68. <view class="uni-list-cell">
  69. <view class="uni-list-cell-left">
  70. 楼栋
  71. </view>
  72. <view class="uni-list-cell-db">
  73. <picker @change="bindPickerBuildChange" :value="buildIndex" :range="buildList" range-key="name">
  74. <view class="uni-input">{{buildList[buildIndex].name}}</view>
  75. </picker>
  76. </view>
  77. </view>
  78. <view class="uni-list-cell">
  79. <view class="uni-list-cell-left">
  80. 单元
  81. </view>
  82. <view class="uni-list-cell-db">
  83. <picker @change="bindPickerUnitChange" :value="unitIndex" :range="unitList" range-key="name">
  84. <view class="uni-input">{{unitList[unitIndex].name}}</view>
  85. </picker>
  86. </view>
  87. </view>
  88. </view>
  89. <uni-divider></uni-divider>
  90. <view class="view_bg_build">
  91. <uni-grid :column="roomCount" :highlight="true" @change="change">
  92. <uni-grid-item v-for="(item, index) in roomList" :index="index" :key="index">
  93. <view class="centered" style="background-color: #fff;">
  94. <!-- <uni-icons type="image" :size="30" color="#777" /> -->
  95. <text>{{item.roomNumber}}</text>
  96. </view>
  97. </uni-grid-item>
  98. </uni-grid>
  99. </view>
  100. </view>
  101. </view>
  102. </template>
  103. <script>
  104. import {getAreaList,getBuildingList,getUnitList,getHousesList} from '@/api/common'
  105. export default {
  106. data() {
  107. return {
  108. villageIndex: 0,
  109. specificationIndex: 0,
  110. materialIndex: 0,
  111. villageIndex2: 0,
  112. buildIndex: 0,
  113. unitIndex: 0,
  114. villageList: /* [{
  115. name: '小区001'
  116. }, {
  117. name: '小区002'
  118. }, {
  119. name: '小区003'
  120. }, {
  121. name: '小区004'
  122. }] */,
  123. specificationList: [{
  124. name: '规格001'
  125. }, {
  126. name: '规格002'
  127. }, {
  128. name: '规格003'
  129. }, {
  130. name: '规格004'
  131. }],
  132. materialList: [{
  133. name: '材料001'
  134. }, {
  135. name: '材料002'
  136. }, {
  137. name: '材料003'
  138. }, {
  139. name: '材料004'
  140. }],
  141. buildList: [{
  142. name: '楼栋001'
  143. }, {
  144. name: '楼栋002'
  145. }, {
  146. name: '楼栋003'
  147. }, {
  148. name: '楼栋004'
  149. }],
  150. unitList: [{
  151. name: '单元001'
  152. }, {
  153. name: '单元002'
  154. }, {
  155. name: '单元003'
  156. }, {
  157. name: '单元004'
  158. }],
  159. materialUsageList: [{
  160. name: '0.5cm钢',
  161. estimatedUsage: 1210,
  162. actualUsage: 6852
  163. }, {
  164. name: '1.0cm钢',
  165. estimatedUsage: 1680,
  166. actualUsage: 6852
  167. }, {
  168. name: '1.5cm钢',
  169. estimatedUsage: 1503,
  170. actualUsage: 6852
  171. }],
  172. roomList: [{
  173. roomNumber: '601',
  174. status: '0'
  175. }, {
  176. roomNumber: '602',
  177. status: '0'
  178. }, {
  179. roomNumber: '603',
  180. status: '0'
  181. }, {
  182. roomNumber: '604',
  183. status: '0'
  184. }, {
  185. roomNumber: '501',
  186. status: '0'
  187. }, {
  188. roomNumber: '502',
  189. status: '0'
  190. }, {
  191. roomNumber: '503',
  192. status: '0'
  193. }, {
  194. roomNumber: '504',
  195. status: '0'
  196. }, {
  197. roomNumber: '401',
  198. status: '0'
  199. }, {
  200. roomNumber: '402',
  201. status: '0'
  202. }, {
  203. roomNumber: '403',
  204. status: '0'
  205. }, {
  206. roomNumber: '404',
  207. status: '0'
  208. }, {
  209. roomNumber: '301',
  210. status: '0'
  211. }, {
  212. roomNumber: '302',
  213. status: '0'
  214. }, {
  215. roomNumber: '303',
  216. status: '0'
  217. }, {
  218. roomNumber: '304',
  219. status: '0'
  220. }, {
  221. roomNumber: '201',
  222. status: '0'
  223. }, {
  224. roomNumber: '202',
  225. status: '0'
  226. }, {
  227. roomNumber: '203',
  228. status: '0'
  229. }, {
  230. roomNumber: '204',
  231. status: '0'
  232. }, {
  233. roomNumber: '101',
  234. status: '0'
  235. }, {
  236. roomNumber: '102',
  237. status: '0'
  238. }, {
  239. roomNumber: '103',
  240. status: '0'
  241. }, {
  242. roomNumber: '104',
  243. status: '0'
  244. }],
  245. roomCount: 4
  246. }
  247. },
  248. created() {
  249. // this.chooseVillage()
  250. // this.getDicts("district").then(response =>{
  251. // // this.xxx=response.data
  252. // })
  253. getAreaList().then(res => {
  254. villageList=res;
  255. })
  256. // getBuildingList('100').then(res => {
  257. // debugger
  258. // console.log(res)
  259. // })
  260. // getUnitList('1098').then(res => {
  261. // debugger
  262. // console.log(res)
  263. // })
  264. // getHousesList('13631').then(res => {
  265. // debugger
  266. // console.log(res)
  267. // })
  268. },
  269. methods: {
  270. bindPickerVillageChange: function(e) {
  271. debugger
  272. this.villageIndex = e.detail.value
  273. },
  274. bindPickerSpecificationChange: function(e) {
  275. this.specificationIndex = e.detail.value
  276. },
  277. bindPickerMaterialChange: function(e) {
  278. this.materialIndex = e.detail.value
  279. },
  280. bindPickerVillageChange2: function(e) {
  281. this.villageIndex2 = e.detail.value
  282. },
  283. bindPickerBuildChange: function(e) {
  284. this.buildIndex = e.detail.value
  285. },
  286. bindPickerUnitChange: function(e) {
  287. this.unitIndex = e.detail.value
  288. },
  289. }
  290. }
  291. </script>
  292. <style>
  293. .marginLeft5 {
  294. margin-left: 5px;
  295. }
  296. .title-txt {
  297. font-size: 15px;
  298. font-weight: bold;
  299. color: black;
  300. }
  301. .content-txt {
  302. font-size: 10px;
  303. font-weight: bold;
  304. color: black;
  305. }
  306. .view-bg {
  307. margin-left: 8px;
  308. margin-right: 8px;
  309. margin-top: 8px;
  310. padding: 10px;
  311. background-color: #fff;
  312. border-radius: 5px;
  313. }
  314. .uni-list {
  315. background-color: #FFFFFF;
  316. position: relative;
  317. width: 100%;
  318. display: flex;
  319. flex-direction: column;
  320. }
  321. .uni-list-cell-db,
  322. .uni-list-cell {
  323. position: relative;
  324. display: flex;
  325. flex-direction: row;
  326. justify-content: space-between;
  327. align-items: center;
  328. }
  329. .uni-list-cell-left {
  330. white-space: nowrap;
  331. font-size: 28rpx;
  332. }
  333. .centered {
  334. text-align: center;
  335. background-color: #e2f4ff;
  336. }
  337. .text {
  338. background-color: #e2f4ff;
  339. height: 20rpx;
  340. }
  341. .view_bg_build {
  342. background-color: #e2f4ff;
  343. padding: 10rpx;
  344. margin: 20rpx;
  345. }
  346. </style>