zwTable.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. <!--专维-->
  2. <template>
  3. <div class='zw-list'>
  4. <div class='eq-list-top'>
  5. <el-date-picker
  6. size='small'
  7. value-format='yyyy'
  8. v-model='nd'
  9. type='year'
  10. placeholder='请选择年度'
  11. @change='getList'
  12. style='width:180px;margin-right:12px'
  13. ></el-date-picker>
  14. <Select width='160' tipPlace='top' v-model='lb' caption='类别:' :selectdata='lbOption' :placeholder='"请选择"' @change='getList'></Select>
  15. <Select
  16. width='160'
  17. tipPlace='top'
  18. size='small'
  19. v-model='xm'
  20. caption='项目 :'
  21. :selectdata='xmOption'
  22. style='margin:0 12px'
  23. @change='getList'
  24. ></Select>
  25. <el-input placeholder='搜索实施方案说明' prefix-icon='el-icon-search' size='small' style='width:192px' v-model='ssfasm' clearable @blur='getList'></el-input>
  26. <!-- 当前阶段 -->
  27. <Select
  28. width='180'
  29. tipPlace='top'
  30. size='small'
  31. v-model='sxjd'
  32. caption='当前阶段 :'
  33. :selectdata='sxjdOption'
  34. style='margin:0 12px'
  35. @change='getList'
  36. ></Select>
  37. <!-- placeholder='选择立项时间' -->
  38. <div class='picker-box'>
  39. <span class='picker-span'>立项日期:</span>
  40. <el-date-picker
  41. style='width:190px'
  42. v-model='lxsjwcsj'
  43. value-format='yyyyMMdd'
  44. type='daterange'
  45. @change='getList'
  46. size='mini'
  47. range-separator='-'
  48. start-placeholder
  49. end-placeholder
  50. ></el-date-picker>
  51. </div>
  52. <!-- placeholder='选择验收时间' -->
  53. <input-dialog v-if='statusOption.length>0' :statusOption='statusOption' :type='4' @confirm='confirm'></input-dialog>
  54. </div>
  55. <el-table :data='tableData' :border='true' style='width: 100%'>
  56. <el-table-column type='index' label='序号' width='60' :index='indexMethod'></el-table-column>
  57. <el-table-column prop='nd' label='年度' show-overflow-tooltip resizable width='80'>
  58. <template slot-scope='{row}'>{{row.nd || '--'}}</template>
  59. </el-table-column>
  60. <el-table-column prop='qs' label='期数' show-overflow-tooltip resizable width='80'>
  61. <template slot-scope='{row}'>{{row.qs || '--'}}</template>
  62. </el-table-column>
  63. <el-table-column prop='lb' label='类别' show-overflow-tooltip resizable min-width='210'>
  64. <template slot-scope='{row}'>{{row.lb || '--'}}</template>
  65. </el-table-column>
  66. <el-table-column prop='xm' label='项目' show-overflow-tooltip resizable min-width='150'>
  67. <template slot-scope='{row}'>{{row.xm || '--'}}</template>
  68. </el-table-column>
  69. <el-table-column prop='sl' label='数量' show-overflow-tooltip resizable width='80'>
  70. <template slot-scope='{row}'>{{row.sl>=0?row.sl:'--'}}</template>
  71. </el-table-column>
  72. <el-table-column prop='ssfasm' label='实施方案说明' show-overflow-tooltip resizable min-width='320'>
  73. <template slot-scope='{row}'>{{row.ssfasm || '--'}}</template>
  74. </el-table-column>
  75. <el-table-column prop='sxjd' label='当前阶段' show-overflow-tooltip resizable width='80'>
  76. <template slot-scope='{row}'>{{row.sxjd || '--'}}</template>
  77. </el-table-column>
  78. <el-table-column prop='lxsjwcsj' label='立项日期' show-overflow-tooltip resizable width='140'>
  79. <template slot-scope='{row}'>{{row.lxsjwcsj?formatter(row.lxsjwcsj):'--'}}</template>
  80. </el-table-column>
  81. <el-table-column prop='yssjwcsj' label='验收日期' show-overflow-tooltip resizable width='140'>
  82. <template slot-scope='{row}'>{{row.yssjwcsj?formatter(row.yssjwcsj):'--'}}</template>
  83. </el-table-column>
  84. <el-table-column prop='status' label='验收结果' show-overflow-tooltip resizable width='90'>
  85. <template slot-scope='{row}'>{{row.status || '--'}}</template>
  86. </el-table-column>
  87. <el-table-column prop='zfje' label='结算金额' show-overflow-tooltip resizable width='80'>
  88. <template slot-scope='{row}'>{{number_format(row.zfje,2)|| '--'}}</template>
  89. </el-table-column>
  90. <el-table-column prop='xlcfwz' label='资料存放位置' show-overflow-tooltip resizable width='100'>
  91. <template slot-scope='{row}'>{{row.xlcfwz || '--'}}</template>
  92. </el-table-column>
  93. </el-table>
  94. <div class='foot'>
  95. <el-pagination
  96. background
  97. layout='prev, pager, next'
  98. :total='total'
  99. :page-size='size'
  100. @prev-click='pageChanged'
  101. @next-click='pageChanged'
  102. @current-change='pageChanged'
  103. ></el-pagination>
  104. </div>
  105. </div>
  106. </template>
  107. <script>
  108. import Select from '@/components/Select/Select.vue'
  109. import { queryZw } from '@/api/equipmentList.js'
  110. import { querySelect } from '@/api/public.js'
  111. import { mapGetters } from 'vuex'
  112. import inputDialog from './inputDIalog'
  113. import { formatter, number_format } from '@/utils/format.js'
  114. export default {
  115. components: { Select, inputDialog },
  116. data() {
  117. return {
  118. tableData: [],
  119. total: 0,
  120. currentPage: 1,
  121. yssjwcsj: '',
  122. lxsjwcsj: '',
  123. ssfasm: '',
  124. size: 11,
  125. keyword: '',
  126. nd: '',
  127. lb: '',
  128. sxjd: '',
  129. formatter,
  130. number_format,
  131. xm: '',
  132. statusOption: [],
  133. sxjdOption: [],
  134. xmOption: [],
  135. lbOption: []
  136. }
  137. },
  138. computed: {
  139. ...mapGetters(['floorSelect'])
  140. },
  141. props: ['smsxt', 'major', 'diff', 'tabLabel'],
  142. methods: {
  143. //序号的方法
  144. indexMethod(index) {
  145. return (this.currentPage - 1) * this.size + index + 1
  146. },
  147. //多余输入框监听
  148. confirm(status, yssjwcsj) {
  149. this.yssjwcsj = yssjwcsj
  150. this.status = status
  151. this.getList()
  152. },
  153. pageChanged(page) {
  154. this.currentPage = page
  155. this.getList()
  156. },
  157. //下拉框查询
  158. tabFind() {
  159. let postParams = [
  160. {
  161. columnName: { lb: 'lb', xm: 'xm', sxjd: 'sxjd', status: 'status' },
  162. tableName: 'v_glsms_zw' //视图名称
  163. }
  164. ]
  165. let major
  166. if (this.major.slice(0, 2) == 'GD') {
  167. major = '供电'
  168. } else if (this.major.slice(0, 2) == 'XF') {
  169. major = '消防'
  170. } else if (this.major.slice(0, 2) == 'GPS') {
  171. major = '给排水'
  172. } else if (this.major.slice(0, 2) == 'DT') {
  173. major = '电梯'
  174. } else if (this.major.slice(0, 2) == 'RQ') {
  175. major = '燃气'
  176. } else if (this.major.slice(0, 2) == 'RD') {
  177. major = '弱电'
  178. } else if (this.major.slice(0, 2) == 'NT') {
  179. major = '暖通'
  180. } else if (this.major.slice(0, 2) == 'TJ') {
  181. major = '土建'
  182. } else {
  183. major = this.major
  184. }
  185. let data = {
  186. major: major,
  187. plazaId: this.$store.state.plazaId
  188. }
  189. querySelect({ data, postParams }).then(res => {
  190. //console.log(res)
  191. let lb = res.data.data.v_glsms_zw.lb
  192. let xm = res.data.data.v_glsms_zw.xm
  193. let sxjd = res.data.data.v_glsms_zw.sxjd
  194. let status = res.data.data.v_glsms_zw.status
  195. this.lbOption = []
  196. this.xmOption = []
  197. this.sxjdOption = []
  198. this.statusOption = []
  199. sxjd.forEach(el => {
  200. this.sxjdOption.push({
  201. name: el.value,
  202. id: el.key
  203. })
  204. })
  205. xm.forEach(el => {
  206. this.xmOption.push({
  207. name: el.value,
  208. id: el.key
  209. })
  210. })
  211. lb.forEach(el => {
  212. this.lbOption.push({
  213. name: el.value,
  214. id: el.key
  215. })
  216. })
  217. status.forEach(el => {
  218. this.statusOption.push({
  219. name: el.value,
  220. id: el.key
  221. })
  222. })
  223. })
  224. },
  225. getList() {
  226. let getParams = {
  227. data: {
  228. smsxt: this.smsxt,
  229. plazaId: this.$store.state.plazaId,
  230. page: this.currentPage,
  231. diff: this.diff,
  232. size: this.size
  233. }
  234. }
  235. //下拉
  236. if (this.nd) {
  237. getParams.data.nd = this.nd
  238. }
  239. if (this.lb) {
  240. getParams.data.lb = this.lb
  241. }
  242. if (this.xm) {
  243. getParams.data.xm = this.xm
  244. }
  245. if (this.sxjd) {
  246. getParams.data.sxjd = this.sxjd
  247. }
  248. //验收
  249. if (this.yssjwcsj) {
  250. getParams.data.yssjwcsjStartDate = this.yssjwcsj[0] + '000000'
  251. getParams.data.yssjwcsjEndDate = this.yssjwcsj[1] + '000000'
  252. }
  253. if (this.lxsjwcsj) {
  254. getParams.data.lxsjwcsjStartDate = this.lxsjwcsj[0] + '000000'
  255. getParams.data.lxsjwcsjEndDate = this.reportdate[1] + '000000'
  256. }
  257. if (this.status) {
  258. getParams.data.status = this.status
  259. }
  260. //input
  261. getParams.data.keyword = ''
  262. if (this.ssfasm) {
  263. getParams.data.keyword += `${this.ssfasm}:ssfasm`
  264. }
  265. if (getParams.data.keyword == '') {
  266. delete getParams.data.keyword
  267. }
  268. queryZw(getParams).then(res => {
  269. this.tableData = res.data || []
  270. this.total = res.count
  271. })
  272. }
  273. },
  274. watch: {
  275. diff(newV, oldV) {
  276. if (newV !== oldV) {
  277. this.tabFind()
  278. this.getList()
  279. }
  280. },
  281. tabLabel(newV, oldV) {
  282. if (newV !== oldV) {
  283. this.tabFind()
  284. this.getList()
  285. }
  286. },
  287. sxjd() {
  288. this.getList()
  289. },
  290. xm() {
  291. this.getList()
  292. },
  293. lb() {
  294. this.getList()
  295. }
  296. },
  297. mounted() {
  298. this.tabFind()
  299. this.getList()
  300. }
  301. }
  302. </script>
  303. <style lang="less" scoped>
  304. .zw-list {
  305. .eq-list-top {
  306. display: flex;
  307. margin-bottom: 12px;
  308. .picker-box {
  309. display: flex;
  310. align-items: center;
  311. background: #fff;
  312. padding: 0 6px;
  313. border: 1px solid #dcdfe6;
  314. border-radius: 4px;
  315. height: 32px;
  316. box-sizing: border-box;
  317. margin-right: 12px;
  318. .picker-span {
  319. margin-right: 6px;
  320. color: rgba(0, 0, 0, 0.65);
  321. }
  322. }
  323. }
  324. td {
  325. overflow: hidden;
  326. text-overflow: ellipsis;
  327. white-space: nowrap;
  328. }
  329. .foot {
  330. height: 32px;
  331. display: flex;
  332. justify-content: flex-end;
  333. margin-top: 28px;
  334. }
  335. }
  336. </style>
  337. <style lang="less" >
  338. .zw-list {
  339. .picker-box {
  340. .el-input__inner {
  341. border: none;
  342. }
  343. .el-range-editor.el-input__inner {
  344. padding: 3px 0px;
  345. }
  346. .el-icon-date {
  347. display: none;
  348. }
  349. .el-range__close-icon {
  350. position: absolute;
  351. right: 0px;
  352. top: 2px;
  353. }
  354. .el-range-editor--mini .el-range-input {
  355. font-size: 14px;
  356. color: rgb(31, 36, 41);
  357. }
  358. }
  359. }
  360. </style>