zwTable.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  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='pageChanged(1)'
  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='pageChanged(1)'></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='pageChanged(1)'
  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='pageChanged(1)'
  33. @blur='pageChanged(1)'
  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='pageChanged(1)'
  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='pageChanged(1)'
  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}'>{{row.zfje || '--'}}</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. :current-page='currentPage'
  113. @prev-click='pageChanged'
  114. @next-click='pageChanged'
  115. @current-change='pageChanged'
  116. ></el-pagination>
  117. </div>
  118. </div>
  119. </template>
  120. <script>
  121. import moment from 'moment'
  122. import Select from '@/components/Select/Select.vue'
  123. import { queryZw } from '@/api/equipmentList.js'
  124. import { querySelect } from '@/api/public.js'
  125. import { mapGetters } from 'vuex'
  126. import inputDialog from './inputDIalog'
  127. import { formatter, number_format } from '@/utils/format.js'
  128. export default {
  129. components: { Select, inputDialog },
  130. data() {
  131. return {
  132. tableData: [],
  133. total: 0,
  134. currentPage: 1,
  135. yssjwcsj: '',
  136. lxsjwcsj: '',
  137. ssfasm: '',
  138. size: 10,
  139. keyword: '',
  140. nd: '',
  141. lb: '1',
  142. sxjd: '1',
  143. formatter,
  144. number_format,
  145. xm: '1',
  146. status: '1',
  147. statusOption: [],
  148. sxjdOption: [],
  149. xmOption: [],
  150. lbOption: [],
  151. }
  152. },
  153. computed: {
  154. ...mapGetters(['floorSelect']),
  155. },
  156. props: ['smsxt', 'major', 'diff', 'tabLabel'],
  157. methods: {
  158. //序号的方法
  159. indexMethod(index) {
  160. return (this.currentPage - 1) * this.size + index + 1
  161. },
  162. //多余输入框监听
  163. confirm(status, yssjwcsj) {
  164. console.log(status)
  165. this.yssjwcsj = yssjwcsj
  166. this.status = status
  167. console.log(this.status)
  168. this.pageChanged(1)
  169. },
  170. pageChanged(page) {
  171. this.currentPage = page
  172. this.getList()
  173. },
  174. innerTable(row) {
  175. if (row.gczxwx_lineid) {
  176. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=GCZXWXLINE&uniqueid=${row.gczxwx_lineid}`)
  177. }
  178. },
  179. //下拉框查询
  180. tabFind() {
  181. let postParams = [
  182. {
  183. columnName: { lb: 'lb', xm: 'xm', sxjd: 'sxjd', status: 'status' },
  184. params: {
  185. smsxt: this.smsxt,
  186. },
  187. tableName: 'sms_zw', //视图名称
  188. },
  189. ]
  190. let major
  191. if (this.major.slice(0, 2) == 'GD') {
  192. major = '供电'
  193. } else if (this.major.slice(0, 2) == 'XF') {
  194. major = '消防'
  195. } else if (this.major.slice(0, 2) == 'GPS') {
  196. major = '给排水'
  197. } else if (this.major.slice(0, 2) == 'DT') {
  198. major = '电梯'
  199. } else if (this.major.slice(0, 2) == 'RQ') {
  200. major = '燃气'
  201. } else if (this.major.slice(0, 2) == 'RD') {
  202. major = '弱电'
  203. } else if (this.major.slice(0, 2) == 'NT') {
  204. major = '暖通'
  205. } else if (this.major.slice(0, 2) == 'TJ') {
  206. major = '土建'
  207. } else {
  208. major = this.major
  209. }
  210. let data = {
  211. major: major,
  212. plazaId: this.$store.state.plazaId,
  213. }
  214. if (this.major != '土建') {
  215. data.onlyMainAsset = true
  216. }
  217. querySelect({ data, postParams }).then((res) => {
  218. //console.log(res)
  219. let lb = res.data.data.sms_zw.lb
  220. let xm = res.data.data.sms_zw.xm
  221. let sxjd = res.data.data.sms_zw.sxjd
  222. let status = res.data.data.sms_zw.status
  223. this.lbOption = []
  224. this.lbOption.push({
  225. name: '全部',
  226. id: '1',
  227. })
  228. this.xmOption = []
  229. this.xmOption.push({
  230. id: '1',
  231. name: '全部',
  232. })
  233. this.sxjdOption = []
  234. this.sxjdOption.push({
  235. id: '1',
  236. name: '全部',
  237. })
  238. this.statusOption = []
  239. this.statusOption.push({
  240. id: '1',
  241. name: '全部',
  242. })
  243. sxjd.forEach((el) => {
  244. this.sxjdOption.push({
  245. name: el.value,
  246. id: el.key,
  247. })
  248. })
  249. xm.forEach((el) => {
  250. this.xmOption.push({
  251. name: el.value,
  252. id: el.key,
  253. })
  254. })
  255. lb.forEach((el) => {
  256. this.lbOption.push({
  257. name: el.value,
  258. id: el.key,
  259. })
  260. })
  261. status.forEach((el) => {
  262. this.statusOption.push({
  263. name: el.value,
  264. id: el.key,
  265. })
  266. })
  267. })
  268. },
  269. getList() {
  270. let getParams = {
  271. data: {
  272. smsxt: this.smsxt,
  273. plazaId: this.$store.state.plazaId,
  274. page: this.currentPage,
  275. diff: this.diff,
  276. size: this.size,
  277. },
  278. }
  279. //下拉
  280. if (this.nd) {
  281. getParams.data.nd = this.nd
  282. }
  283. if (this.lb && this.lb != 1) {
  284. getParams.data.lb = this.lb
  285. }
  286. if (this.xm && this.xm != 1) {
  287. getParams.data.xm = this.xm
  288. }
  289. if (this.sxjd && this.sxjd != 1) {
  290. getParams.data.sxjd = this.sxjd
  291. }
  292. //验收
  293. if (this.yssjwcsj) {
  294. getParams.data.yssjwcsjStartDate = this.yssjwcsj[0] + '000000'
  295. // getParams.data.yssjwcsjEndDate = this.yssjwcsj[1] + '000000'
  296. getParams.data.yssjwcsjEndDate = moment(this.yssjwcsj[1]).format('YYYYMMDD235959')
  297. }
  298. // 立项日期
  299. if (this.lxsjwcsj) {
  300. getParams.data.lxsjwcsjStartDate = this.lxsjwcsj[0] + '000000'
  301. // getParams.data.lxsjwcsjEndDate = this.lxsjwcsj[1] + '000000'
  302. getParams.data.lxsjwcsjEndDate = moment(this.lxsjwcsj[1]).format('YYYYMMDD235959')
  303. }
  304. if (this.status && this.status != 1) {
  305. getParams.data.status = this.status
  306. }
  307. //input
  308. getParams.data.keyword = ''
  309. if (this.ssfasm) {
  310. getParams.data.keyword += `${this.ssfasm}:ssfasm`
  311. }
  312. if (getParams.data.keyword == '') {
  313. delete getParams.data.keyword
  314. }
  315. queryZw(getParams).then((res) => {
  316. this.tableData = res.data || []
  317. this.total = res.count
  318. })
  319. },
  320. },
  321. watch: {
  322. diff(newV, oldV) {
  323. if (newV !== oldV) {
  324. this.tabFind()
  325. this.getList()
  326. }
  327. },
  328. tabLabel(newV, oldV) {
  329. if (newV !== oldV) {
  330. this.tabFind()
  331. this.getList()
  332. }
  333. },
  334. smsxt: {
  335. handler(newV, oldV) {
  336. if (newV != oldV) {
  337. this.getList()
  338. }
  339. },
  340. deep: true,
  341. },
  342. sxjd() {
  343. this.getList()
  344. },
  345. xm() {
  346. this.getList()
  347. },
  348. lb() {
  349. this.getList()
  350. },
  351. },
  352. mounted() {
  353. this.tabFind()
  354. this.getList()
  355. },
  356. }
  357. </script>
  358. <style lang="less" scoped>
  359. .zw-list {
  360. .eq-list-top {
  361. display: flex;
  362. margin-bottom: 12px;
  363. .picker-box {
  364. display: flex;
  365. align-items: center;
  366. background: #fff;
  367. padding: 0 6px;
  368. border: 1px solid #dcdfe6;
  369. border-radius: 4px;
  370. height: 32px;
  371. box-sizing: border-box;
  372. margin-right: 12px;
  373. .picker-span {
  374. margin-right: 6px;
  375. color: rgba(0, 0, 0, 0.65);
  376. }
  377. }
  378. }
  379. td {
  380. overflow: hidden;
  381. text-overflow: ellipsis;
  382. white-space: nowrap;
  383. }
  384. .foot {
  385. height: 32px;
  386. display: flex;
  387. justify-content: flex-end;
  388. margin-top: 28px;
  389. }
  390. }
  391. </style>
  392. <style lang="less" >
  393. .zw-list {
  394. .picker-box {
  395. .el-input__inner {
  396. border: none;
  397. }
  398. .el-range-editor.el-input__inner {
  399. padding: 3px 0px;
  400. }
  401. .el-icon-date {
  402. display: none;
  403. }
  404. .el-range__close-icon {
  405. position: absolute;
  406. right: 0px;
  407. top: 2px;
  408. }
  409. .el-range-editor--mini .el-range-input {
  410. font-size: 14px;
  411. color: rgb(31, 36, 41);
  412. }
  413. }
  414. /deep/.el-table td {
  415. cursor: pointer;
  416. }
  417. }
  418. </style>