zwTable.vue 14 KB

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