formTables.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  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.mkFileShareAttachList) {
  266. this.$refs.upload.attList = this.list.mkFileShareAttachList;
  267. this.list.mkFileShareAttachList.map((item) => {
  268. item.name = item.fileName;
  269. });
  270. }
  271. if (this.form.orderNumber) {
  272. this.getFromQuery(this.form.orderNumber)
  273. }
  274. },
  275. created() {
  276. this.form = this.list;
  277. this.copyRule = this.rule;
  278. this.form.applicant = JSON.parse(window.sessionStorage.userInfo).loginName
  279. this.form.applicationTime = new Date();
  280. this.getcityList()
  281. },
  282. methods: {
  283. getcityList() {
  284. this.$http({
  285. url: "/sysmgr/csysdept/municipalProvincialDepartments",
  286. method: "post",
  287. headers: {
  288. "Content-Type": "application/json",
  289. },
  290. data: {}
  291. }).then((res) => {
  292. console.log(res);
  293. this.cityList = res.data;
  294. });
  295. },
  296. clickClose() {
  297. },
  298. fireDel() {
  299. if (this.fireSelectList.length > 0) {
  300. this.$confirm("即将删除数据, 是否删除?", "提示", {
  301. confirmButtonText: "确定",
  302. cancelButtonText: "取消",
  303. type: "warning",
  304. })
  305. .then(() => {
  306. this.$http({
  307. url: "/market/opProcessInfo/delBatch",
  308. method: "post",
  309. headers: {
  310. "Content-Type": "application/json",
  311. },
  312. data: this.fireSelectList
  313. }).then((res) => {
  314. this.$message.success('删除成功')
  315. this.page = 1;
  316. this.getFromQuery(this.form.orderNumber)
  317. });
  318. })
  319. .catch(() => { });
  320. }
  321. },
  322. newFireAdd(e) {
  323. if (e == '新增') {
  324. this.fireList.infoId = this.form.orderNumber
  325. this.$http({
  326. url: "/market/opProcessInfo/add",
  327. method: "post",
  328. headers: {
  329. "Content-Type": "application/json",
  330. },
  331. data: this.fireList
  332. }).then((res) => {
  333. this.firewallStatus = false;
  334. this.getFromQuery(this.form.orderNumber)
  335. this.$message.success('添加成功')
  336. });
  337. } else if (e == '修改') {
  338. this.$http({
  339. url: "/market/opProcessInfo/update",
  340. method: "post",
  341. headers: {
  342. "Content-Type": "application/json",
  343. },
  344. data: this.fireList
  345. }).then((res) => {
  346. this.firewallStatus = false;
  347. this.getFromQuery(this.form.orderNumber)
  348. this.$message.success('修改成功')
  349. });
  350. }
  351. },
  352. getFromQuery(e) {
  353. console.log(e);
  354. this.$http({
  355. url: "/market/opProcessInfo/queryPage",
  356. method: "post",
  357. headers: {
  358. "Content-Type": "application/json",
  359. page: '{"pageNo":"' + this.page + '","pageSize":"10"}',
  360. },
  361. data: { infoId: e },
  362. }).then((res) => {
  363. this.lable.data = res.data.data
  364. this.lable.pageData.total = res.data.totalRecord ? res.data.totalRecord : 1;
  365. this.lable.data.map((item, index) => {
  366. item.index = (index + 1) + (res.data.pageNo - 1) * res.data.pageSize
  367. })
  368. this.num = res.data.totalRecord
  369. });
  370. },
  371. newclick(e) {
  372. this.OPTit = '新增'
  373. this.fireList = {};
  374. this.portList = {};
  375. e === 1 ? this.firewallStatus = true : this.protStatus = true;
  376. },
  377. //页码
  378. changeNum(e) {
  379. this.page = e;
  380. this.getFromQuery(this.form.orderNumber)
  381. },
  382. selectNum(e) {
  383. this.fireSelectList = e;
  384. },
  385. selectNums(e) {
  386. this.portSelectList = e
  387. },
  388. //点击工单
  389. clickDemand(row, e) {
  390. if (this.form.taskName === "填写申请单") {
  391. this.OPTit = '修改'
  392. this.fireList = e
  393. this.firewallStatus = true
  394. console.log(e);
  395. }
  396. },
  397. uploadBack(v) {
  398. if (this.form.mkFileShareAttachList) {
  399. this.form.mkFileShareAttachList = [];
  400. this.form.mkFileShareAttachList = v;
  401. } else {
  402. let mkFileShareAttachList = [];
  403. mkFileShareAttachList = v;
  404. this.$set(this.form, "mkFileShareAttachList", mkFileShareAttachList);
  405. }
  406. },
  407. delloadBack(v) {
  408. this.form.mkFileShareAttachList = v;
  409. this.$http({
  410. url: "/market/zfpzProcess/update",
  411. method: "post",
  412. headers: {
  413. "Content-Type": "application/json",
  414. },
  415. data: this.form,
  416. }).then((res) => {
  417. });
  418. },
  419. download() {
  420. console.log(123);
  421. if (this.form.mkFileShareAttachList.length > 1) {
  422. this.$http({
  423. url: "/market/waf/downAllFile",
  424. method: "post",
  425. headers: {
  426. "Content-Type": "application/json",
  427. },
  428. responseType: "blob",
  429. data: { mkFileShareAttachList: this.form.mkFileShareAttachList },
  430. }).then((response) => {
  431. if (window.navigator && window.navigator.msSaveOrOpenBlob) {
  432. let blob = new Blob([response.data], {
  433. type: "application/vnd.ms-excel",
  434. });
  435. window.navigator.msSaveOrOpenBlob(
  436. blob,
  437. new Date().getTime().toString() + ".zip"
  438. );
  439. } else {
  440. /* 火狐谷歌的文件下载方式 */
  441. var blob = new Blob([response.data]);
  442. var downloadElement = document.createElement("a");
  443. var href = window.URL.createObjectURL(blob);
  444. downloadElement.href = href;
  445. downloadElement.download = this.form.needName + ".zip";
  446. document.body.appendChild(downloadElement);
  447. downloadElement.click();
  448. document.body.removeChild(downloadElement);
  449. window.URL.revokeObjectURL(href);
  450. }
  451. if (this.infolist.authType === "3") {
  452. this.dialogCli(10);
  453. }
  454. });
  455. } else {
  456. console.log(this.form.mkFileShareAttachList);
  457. let list = {
  458. id: this.form.mkFileShareAttachList[0].fileCode,
  459. fileName: this.form.mkFileShareAttachList[0].name,
  460. };
  461. this.$http({
  462. url: "/market/waf/downFile",
  463. method: "post",
  464. headers: {
  465. "Content-Type": "application/json",
  466. },
  467. responseType: "blob",
  468. data: list,
  469. }).then((response) => {
  470. console.log(response);
  471. if (window.navigator && window.navigator.msSaveOrOpenBlob) {
  472. let blob = new Blob([response.data], {
  473. type: "application/vnd.ms-excel",
  474. });
  475. //window.navigator.msSaveOrOpenBlob(blob, this.form.needName);
  476. window.navigator.msSaveOrOpenBlob(
  477. blob,
  478. this.form.mkFileShareAttachList[0].name
  479. );
  480. } else {
  481. /* 火狐谷歌的文件下载方式 */
  482. var blob = new Blob([response.data]);
  483. var downloadElement = document.createElement("a");
  484. var href = window.URL.createObjectURL(blob);
  485. downloadElement.href = href;
  486. downloadElement.download = this.form.mkFileShareAttachList[0].name;
  487. document.body.appendChild(downloadElement);
  488. downloadElement.click();
  489. document.body.removeChild(downloadElement);
  490. window.URL.revokeObjectURL(href);
  491. }
  492. });
  493. }
  494. },
  495. },
  496. };
  497. </script>
  498. <style lang="scss" scoped>
  499. .flex-table-header {
  500. margin-bottom: 10px;
  501. span {
  502. margin-left: 20px;
  503. }
  504. }
  505. ::v-deep .el-row {
  506. margin-top: 16px;
  507. }
  508. a {
  509. text-decoration: none;
  510. }
  511. ::v-deep .el-upload-list {
  512. width: 23rem;
  513. }
  514. .flex-title {
  515. text-align: center;
  516. font-size: 24px;
  517. line-height: 60px;
  518. font-weight: bold;
  519. }
  520. .flex-header {
  521. margin-top: 20px;
  522. display: flex;
  523. // justify-content: space-between;
  524. ::v-deep .el-form-item {
  525. width: 20%;
  526. margin-right: 60px;
  527. }
  528. }
  529. .flex-upload {
  530. ::v-deep .el-form-item {
  531. width: 100%;
  532. }
  533. }
  534. .flex-input-tare {
  535. ::v-deep .el-form-item {
  536. width: 100%;
  537. margin-right: 5%;
  538. }
  539. ::v-deep .el-form-item__label {
  540. width: 9rem !important;
  541. }
  542. }
  543. .flex-textarea {
  544. width: 70.5%;
  545. }
  546. .el-upload__tip {
  547. color: red;
  548. }
  549. // ::v-deep .el-input--suffix .el-input__inner {
  550. // width: 119% !important;
  551. // }
  552. ::v-deep .el-input__inner {
  553. color: black !important;
  554. }
  555. ::v-deep .el-textarea.is-disabled .el-textarea__inner {
  556. color: black !important;
  557. }
  558. ::v-deep .el-form-item {
  559. display: flex;
  560. }
  561. ::v-deep .el-form-item__label {
  562. // width:100%;
  563. height: 50px;
  564. line-height: 40px !important;
  565. width: 130px;
  566. font-size: 0.5rem;
  567. }
  568. ::v-deep .el-form-item__content {
  569. width: 100%;
  570. margin-left: 0% !important;
  571. }
  572. .el-select,
  573. ::v-deep.el-input_inner {
  574. width: 100%;
  575. }
  576. ::v-deep.el-form-item.foldLabel .el-form-item__label {
  577. white-space: pre-line;
  578. /*换行显示*/
  579. height: 10px;
  580. /*设置lable高度,input高度一样*/
  581. line-height: 30px !important;
  582. }
  583. ::v-deep .el-pagination {
  584. display: block !important;
  585. background-color: #fff !important;
  586. }
  587. </style>