zwTable.vue 13 KB

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