Ssnyd.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. <template>
  2. <div class="page-nzy-manage">
  3. <div class="page-left" :style="{height:contentHeight+'px',width:contentWidth+'px'}">
  4. <div class="nzy-tools">
  5. <el-form label-width="120px" :model="searchParam">
  6. <el-row :gutter="20">
  7. <el-col :span="6">
  8. <el-form-item label="项目索引:">
  9. <el-input v-model="searchParam.xmbh" placeholder="请输入项目索引" clearable></el-input>
  10. </el-form-item>
  11. </el-col>
  12. <el-col :span="6">
  13. <el-form-item label="项目名称:">
  14. <el-input v-model="searchParam.xmmc" placeholder="请输入项目名称" clearable></el-input>
  15. </el-form-item>
  16. </el-col>
  17. <el-col :span="6">
  18. <el-form-item label="市:">
  19. <el-input v-model="searchParam.szs" placeholder="请输入市" clearable></el-input>
  20. </el-form-item>
  21. </el-col>
  22. <el-col :span="6">
  23. <el-form-item label="县区:">
  24. <el-input v-model="searchParam.xzq" placeholder="请输入县区" clearable></el-input>
  25. </el-form-item>
  26. </el-col>
  27. </el-row>
  28. <el-row :gutter="20">
  29. <el-col :span="6">
  30. <el-form-item label="备案号:">
  31. <el-input v-model="searchParam.bah" placeholder="请输入备案号" clearable></el-input>
  32. </el-form-item>
  33. </el-col>
  34. <el-col :span="6">
  35. <el-form-item label="备案面积:">
  36. <el-input v-model="searchParam.bamj" placeholder="请输入备案面积" clearable></el-input>
  37. </el-form-item>
  38. </el-col>
  39. <el-col :span="6">
  40. <el-form-item label="备案时间:">
  41. <el-date-picker
  42. v-model="basjDateRange"
  43. type="daterange"
  44. value-format="yyyy-MM-dd"
  45. unlink-panels
  46. start-placeholder="备案开始时间"
  47. end-placeholder="备案结束时间"
  48. :shortcuts="shortcuts"
  49. style="width:100%"
  50. />
  51. </el-form-item>
  52. </el-col>
  53. <el-col :span="6">
  54. <div class="btn-group">
  55. <el-button type="primary" @click="onSearchHandle">查询</el-button>
  56. <el-button type="info" style="margin-left: 8px;" @click="onResetHandle">清空</el-button>
  57. <el-upload
  58. class="upload-demo"
  59. action=""
  60. :before-upload="beforeUpload"
  61. multiple
  62. :limit="3"
  63. :on-exceed="2"
  64. accept=".zip"
  65. style="display:inline-block; margin-left: 10px;"
  66. >
  67. <el-button type="success">
  68. 导入文件
  69. </el-button>
  70. </el-upload>
  71. <el-button type="warning" @click="downloadTemplate" style="margin-left: 12px">模板下载</el-button>
  72. </div>
  73. </el-col>
  74. </el-row>
  75. </el-form>
  76. </div>
  77. <div class="nzy-table">
  78. <el-table
  79. border
  80. :data="tableData.data"
  81. :height="contentHeight-260"
  82. :header-cell-style="tableHeaderStyle"
  83. :cell-style="tableRowStyle"
  84. ref="report-table"
  85. >
  86. <el-table-column
  87. type="index"
  88. width="80"
  89. label="序号">
  90. </el-table-column>
  91. <el-table-column
  92. prop="xmbh"
  93. label="项目索引">
  94. </el-table-column>
  95. <el-table-column
  96. prop="xmmc"
  97. label="项目名称">
  98. </el-table-column>
  99. <el-table-column
  100. prop="szs"
  101. label="市">
  102. </el-table-column>
  103. <el-table-column
  104. prop="xzq"
  105. label="县区">
  106. </el-table-column>
  107. <el-table-column
  108. prop="yt"
  109. label="用途">
  110. </el-table-column>
  111. <el-table-column
  112. prop="bah"
  113. label="备案号">
  114. </el-table-column>
  115. <el-table-column
  116. prop="bamj"
  117. label="备案面积">
  118. </el-table-column>
  119. <el-table-column
  120. prop="basj"
  121. label="备案时间">
  122. </el-table-column>
  123. <el-table-column
  124. prop="bz"
  125. label="备注">
  126. </el-table-column>
  127. <el-table-column
  128. width="260"
  129. label="操作">
  130. <template slot-scope="scope">
  131. <div style="line-height: 34px;">
  132. <el-button
  133. @click.native.prevent="openDetail(scope.row)"
  134. plain
  135. type="primary"
  136. size="mini">
  137. 查看
  138. </el-button>
  139. <el-button
  140. @click.native.prevent="openDetail(scope.row, true)"
  141. style="margin: 0px 10px;"
  142. plain
  143. type="primary"
  144. size="mini">
  145. 编辑
  146. </el-button>
  147. <el-popconfirm
  148. title="该条数据确定删除吗?"
  149. @confirm="deleteHandle(scope.$index, scope.row)"
  150. >
  151. <el-button
  152. plain
  153. type="danger"
  154. slot="reference"
  155. size="mini">
  156. 删除
  157. </el-button>
  158. </el-popconfirm>
  159. </div>
  160. </template>
  161. </el-table-column>
  162. </el-table>
  163. <Page style="float: right;margin-top: 10px;"
  164. show-total
  165. :total="tableData.total"
  166. :page-size="searchParam.size"
  167. @on-change="pageChange"
  168. @on-page-size-change="sizeChange"
  169. show-sizer />
  170. </div>
  171. </div>
  172. <el-dialog
  173. :visible.sync="detailShow"
  174. title="项目详情"
  175. top="5vh"
  176. width="80%"
  177. >
  178. <detail ref="details" @init="onSearchHandle" :contentWidth="contentWidth-menusWidth" :contentHeight="contentHeight" :project="currProject"/>
  179. </el-dialog>
  180. </div>
  181. </template>
  182. <script>
  183. import Detail from "./ssnyd/Detail";
  184. export default {
  185. name: "Nzy",
  186. props:{
  187. contentWidth:Number,
  188. contentHeight:Number
  189. },
  190. components:{Detail},
  191. data() {
  192. return {
  193. compName: 'data-manage',
  194. menus:JSON.parse(window.sessionStorage.getItem('yzt-user')),
  195. menusWidth:700,
  196. detailShow:false,
  197. tableData:{
  198. data:[],
  199. total: 0
  200. },
  201. currProject:null,
  202. basjDateRange: [],
  203. searchParam: {
  204. xmbh: '',
  205. ban: '',
  206. yt: '',
  207. xzq: '',
  208. basjStart: '',
  209. basjEnd: '',
  210. current: 1,
  211. size: 10
  212. }
  213. }
  214. },
  215. mounted(){
  216. this.queryByPage();
  217. },
  218. methods: {
  219. onSearchHandle () {
  220. this.detailShow = false
  221. this.searchParam['current'] = 1
  222. this.queryByPage()
  223. },
  224. pageChange:function (page){
  225. this.searchParam.current=page;
  226. this.queryByPage()
  227. },
  228. sizeChange:function (size){
  229. this.searchParam.size=size;
  230. this.queryByPage()
  231. },
  232. //查询报批项目信息
  233. queryByPage(){
  234. let _this = this;
  235. if (this.basjDateRange && this.basjDateRange.length > 0) {
  236. this.searchParam.basjStart = this.basjDateRange[0]
  237. this.searchParam.basjEnd = this.basjDateRange[1]
  238. }else{
  239. this.searchParam.basjStart = ''
  240. this.searchParam.basjEnd = ''
  241. }
  242. const params = {
  243. ...this.searchParam
  244. }
  245. this.$ajax.get('/api/ssnyd/page', params, this, true).then(res => {
  246. if (res.status === 200) {
  247. _this.tableData.data= res.records;
  248. _this.tableData.total = res.total;
  249. }
  250. })
  251. },
  252. openDetail(row, isEditor = false){
  253. this.detailShow = true;
  254. this.$nextTick(() => {
  255. this.$refs['details'].initDetailData(row, isEditor)
  256. })
  257. },
  258. deleteHandle (index, row) {
  259. const params = {id: row['objectid']}
  260. this.$ajax.get('/api/ssnyd/delete', params, this, true).then(res => {
  261. if (res.data) {
  262. this.$Message.success('删除成功!')
  263. this.queryByPage()
  264. }
  265. })
  266. },
  267. locationDk(index,row){
  268. if(row.dk_bh){
  269. this.detailShow = false;
  270. let dkbhArr = row.dk_bh?row.dk_bh.split(","):'';
  271. let arr = dkbhArr.map(i=>{return "'"+i+"'";});
  272. this.$vm.$emit('locationGlobal', 'YHYZT_NZYDK_NEW', `index_id in (${arr.join()})`)
  273. //this.$message.warning("暂无图形")
  274. }
  275. },
  276. tableRowStyle({row, rowIndex}) {
  277. if (rowIndex%2 === 1) {
  278. return 'text-align:center;background:#F7F8FA';
  279. }else{
  280. return 'text-align:center;';
  281. }
  282. },
  283. tableHeaderStyle(){
  284. return 'background:#E5EDFE; font-family:AlibabaPuHuiTiR; font-size:16px; color:rgba(51, 51, 51, 1);text-align:center;';
  285. },
  286. beforeUpload(file){
  287. if(file){
  288. if(file.name.endsWith("zip")){
  289. this.doInput(file)
  290. }
  291. return false;
  292. }
  293. },
  294. doInput(file){
  295. let params = new FormData();
  296. params.append("file", file);
  297. const loading = this.$loading({
  298. lock: true,
  299. text: '正在导入中',
  300. spinner: 'el-icon-loading',
  301. background: 'rgba(0, 0, 0, 0.7)'
  302. });
  303. this.$ajax.post('/api/ssnyd/upload', params, this).then(res => {
  304. loading.close();
  305. if (res.success) {
  306. this.$Message.success("导入成功!");
  307. this.queryByPage && this.queryByPage(); // 成功后刷新数据
  308. } else {
  309. if (res.data && Array.isArray(res.data)) {
  310. res.data.forEach(msg => this.$Message.error(msg));
  311. } else {
  312. this.$Message.error(res.message || "导入失败!");
  313. }
  314. }
  315. }).catch(error => {
  316. loading.close();
  317. this.$Message.error("上传失败,请重试!");
  318. console.error(error);
  319. });
  320. },
  321. downloadTemplate() {
  322. // 模板下载地址
  323. window.open(window.ApplicationConfig.templateUrls.ssnyd);
  324. },
  325. onResetHandle() {
  326. this.searchParam = {
  327. xmbh: '',
  328. ban: '',
  329. yt: '',
  330. xzq: '',
  331. basjStart: '',
  332. basjEnd: '',
  333. current: 1,
  334. size: 10
  335. };
  336. this.basjDateRange = [];
  337. this.queryByPage();
  338. }
  339. }
  340. }
  341. </script>
  342. <style scoped lang="scss">
  343. .page-nzy-manage{
  344. position: relative;
  345. display: flex;
  346. .page-left{
  347. background: #fff;
  348. border-radius: 0px 0px 0px 0px;
  349. z-index: 99;
  350. padding: 20px;
  351. border-right:2px solid #e9e3e3;
  352. .nzy-tools{
  353. .btn-group {
  354. display: flex;
  355. }
  356. .panel-dropdown{
  357. margin-left: 10px;
  358. border-radius: 4px 4px 4px 4px;
  359. .el-dropdown{
  360. width: 100%;
  361. }
  362. }
  363. }
  364. }
  365. .page-detail{
  366. background: #FFFFFF;
  367. border-radius: 0px 0px 0px 0px;
  368. position: absolute;
  369. z-index: 999;
  370. right: 0px;
  371. }
  372. .page-map{
  373. //position: absolute;
  374. //background:#434;
  375. }
  376. }
  377. </style>