list.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. <template>
  2. <div class="app-container">
  3. <el-form class="secbox" :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="88px">
  4. <el-row :gutter="20">
  5. <el-col :span="8">
  6. <el-form-item label="项目编号" prop="xmbh">
  7. <el-input
  8. v-model="queryParams.xmbh"
  9. placeholder="输入项目编号"
  10. clearable
  11. @keyup.enter.native="handleQuery"
  12. />
  13. </el-form-item>
  14. </el-col>
  15. <el-col :span="8">
  16. <el-form-item label="创建日期" prop="createTime">
  17. <el-date-picker
  18. v-model="queryParams.params.begintime"
  19. type="date"
  20. value-format="yyyy-MM-dd"
  21. @keyup.enter.native="handleQuery"
  22. placeholder="年 / 月 / 日">
  23. </el-date-picker>
  24. </el-form-item>
  25. </el-col>
  26. <!-- <el-col :span="8">
  27. <el-form-item label="逾期程度" prop="createBy">
  28. <el-select v-model="value" placeholder="选择建设内容">
  29. <el-option
  30. v-for="item in options"
  31. :key="item.value"
  32. :label="item.label"
  33. :value="item.value">
  34. </el-option>
  35. </el-select>
  36. </el-form-item>
  37. </el-col> -->
  38. <el-col :span="8">
  39. <el-form-item>
  40. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  41. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  42. </el-form-item>
  43. </el-col>
  44. </el-row>
  45. </el-form>
  46. <!-- 列表 -->
  47. <!-- 标签页 -->
  48. <div class="tabs">
  49. <el-tabs v-model="activeName" @tab-click="handleClick">
  50. <el-tab-pane name="first">
  51. <div slot="label" class="tab flexc">
  52. <img class="tabimg" v-if="activeName=='first'" src="@/assets/images/project/taba_.png"/>
  53. <img class="tabimg" v-else src="@/assets/images/project/taba.png"/>
  54. <span>签约环节({{numg.qyxxNum}})
  55. </span>
  56. </div>
  57. <!-- 列表数据 -->
  58. </el-tab-pane>
  59. <el-tab-pane name="second">
  60. <div slot="label" class="tab flexc">
  61. <img class="tabimg" v-if="activeName=='second'" src="@/assets/images/project/tabb_.png"/>
  62. <img class="tabimg" v-else src="@/assets/images/project/tabb.png"/>
  63. <span>开工环节({{numg.kgxxNum}})
  64. </span>
  65. </div>
  66. </el-tab-pane>
  67. <el-tab-pane name="third">
  68. <div slot="label" class="tab flexc">
  69. <img class="tabcimg" v-if="activeName=='third'" src="@/assets/images/project/tabc_.png"/>
  70. <img class="tabcimg" v-else src="@/assets/images/project/tabc.png"/>
  71. <span>建设环节({{numg.jsxxNum}})
  72. </span>
  73. </div>
  74. </el-tab-pane>
  75. <el-tab-pane name="fourth">
  76. <div slot="label" class="tab flexc">
  77. <img class="tabdimg" v-if="activeName=='fourth'" src="@/assets/images/project/tabd_.png"/>
  78. <img class="tabdimg" v-else src="@/assets/images/project/tabd.png"/>
  79. <span>投产环节({{numg.tcxxNum}})
  80. </span>
  81. </div>
  82. </el-tab-pane>
  83. </el-tabs>
  84. <div class="btns flexcc">
  85. <!-- <div class="btna coa flexc">
  86. <img src="@/assets/images/project/yqicoa.png"/>一般逾期
  87. </div>
  88. <div class="btna cob flexc">
  89. <img src="@/assets/images/project/yqicob.png"/>严重逾期
  90. </div> -->
  91. <div style="width: 25px;"></div>
  92. <!-- <el-button type="success" class="cbbtn" size="small">一键催办</el-button> -->
  93. <el-button type="primary" plain size="small" @click="hadeadd">创建</el-button>
  94. <el-button type="success" class="cbbtn" size="small" @click="handleExport">导出</el-button>
  95. </div>
  96. <div class="blist" >
  97. <boxlist v-if="isgse" type="xmgl" :datalist="liesse"></boxlist>
  98. </div>
  99. <Pagination
  100. v-show="total>0"
  101. :total="total"
  102. background
  103. :page.sync="queryParams.pageNum"
  104. :limit.sync="queryParams.pageSize"
  105. @pagination="getList"
  106. />
  107. </div>
  108. </div>
  109. </template>
  110. <script>
  111. // import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice"
  112. import { listQyxx, getQyxx, delQyxx, addQyxx, updateQyxx,tap } from "@/api/zhaoshang/qyxx"
  113. import firstInfoForm from "./firstInfoForm"
  114. import boxlist from "./boxlist.vue"
  115. export default {
  116. name: "Notice",
  117. dicts: ['sys_notice_status', 'sys_notice_type'],
  118. components:{
  119. boxlist
  120. },
  121. data() {
  122. return {
  123. // 遮罩层
  124. loading: true,
  125. // 选中数组
  126. ids: [],
  127. // 非单个禁用
  128. single: true,
  129. // 非多个禁用
  130. multiple: true,
  131. // 显示搜索条件
  132. showSearch: true,
  133. ishsouetan:false,
  134. // 总条数
  135. total: 0,
  136. liesse:{},
  137. // 公告表格数据
  138. noticeList: [],
  139. // 弹出层标题
  140. title: "",
  141. // 是否显示弹出层
  142. open: false,
  143. // 查询参数
  144. queryParams: {
  145. pageNum: 1,
  146. pageSize: 10,
  147. xmId: null,
  148. xmbh: null,
  149. xmmc: null,
  150. progress:1,
  151. createTime:null,
  152. params:{}
  153. },
  154. // 表单参数
  155. form: {},
  156. // 表单校验
  157. rules: {
  158. noticeTitle: [
  159. { required: true, message: "公告标题不能为空", trigger: "blur" }
  160. ],
  161. noticeType: [
  162. { required: true, message: "公告类型不能为空", trigger: "change" }
  163. ]
  164. },
  165. tableMaxHeight:380,
  166. num:5,
  167. value:'',
  168. options: [{
  169. value: '选项1',
  170. label: '黄金糕'
  171. }, {
  172. value: '选项2',
  173. label: '双皮奶'
  174. }],
  175. activeName:'first',
  176. info:{},
  177. isgse:false,
  178. numg:{}
  179. }
  180. },
  181. created() {
  182. if(this.$route.query.id != undefined){
  183. this.queryParams.tzfkId = this.$route.query.id
  184. }else{
  185. this.queryParams.tzfkId = undefined
  186. }
  187. this.getList()
  188. },
  189. computed: {
  190. dynamicStyle() {
  191. return {
  192. overflow:'auto',
  193. height: this.tableMaxHeight + 'px',
  194. }
  195. }
  196. },
  197. methods: {
  198. /** 查询公告列表 */
  199. getList() {
  200. this.loading = true
  201. this.isgse = false
  202. listQyxx(this.queryParams).then(response => {
  203. this.noticeList = response.rows
  204. this.liesse.noticeList = response.rows
  205. this.total = response.total
  206. this.isgse = true
  207. this.loading = false
  208. this.getListnum()
  209. })
  210. },
  211. getListnum() {
  212. tap().then(response => {
  213. this.numg = response.data
  214. })
  215. },
  216. handleClick(){
  217. if(this.activeName == 'first'){
  218. this.queryParams.progress = 1
  219. this.getList()
  220. }else if(this.activeName == 'second'){
  221. this.queryParams.progress = 2
  222. this.getList()
  223. }else if(this.activeName == 'third'){
  224. this.queryParams.progress = 3
  225. this.getList()
  226. }else if(this.activeName == 'fourth'){
  227. this.queryParams.progress = 4
  228. this.getList()
  229. }
  230. },
  231. // 取消按钮
  232. cancel() {
  233. this.open = false
  234. this.reset()
  235. },
  236. // 表单重置
  237. reset() {
  238. this.form = {
  239. jsxxId: null,
  240. xmId: null,
  241. xmbh: null,
  242. xmmc: null,
  243. beginTime: null,
  244. endTime: null,
  245. jgTime: null,
  246. rtTime: null,
  247. createBy: null,
  248. createTime: null,
  249. updateBy: null,
  250. updateTime: null,
  251. remark: null
  252. }
  253. this.resetForm("form")
  254. },
  255. /** 搜索按钮操作 */
  256. handleQuery() {
  257. this.queryParams.pageNum = 1
  258. this.getList()
  259. },
  260. /** 重置按钮操作 */
  261. resetQuery() {
  262. this.resetForm("queryForm")
  263. this.queryParams.tzfkId = undefined
  264. this.handleQuery()
  265. },
  266. // 多选框选中数据
  267. handleSelectionChange(selection) {
  268. this.ids = selection.map(item => item.qyxxId)
  269. this.single = selection.length!=1
  270. this.multiple = !selection.length
  271. },
  272. hadeadd(){
  273. this.$router.push({
  274. path: '/zhaoshang/add',
  275. query: {
  276. 'id':-1,
  277. }
  278. })
  279. },
  280. /** 新增按钮操作 */
  281. handleAdd() {
  282. this.reset()
  283. this.open = true
  284. this.title = "添加公告"
  285. },
  286. /** 修改按钮操作 */
  287. handleUpdate(row) {
  288. this.reset()
  289. const qyxxId = row.qyxxId || this.ids
  290. getNotice(qyxxId).then(response => {
  291. this.form = response.data
  292. this.open = true
  293. this.title = "修改公告"
  294. })
  295. },
  296. /** 提交按钮 */
  297. submitForm: function() {
  298. this.$refs["form"].validate(valid => {
  299. if (valid) {
  300. if (this.form.qyxxId != undefined) {
  301. updateQyxx(this.form).then(response => {
  302. this.$modal.msgSuccess("修改成功")
  303. this.open = false
  304. this.getList()
  305. })
  306. } else {
  307. addQyxx(this.form).then(response => {
  308. this.$modal.msgSuccess("新增成功")
  309. this.open = false
  310. this.getList()
  311. })
  312. }
  313. }
  314. })
  315. },
  316. /** 删除按钮操作 */
  317. handleDelete(row) {
  318. const qyxxIds = row.qyxxId || this.ids
  319. delQyxx(qyxxIds).then(response => {
  320. this.$modal.msgSuccess("删除成功")
  321. this.getList()
  322. })
  323. },
  324. handleExport() {
  325. this.download('zhaoshangV3/qyxx/export', {
  326. ...this.queryParams
  327. }, `qyxx_${new Date().getTime()}.xlsx`)
  328. }
  329. }
  330. }
  331. </script>
  332. <style scoped lang="scss">
  333. ::v-deep{
  334. .secbox{
  335. .el-button{padding: 9px 15px;}
  336. .el-form-item__label{line-height: 40px;}
  337. // .el-input__inner{height: 40px;line-height: 40px;}
  338. // .el-form-item{min-width: 25%;}
  339. }
  340. .tabs{
  341. .el-tabs__item{padding-right: 0;color: #666666;line-height: 45px;height: 45px;padding-left: 0;}
  342. .is-active{color: #2777D0;font-weight: bold;}
  343. }
  344. .pagination-container{margin-top: 8px;}
  345. }
  346. .secbox{background: #FFFFFF;
  347. border-radius: 4px;padding: 25px 16px 7px;margin-bottom: 15px;}
  348. .tabs{position: relative;background: #FFFFFF;padding-bottom: 25px;
  349. .tab{padding: 0 21px;}
  350. .tabimg{width: 14px;height: 14px;margin-right: 8px;}
  351. .tabcimg{width: 13px;height: 13px;margin-right: 9px;}
  352. .tabdimg{width: 14px;height: 15px;margin-right: 8px;}
  353. .btns{height: 45px;box-sizing: border-box;position: absolute;right: 0;top: 0;
  354. .btna{margin-left: 28px;font-weight: bold;
  355. font-size: 14px;
  356. &.coa{color: #FE960E;}
  357. &.cob{color: #FF6969;}
  358. img{width: 12px;height: 14px;margin-right: 7px;}
  359. }
  360. }
  361. .cbbtn{padding: 0 12px;height: 32px;line-height: 32px;border-radius: 4px;font-weight: bold;
  362. font-size: 14px;
  363. color: #FFFFFF;}
  364. .blist{padding: 10px 16px 0;}
  365. }
  366. </style>