ServiceDetails.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. <template>
  2. <div>
  3. <div class="sm-panel sm-function-module-query" v-drag>
  4. <div class="sm-panel-header">
  5. <span>服务详情</span>
  6. <i class="el-icon-close" @click="closeBox"></i>
  7. </div>
  8. <div class="ServiceCon">
  9. <div class="detailList">
  10. <el-descriptions :column="1" border>
  11. <el-descriptions-item
  12. label="服务名称"
  13. label-class-name="my-label"
  14. content-class-name="my-content"
  15. >{{ detailObj.label }}</el-descriptions-item
  16. >
  17. <el-descriptions-item
  18. label="数据说明"
  19. content-class-name="my-content"
  20. :span="3"
  21. >客观地说广东省帝黑XXXXXXXX</el-descriptions-item
  22. >
  23. <el-descriptions-item label="数据所有者"
  24. >管理员</el-descriptions-item
  25. >
  26. <el-descriptions-item label="数据年份">XXXX</el-descriptions-item>
  27. <el-descriptions-item label="服务类型">{{
  28. detailObj.type
  29. }}</el-descriptions-item>
  30. <el-descriptions-item label="服务器类型">{{
  31. detailObj.serverType
  32. }}</el-descriptions-item>
  33. <el-descriptions-item label="服务发布时间"
  34. >XXX</el-descriptions-item
  35. >
  36. <el-descriptions-item label="联系人">XXX</el-descriptions-item>
  37. </el-descriptions>
  38. </div>
  39. <div class="btnCon">
  40. <span @click="dialogVisible = true">申请调用</span>
  41. <span><i @click="applicationRecord">申请记录</i></span>
  42. </div>
  43. </div>
  44. </div>
  45. <el-dialog
  46. title="提示"
  47. :visible.sync="dialogVisible"
  48. width="30%"
  49. :before-close="handleClose"
  50. :close-on-click-modal="false"
  51. >
  52. <div>
  53. <el-form
  54. :model="ruleForm"
  55. :rules="rules"
  56. ref="ruleForm"
  57. label-width="100px"
  58. class="demo-ruleForm"
  59. >
  60. <el-form-item label-width="0px">
  61. <el-col :span="12">
  62. <el-form-item prop="sqTime" label="申请时间">
  63. <!-- <el-date-picker
  64. type="date"
  65. placeholder="选择日期"
  66. v-model="ruleForm.date1"
  67. style="width: 100%"
  68. ></el-date-picker> -->
  69. <el-input v-model="ruleForm.sqTime" disabled></el-input>
  70. </el-form-item>
  71. </el-col>
  72. <el-col :span="12">
  73. <el-form-item prop="sqDepartmentBy" label="申请部门">
  74. <el-input v-model="ruleForm.sqDepartmentBy" disabled></el-input>
  75. </el-form-item>
  76. </el-col>
  77. </el-form-item>
  78. <el-form-item label-width="0px">
  79. <el-col :span="12">
  80. <el-form-item prop="zymlBy" label="服务器类型">
  81. <el-input v-model="ruleForm.zymlBy" disabled></el-input>
  82. </el-form-item>
  83. </el-col>
  84. <el-col :span="12">
  85. <el-form-item prop="zymlTypeName" label="服务类型">
  86. <el-input v-model="ruleForm.zymlTypeName" disabled></el-input>
  87. </el-form-item>
  88. </el-col>
  89. </el-form-item>
  90. <el-form-item label="申请范围" prop="sqFw">
  91. <el-cascader
  92. :show-all-levels="false"
  93. :options="xzqTreeData"
  94. placeholder="行政区"
  95. :props="{ checkStrictly: true, expandTrigger: 'hover' }"
  96. clearable
  97. v-model="xzqTreeValue"
  98. ></el-cascader>
  99. </el-form-item>
  100. <el-form-item label="申请理由" prop="sqReason">
  101. <el-input
  102. type="textarea"
  103. v-model="ruleForm.sqReason"
  104. placeholder="请输入申请理由"
  105. ></el-input>
  106. </el-form-item>
  107. <el-form-item label="系统名称" prop="systemName">
  108. <el-input
  109. v-model="ruleForm.systemName"
  110. placeholder="请输入使用数据服务的系统名称"
  111. ></el-input>
  112. </el-form-item>
  113. <el-form-item label="调用IP" prop="callIp">
  114. <el-input
  115. v-model="ruleForm.callIp"
  116. placeholder="请输入使用数据服务的IP地址,多个用;隔开,最多支持3个"
  117. ></el-input>
  118. </el-form-item>
  119. <el-form-item label="预期截止时间" prop="sqDeadline">
  120. <el-date-picker
  121. type="date"
  122. placeholder="选择日期"
  123. v-model="ruleForm.sqDeadline"
  124. style="width: 100%"
  125. ></el-date-picker>
  126. </el-form-item>
  127. <el-form-item label="附件材料" prop="attachment">
  128. <el-upload
  129. class="upload-demo"
  130. :on-change="handleChange"
  131. :auto-upload="false"
  132. :show-file-list="false"
  133. :file-list="fileList"
  134. :limit="1"
  135. accept=".zip"
  136. >
  137. <el-button class="upload-btn" icon="Upload" size="mini"
  138. >上传</el-button
  139. >
  140. </el-upload>
  141. </el-form-item>
  142. </el-form>
  143. </div>
  144. <span slot="footer" class="dialog-footer">
  145. <el-button @click="resetForm('ruleForm')">取消</el-button>
  146. <el-button type="primary" @click="submitForm('ruleForm')"
  147. >确定</el-button
  148. >
  149. </span>
  150. </el-dialog>
  151. <el-dialog
  152. title="提示"
  153. :visible.sync="dialogVisible2"
  154. width="50%"
  155. :before-close="handleClose"
  156. >
  157. <div>
  158. <el-table :data="tableData" style="width: 100%" height="460">
  159. <el-table-column prop="sqTime" label="申请时间" show-overflow-tooltip > </el-table-column>
  160. <el-table-column prop="sqDepartmentBy" label="申请部门" show-overflow-tooltip> </el-table-column>
  161. <el-table-column prop="zymlBy" label="数据服务" > </el-table-column>
  162. <el-table-column prop="zymlTypeName" label="服务类型"> </el-table-column>
  163. <el-table-column prop="sqFw" label="申请范围" show-overflow-tooltip> </el-table-column>
  164. <el-table-column prop="sqReason" label="申请理由" show-overflow-tooltip> </el-table-column>
  165. <el-table-column prop="systemName" label="系统名称" show-overflow-tooltip> </el-table-column>
  166. <el-table-column prop="callIp" label="调用IP" show-overflow-tooltip> </el-table-column>
  167. <el-table-column prop="sqDeadline" label="预期使用时间" show-overflow-tooltip>
  168. </el-table-column>
  169. </el-table>
  170. <el-pagination
  171. @size-change="handleSizeChange"
  172. @current-change="handleCurrentChange"
  173. :current-page="page"
  174. :page-sizes="[10, 20, 30, 40]"
  175. :page-size="10"
  176. layout="total, sizes, prev, pager, next, jumper"
  177. :total="400">
  178. </el-pagination>
  179. </div>
  180. <span slot="footer" class="dialog-footer">
  181. <el-button @click="dialogVisible2 = false">取 消</el-button>
  182. <el-button type="primary" @click="dialogVisible2 = false"
  183. >确 定</el-button
  184. >
  185. </span>
  186. </el-dialog>
  187. </div>
  188. </template>
  189. <script>
  190. import { GetXzqhTree } from "@/api/map";
  191. import { ApplyResources, GetResources } from "../../../api/kfgx/gxzy";
  192. import moment from "moment";
  193. import { getInfo } from "@/api/login";
  194. import user from "../../../store/modules/user";
  195. export default {
  196. props: {
  197. detailObj: {
  198. type: Object,
  199. },
  200. },
  201. data() {
  202. return {
  203. page:1,
  204. total:0,
  205. xzqTreeValue: "",
  206. isDetailsShow: false,
  207. dialogVisible: false,
  208. dialogVisible2: false,
  209. xzqTreeData: [], //申请范围
  210. fileList: [], //文件
  211. ruleForm: {
  212. sqTime: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"), //申请时间
  213. sqDepartmentBy: "海南省国土空间治理平台", //申请部门
  214. sqReason: "", //申请理由
  215. systemName: "", //系统名称
  216. sqFw: "", //申请范围
  217. zymlId:this.detailObj.id,
  218. zymlBy: this.detailObj.serverType, //数据服务
  219. zymlTypeName: this.detailObj.type, //数据类型
  220. callIp: "", //调用ip
  221. sqDeadline: "", //预期服务截止时间
  222. attachment: "", //附件材料
  223. sqDepartmentId:''
  224. },
  225. rules: {
  226. systemName: [
  227. {
  228. required: true,
  229. message: "请输入使用数据服务的系统名称",
  230. trigger: "blur",
  231. },
  232. { min: 1, message: "长度至少为一个字符", trigger: "blur" },
  233. ], //系统名称
  234. sqReason: [
  235. { required: true, message: "请填写活动形式", trigger: "blur" },
  236. ], //申请理由
  237. sqFw: [
  238. { required: true, message: "请选择申请范围", trigger: "change" },
  239. ],
  240. callIp: [
  241. {
  242. required: true,
  243. message: "请输入使用数据服务的IP地址,多个用;隔开,最多支持3个",
  244. trigger: "blur",
  245. },
  246. ], //请输入使用数据服务的IP地址,多个用;隔开,最多支持3个
  247. },
  248. tableData: [
  249. {
  250. date: "2016-05-02",
  251. sqbm: "研发部",
  252. sjfw: "XXXXXX",
  253. fwlx: "iServer",
  254. sqfw: "吉阳区",
  255. sqly: "申请理由",
  256. xtmc: "系统名称",
  257. dyip: "调用ip",
  258. yqTime: "预期时间",
  259. },
  260. ],
  261. userMsg: null, //用户信息
  262. };
  263. },
  264. created() {
  265. this.getXzqTreeData();
  266. },
  267. mounted() {
  268. getInfo().then((res) => {
  269. this.userMsg = res.user;
  270. this.ruleForm.sqDepartmentBy = res.user.dept.deptName
  271. this.ruleForm.sqDepartmentId = res.user.deptId
  272. });
  273. },
  274. methods: {
  275. handleSizeChange(val) {
  276. console.log(`每页 ${val} 条`);
  277. },
  278. handleCurrentChange(val) {
  279. console.log(`当前页: ${val}`);
  280. },
  281. closeBox() {
  282. this.$emit("updateParent", "isShowService", false);
  283. },
  284. //申请记录
  285. applicationRecord() {
  286. GetResources().then((res) => {
  287. this.tableData = res.rows
  288. this.total = res.total
  289. console.log(res,'//////');
  290. this.dialogVisible2 = true;
  291. });
  292. },
  293. getXzqTreeData() {
  294. GetXzqhTree().then((res) => {
  295. if (res.data.length > 0) {
  296. const list = res.data[0].children.filter((item) => {
  297. return item.label == "三亚市";
  298. });
  299. if (list.length > 0) {
  300. list[0].value = "4602";
  301. this.xzqTreeData = list[0];
  302. } else this.xzqTreeData = res.data;
  303. // store.setRegionTree(this.xzqTreeData);
  304. }
  305. });
  306. },
  307. //上传文件
  308. handleChange(file, fileList) {
  309. if (fileList.length > 0) {
  310. this.fileList = [fileList[fileList.length - 1]]; //这一步,是展示最后一次选择文件
  311. // this.clearAll(false);
  312. }
  313. const formdata = new FormData();
  314. formdata.append("file", file.raw);
  315. formdata.append("fromType", 2);
  316. formdata.append("fromRoute", this.$route.path);
  317. ShapeUpload(formdata).then((res) => {
  318. if (res.success) {
  319. console.log("成功啦", res);
  320. }
  321. });
  322. },
  323. handleClose(done) {
  324. this.dialogVisible = false;
  325. this.reset()
  326. },
  327. submitForm(formName) {
  328. this.$refs[formName].validate((valid) => {
  329. if (valid) {
  330. ApplyResources(this.ruleForm).then((res) => {
  331. this.$message.success("成功!");
  332. this.dialogVisible = false;
  333. this.reset()
  334. });
  335. } else {
  336. console.log("error submit!!");
  337. return false;
  338. }
  339. });
  340. },
  341. resetForm(formName) {
  342. this.dialogVisible = false;
  343. this.$refs[formName].resetFields();
  344. this.reset()
  345. },
  346. reset(){
  347. this.ruleForm= {
  348. sqTime: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"), //申请时间
  349. sqDepartmentBy: "海南省国土空间治理平台", //申请部门
  350. sqReason: "", //申请理由
  351. systemName: "", //系统名称
  352. sqFw: "", //申请范围
  353. zymlId:this.detailObj.id,
  354. zymlBy: this.detailObj.serverType, //数据服务
  355. zymlTypeName: this.detailObj.type, //数据类型
  356. callIp: "", //调用ip
  357. sqDeadline: "", //预期服务截止时间
  358. attachment: "", //附件材料
  359. sqDepartmentId:this.userMsg.deptId
  360. }
  361. }
  362. },
  363. watch: {
  364. xzqTreeValue(val) {
  365. // console.log(val,'***************');
  366. this.ruleForm.sqFw = val[0];
  367. },
  368. },
  369. };
  370. </script>
  371. <style lang="scss" scoped>
  372. .ServiceCon {
  373. height: 760px;
  374. // background-color: aliceblue;
  375. cursor: auto;
  376. .btnCon {
  377. width: 94%;
  378. height: 100px;
  379. position: absolute;
  380. bottom: 0;
  381. display: flex;
  382. flex-direction: column;
  383. justify-content: center;
  384. align-items: center;
  385. span {
  386. width: 200px;
  387. height: 48px;
  388. color: black;
  389. display: inline-block;
  390. line-height: 48px;
  391. text-align: center;
  392. }
  393. span:first-child {
  394. background-color: #81d3f8;
  395. }
  396. span:nth-child(2) {
  397. i {
  398. font-style: normal;
  399. color: #169bd5;
  400. }
  401. }
  402. }
  403. .detailList {
  404. }
  405. }
  406. /deep/ .el-icon-close:before {
  407. position: absolute;
  408. top: 10px;
  409. right: 10px;
  410. font-size: larger;
  411. font-weight: bold;
  412. &:hover {
  413. color: aqua;
  414. }
  415. }
  416. .sm-function-module-query {
  417. max-height: 800px !important;
  418. }
  419. .sm-panel {
  420. top: 38px;
  421. }
  422. /deep/ .el-icon-close:before {
  423. right: 2px;
  424. top: 0px;
  425. }
  426. /deep/ .el-descriptions-item__label.is-bordered-label {
  427. color: #fff;
  428. background-color: transparent;
  429. }
  430. /deep/ .el-descriptions__body {
  431. color: #fff;
  432. background-color: transparent;
  433. }
  434. </style>
  435. <style>
  436. .my-content {
  437. /* background: #fde2e2; */
  438. height: 46px !important;
  439. }
  440. </style>