formTables.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  1. <template>
  2. <div>
  3. <div>
  4. <div class="flex-title">OP_CODE申请流程</div>
  5. <el-form ref="form" :model="form" :rules="rule" :disabled="disabled">
  6. <el-row>
  7. <el-col :span="6">
  8. <el-form-item label="工单编号:" prop="orderNumber">
  9. <el-input v-model="form.orderNumber" disabled></el-input>
  10. </el-form-item>
  11. </el-col>
  12. <el-col :span="6">
  13. <el-form-item label="工单标题:" prop="needName">
  14. <el-input v-model="form.needName"></el-input>
  15. </el-form-item>
  16. </el-col>
  17. <el-col :span="6">
  18. <el-form-item label="申请人:" prop="applicant">
  19. <el-input v-model="form.applicant" :disabled="true"></el-input>
  20. </el-form-item>
  21. </el-col>
  22. <el-col :span="6">
  23. <el-form-item label="申请时间:">
  24. <el-date-picker type="date" :disabled="true" placeholder="选择日期" v-model="form.applicationTime"
  25. :picker-options="pickerOptions" value-format="yyyy-MM-dd"
  26. style="width: 100%"></el-date-picker>
  27. </el-form-item>
  28. </el-col>
  29. </el-row>
  30. <el-row>
  31. <el-col :span="6">
  32. <el-form-item label="需求编号:" prop="demandNumber">
  33. <el-input v-model="form.demandNumber"></el-input>
  34. </el-form-item>
  35. </el-col>
  36. <el-col :span="6">
  37. <el-form-item label="需求名称:">
  38. <el-input v-model="form.demandName"></el-input>
  39. </el-form-item>
  40. </el-col>
  41. <el-col :span="6">
  42. <el-form-item label="需求上线时间:">
  43. <el-date-picker type="date" placeholder="选择日期" v-model="form.demandDeployTime"
  44. :picker-options="pickerOptions" value-format="yyyy-MM-dd"
  45. style="width: 100%"></el-date-picker>
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="6">
  49. <el-form-item label="提出地市:" prop="submitCity">
  50. <el-select v-model="form.submitCity" placeholder="请选择">
  51. <el-option v-for="(item, index) in cityList" :label="item.ou" :value="item.ou"></el-option>
  52. <!-- <el-option label="路由器" value="路由器"></el-option>
  53. <el-option label="交换机" value="交换机"></el-option>
  54. <el-option label="防火墙" value="防火墙"></el-option>
  55. <el-option label="主机" value="主机"></el-option> -->
  56. </el-select>
  57. </el-form-item>
  58. </el-col>
  59. <el-col :span="6">
  60. <el-form-item label="提出人:" prop="submitter">
  61. <el-input v-model="form.submitter"></el-input>
  62. </el-form-item>
  63. </el-col>
  64. </el-row>
  65. <el-row>
  66. <el-col :span="24">
  67. <el-form-item label="备注:" prop="remark" label-width="110px">
  68. <el-input type="textarea" maxlength="300" show-word-limit v-model="form.remark"></el-input>
  69. </el-form-item>
  70. </el-col>
  71. </el-row>
  72. <el-row>
  73. <el-col :span="2">
  74. <span>操作信息:</span>
  75. </el-col>
  76. <el-col :span="22">
  77. <div class="flex-table-header">
  78. <el-button type="primary" @click="newclick(1)">新建</el-button>
  79. <el-button type="danger" @click="fireDel()">删除</el-button>
  80. <span>记录总数({{ num }})</span>
  81. </div>
  82. <Table @clickDemand="clickDemand" :list="lable" ref="TableList" @changeNum="changeNum"
  83. @num="selectNum">
  84. </Table>
  85. </el-col>
  86. </el-row>
  87. <el-row>
  88. <el-form-item label="附件:" prop="mkFileShareAttachList" label-width="120px">
  89. <my-upload ref="upload" @uploadBack="uploadBack" @delloadBack="delloadBack"
  90. @clickDownload="download" :fileInfo="fileInfo"
  91. :fileList="list.mkFileShareAttachList"></my-upload>
  92. </el-form-item>
  93. </el-row>
  94. </el-form>
  95. </div>
  96. <el-dialog v-if="firewallStatus" :before-close="clickClose(1)" :title="OPTit" :visible.sync="firewallStatus"
  97. width="100%" :modal="false" style="display: flex; flex-direction: column">
  98. <el-button type="primary" @click="newFireAdd(OPTit)">保存</el-button>
  99. <el-form ref="form1" :model="fireList">
  100. <el-row>
  101. <el-col :span="12">
  102. <el-form-item label="操作代码:" prop="code">
  103. <el-input v-model="fireList.code"></el-input>
  104. </el-form-item>
  105. </el-col>
  106. <el-col :span="12">
  107. <el-form-item label="操作代码名称:" prop="name">
  108. <el-input v-model="fireList.name"></el-input>
  109. </el-form-item>
  110. </el-col>
  111. <el-col :span="12">
  112. <el-form-item label="配置地市,部门:" prop="cityDept">
  113. <el-input v-model="fireList.cityDept"></el-input>
  114. </el-form-item>
  115. </el-col>
  116. </el-row>
  117. </el-form>
  118. </el-dialog>
  119. </div>
  120. </template>
  121. <script>
  122. import myUpload from "../../../components/workflowUpload";
  123. import Table from "../../../components/el-form.vue";
  124. export default {
  125. components: {
  126. myUpload,
  127. Table
  128. },
  129. data() {
  130. return {
  131. cityList: [],
  132. fireList: {},
  133. portList: {},
  134. fireSelectList: [],
  135. portSelectList: [],
  136. firewallStatus: false,
  137. page: 1,
  138. pages: 1,
  139. protStatus: false,
  140. OPTit: '新建',
  141. num: '0',
  142. nums: '0',
  143. costPayWayInputRule: {
  144. costPayWayInput: [
  145. { required: true, message: "请填写", trigger: "blur" },
  146. ],
  147. },
  148. gratuityInputRule: {
  149. gratuityInput: [
  150. { required: true, message: "请填写", trigger: "blur" },
  151. ],
  152. },
  153. reportFormInputRule: {
  154. reportFormInput: [
  155. { required: true, message: "请填写", trigger: "blur" },
  156. ],
  157. },
  158. checkBoxNone: false,
  159. checkBoxStatus: false,
  160. fileInfo: {
  161. type: "bt1n",
  162. typename: "上传文件",
  163. limit: 5,
  164. url: "/market/waf/upload",
  165. fileList: [],
  166. },
  167. postEdit: false,
  168. newPostAge: false,
  169. pickerOptions: {
  170. disabledDate(time) {
  171. return time.getTime() < Date.now() - 8.64e7;
  172. },
  173. },
  174. oneList: [],
  175. lable: {
  176. name: "first",
  177. height: '200',
  178. titledata: [
  179. {
  180. label: "序号",
  181. prop: "index",
  182. width: 300,
  183. },
  184. {
  185. label: "操作代码",
  186. prop: "code",
  187. width: 300,
  188. color: "#0682CD",
  189. },
  190. {
  191. label: "操作代码名称",
  192. prop: "name",
  193. width: 200,
  194. },
  195. {
  196. label: "配置地市部门",
  197. prop: "cityDept",
  198. width: 200,
  199. },
  200. ], //表格头
  201. data: [], //内容数据
  202. loading: true,
  203. pageData: {
  204. total: 1, // 总条数
  205. pageSizes: 10, // 每页数量
  206. pageNum: 1, // 页码
  207. },
  208. isSelection: true, // 表格有多选时设置
  209. isOperation: false, // 表格有操作列时设置
  210. isIndex: false, // 列表序号
  211. operation: {
  212. // 表格有操作列时设置
  213. label: "操作", // 列名
  214. width: "50", // 根据实际情况给宽度
  215. data: [
  216. {
  217. label: "操作", // 操作名称
  218. type: "", //按钮类型
  219. handleRow: () => {
  220. }, // 自定义事件
  221. },
  222. ],
  223. },
  224. },
  225. childrenList: [],
  226. twoList: [],
  227. twoStatus: false,
  228. threeList: [],
  229. threeStatus: false,
  230. fourList: [],
  231. fourStatus: false,
  232. fiveList: [],
  233. fiveStatus: false,
  234. isSensitiveDataStatus: false,
  235. timeStatus: false,
  236. functionStatus: false,
  237. reportStatus: false,
  238. Length: "",
  239. form: {},
  240. rules: {},
  241. rule: {
  242. needName: [
  243. { required: true, message: "请输入工单标题", trigger: "blur" },
  244. ],
  245. operationType: [
  246. { required: true, message: "请选择操作类型", trigger: "change" },
  247. ]
  248. },
  249. copyRule: {},
  250. isList: [],
  251. remindMmsg: []
  252. };
  253. },
  254. props: {
  255. list: {
  256. type: Object,
  257. default: () => { },
  258. },
  259. disabled: {
  260. type: Boolean,
  261. default: () => { },
  262. },
  263. },
  264. mounted() {
  265. if (this.list.id) {
  266. this.form = this.list;
  267. }
  268. if (this.list.mkFileShareAttachList) {
  269. this.$refs.upload.attList = this.list.mkFileShareAttachList;
  270. this.list.mkFileShareAttachList.map((item) => {
  271. item.name = item.fileName;
  272. });
  273. }
  274. if (this.form.orderNumber) {
  275. this.getFromQuery(this.form.orderNumber)
  276. }
  277. },
  278. created() {
  279. this.form = {
  280. applicant: JSON.parse(window.sessionStorage.userInfo).loginName,
  281. applicationTime: new Date(),
  282. taskName: this.list.taskName,
  283. orderNumber: this.list.orderNumber,
  284. }
  285. this.copyRule = this.rule;
  286. this.getcityList()
  287. },
  288. methods: {
  289. getcityList() {
  290. this.$http({
  291. url: "/sysmgr/csysdept/municipalProvincialDepartments",
  292. method: "post",
  293. headers: {
  294. "Content-Type": "application/json",
  295. },
  296. data: {}
  297. }).then((res) => {
  298. console.log(res);
  299. this.cityList = res.data;
  300. });
  301. },
  302. clickClose() {
  303. },
  304. fireDel() {
  305. if (this.fireSelectList.length > 0) {
  306. this.$confirm("即将删除数据, 是否删除?", "提示", {
  307. confirmButtonText: "确定",
  308. cancelButtonText: "取消",
  309. type: "warning",
  310. })
  311. .then(() => {
  312. this.$http({
  313. url: "/market/opProcessInfo/delBatch",
  314. method: "post",
  315. headers: {
  316. "Content-Type": "application/json",
  317. },
  318. data: this.fireSelectList
  319. }).then((res) => {
  320. this.$message.success('删除成功')
  321. this.page = 1;
  322. this.getFromQuery(this.form.orderNumber)
  323. });
  324. })
  325. .catch(() => { });
  326. }
  327. },
  328. newFireAdd(e) {
  329. if (e == '新增') {
  330. this.fireList.infoId = this.form.orderNumber
  331. this.$http({
  332. url: "/market/opProcessInfo/add",
  333. method: "post",
  334. headers: {
  335. "Content-Type": "application/json",
  336. },
  337. data: this.fireList
  338. }).then((res) => {
  339. this.firewallStatus = false;
  340. this.getFromQuery(this.form.orderNumber)
  341. this.$message.success('添加成功')
  342. });
  343. } else if (e == '修改') {
  344. this.$http({
  345. url: "/market/opProcessInfo/update",
  346. method: "post",
  347. headers: {
  348. "Content-Type": "application/json",
  349. },
  350. data: this.fireList
  351. }).then((res) => {
  352. this.firewallStatus = false;
  353. this.getFromQuery(this.form.orderNumber)
  354. this.$message.success('修改成功')
  355. });
  356. }
  357. },
  358. getFromQuery(e) {
  359. console.log(e);
  360. this.$http({
  361. url: "/market/opProcessInfo/queryPage",
  362. method: "post",
  363. headers: {
  364. "Content-Type": "application/json",
  365. page: '{"pageNo":"' + this.page + '","pageSize":"10"}',
  366. },
  367. data: { infoId: e },
  368. }).then((res) => {
  369. this.lable.data = res.data.data
  370. this.lable.pageData.total = res.data.totalRecord ? res.data.totalRecord : 1;
  371. this.lable.data.map((item, index) => {
  372. item.index = (index + 1) + (res.data.pageNo - 1) * res.data.pageSize
  373. })
  374. this.num = res.data.totalRecord
  375. });
  376. },
  377. newclick(e) {
  378. this.OPTit = '新增'
  379. this.fireList = {};
  380. this.portList = {};
  381. e === 1 ? this.firewallStatus = true : this.protStatus = true;
  382. },
  383. //页码
  384. changeNum(e) {
  385. this.page = e;
  386. this.getFromQuery(this.form.orderNumber)
  387. },
  388. selectNum(e) {
  389. this.fireSelectList = e;
  390. },
  391. selectNums(e) {
  392. this.portSelectList = e
  393. },
  394. //点击工单
  395. clickDemand(row, e) {
  396. if (this.form.taskName === "填写申请单") {
  397. this.OPTit = '修改'
  398. this.fireList = e
  399. this.firewallStatus = true
  400. console.log(e);
  401. }
  402. },
  403. uploadBack(v) {
  404. if (this.form.mkFileShareAttachList) {
  405. this.form.mkFileShareAttachList = [];
  406. this.form.mkFileShareAttachList = v;
  407. } else {
  408. let mkFileShareAttachList = [];
  409. mkFileShareAttachList = v;
  410. this.$set(this.form, "mkFileShareAttachList", mkFileShareAttachList);
  411. }
  412. },
  413. delloadBack(v) {
  414. this.form.mkFileShareAttachList = v;
  415. this.$http({
  416. url: "/market/zfpzProcess/update",
  417. method: "post",
  418. headers: {
  419. "Content-Type": "application/json",
  420. },
  421. data: this.form,
  422. }).then((res) => {
  423. });
  424. },
  425. download() {
  426. console.log(123);
  427. if (this.form.mkFileShareAttachList.length > 1) {
  428. this.$http({
  429. url: "/market/waf/downAllFile",
  430. method: "post",
  431. headers: {
  432. "Content-Type": "application/json",
  433. },
  434. responseType: "blob",
  435. data: { mkFileShareAttachList: this.form.mkFileShareAttachList },
  436. }).then((response) => {
  437. if (window.navigator && window.navigator.msSaveOrOpenBlob) {
  438. let blob = new Blob([response.data], {
  439. type: "application/vnd.ms-excel",
  440. });
  441. window.navigator.msSaveOrOpenBlob(
  442. blob,
  443. new Date().getTime().toString() + ".zip"
  444. );
  445. } else {
  446. /* 火狐谷歌的文件下载方式 */
  447. var blob = new Blob([response.data]);
  448. var downloadElement = document.createElement("a");
  449. var href = window.URL.createObjectURL(blob);
  450. downloadElement.href = href;
  451. downloadElement.download = this.form.needName + ".zip";
  452. document.body.appendChild(downloadElement);
  453. downloadElement.click();
  454. document.body.removeChild(downloadElement);
  455. window.URL.revokeObjectURL(href);
  456. }
  457. if (this.infolist.authType === "3") {
  458. this.dialogCli(10);
  459. }
  460. });
  461. } else {
  462. console.log(this.form.mkFileShareAttachList);
  463. let list = {
  464. id: this.form.mkFileShareAttachList[0].fileCode,
  465. fileName: this.form.mkFileShareAttachList[0].name,
  466. };
  467. this.$http({
  468. url: "/market/waf/downFile",
  469. method: "post",
  470. headers: {
  471. "Content-Type": "application/json",
  472. },
  473. responseType: "blob",
  474. data: list,
  475. }).then((response) => {
  476. console.log(response);
  477. if (window.navigator && window.navigator.msSaveOrOpenBlob) {
  478. let blob = new Blob([response.data], {
  479. type: "application/vnd.ms-excel",
  480. });
  481. //window.navigator.msSaveOrOpenBlob(blob, this.form.needName);
  482. window.navigator.msSaveOrOpenBlob(
  483. blob,
  484. this.form.mkFileShareAttachList[0].name
  485. );
  486. } else {
  487. /* 火狐谷歌的文件下载方式 */
  488. var blob = new Blob([response.data]);
  489. var downloadElement = document.createElement("a");
  490. var href = window.URL.createObjectURL(blob);
  491. downloadElement.href = href;
  492. downloadElement.download = this.form.mkFileShareAttachList[0].name;
  493. document.body.appendChild(downloadElement);
  494. downloadElement.click();
  495. document.body.removeChild(downloadElement);
  496. window.URL.revokeObjectURL(href);
  497. }
  498. });
  499. }
  500. },
  501. },
  502. };
  503. </script>
  504. <style lang="scss" scoped>
  505. .flex-table-header {
  506. margin-bottom: 10px;
  507. span {
  508. margin-left: 20px;
  509. }
  510. }
  511. ::v-deep .el-row {
  512. margin-top: 16px;
  513. }
  514. a {
  515. text-decoration: none;
  516. }
  517. ::v-deep .el-upload-list {
  518. width: 23rem;
  519. }
  520. .flex-title {
  521. text-align: center;
  522. font-size: 24px;
  523. line-height: 60px;
  524. font-weight: bold;
  525. }
  526. .flex-header {
  527. margin-top: 20px;
  528. display: flex;
  529. // justify-content: space-between;
  530. ::v-deep .el-form-item {
  531. width: 20%;
  532. margin-right: 60px;
  533. }
  534. }
  535. .flex-upload {
  536. ::v-deep .el-form-item {
  537. width: 100%;
  538. }
  539. }
  540. .flex-input-tare {
  541. ::v-deep .el-form-item {
  542. width: 100%;
  543. margin-right: 5%;
  544. }
  545. ::v-deep .el-form-item__label {
  546. width: 9rem !important;
  547. }
  548. }
  549. .flex-textarea {
  550. width: 70.5%;
  551. }
  552. .el-upload__tip {
  553. color: red;
  554. }
  555. // ::v-deep .el-input--suffix .el-input__inner {
  556. // width: 119% !important;
  557. // }
  558. ::v-deep .el-input__inner {
  559. color: black !important;
  560. }
  561. ::v-deep .el-textarea.is-disabled .el-textarea__inner {
  562. color: black !important;
  563. }
  564. ::v-deep .el-form-item {
  565. display: flex;
  566. }
  567. ::v-deep .el-form-item__label {
  568. // width:100%;
  569. height: 50px;
  570. line-height: 40px !important;
  571. width: 130px;
  572. font-size: 0.5rem;
  573. }
  574. ::v-deep .el-form-item__content {
  575. width: 100%;
  576. margin-left: 0% !important;
  577. }
  578. .el-select,
  579. ::v-deep.el-input_inner {
  580. width: 100%;
  581. }
  582. ::v-deep.el-form-item.foldLabel .el-form-item__label {
  583. white-space: pre-line;
  584. /*换行显示*/
  585. height: 10px;
  586. /*设置lable高度,input高度一样*/
  587. line-height: 30px !important;
  588. }
  589. ::v-deep .el-pagination {
  590. display: block !important;
  591. background-color: #fff !important;
  592. }
  593. </style>