zwTable.vue 13 KB

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