advertincrease.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. <template>
  2. <div>
  3. <div class="container">
  4. <el-form :model="infolist" ref="infolist" :rules="rules" class="container-box">
  5. <h2 style="display: block;margin-bottom: 20px;">广告申请</h2>
  6. <div style="height: calc(100% - 160px);overflow-y: scroll;">
  7. <div class="info-line">
  8. <el-form-item prop="tit">
  9. <span>文件标题</span>
  10. <el-input v-model="infolist.tit" placeholder="文件标题" :disabled="disableStatus"></el-input>
  11. </el-form-item>
  12. <el-form-item prop="dept">
  13. <span>申请部门</span>
  14. <el-input v-model="infolist.dept" placeholder="申请部门"></el-input>
  15. <!-- <el-select clearable v-model="infolist.dept" placeholder="申请部门">
  16. <el-option v-for="items in terminalopt" :key="items.procId" :label="items.procName"
  17. :value="items.procId">
  18. </el-option>
  19. </el-select> -->
  20. </el-form-item>
  21. <el-form-item prop="opName">
  22. <span>申请人</span>
  23. <el-input v-model="infolist.opName" placeholder="申请人"></el-input>
  24. </el-form-item>
  25. <el-form-item prop="phone">
  26. <span>联系电话</span>
  27. <el-input v-model="infolist.phone" placeholder="联系电话"></el-input>
  28. </el-form-item>
  29. <!-- <el-form-item prop="time">
  30. <span>申请时间</span>
  31. <el-date-picker v-model="infolist.time" type="date" placeholder="申请时间">
  32. </el-date-picker>
  33. </el-form-item> -->
  34. <el-form-item prop="num">
  35. <span>文件编号</span>
  36. <el-input v-model="infolist.num" placeholder="文件编号" :disabled="disableStatus"></el-input>
  37. </el-form-item>
  38. <el-form-item prop="overtime">
  39. <span>完成时间</span>
  40. <el-date-picker v-model="infolist.overtime" type="date" placeholder="完成时间">
  41. </el-date-picker>
  42. </el-form-item>
  43. <el-form-item prop="urgent">
  44. <span>紧急程度</span>
  45. <el-select :popper-append-to-body="false" clearable v-model="infolist.urgent"
  46. placeholder="紧急程度">
  47. <el-option v-for="items in fireopt" :key="items.dataCode" :label="items.dataName"
  48. :value="items.dataCode">
  49. </el-option>
  50. </el-select>
  51. </el-form-item>
  52. <el-form-item prop="materType">
  53. <span>素材类型</span>
  54. <el-select :popper-append-to-body="false" clearable v-model="infolist.materType"
  55. placeholder="素材类型">
  56. <el-option v-for="items in materTypeopt" :key="items.dataCode" :label="items.dataName"
  57. :value="items.dataCode">
  58. </el-option>
  59. </el-select>
  60. </el-form-item>
  61. </div>
  62. <div class="tgqd">
  63. <span class="qd-tit">推广渠道</span>
  64. <div class="qd-box">
  65. <div class="zy">
  66. <span>自有渠道</span>
  67. <div style="display: flex;">
  68. <el-checkbox-group v-model="checkList">
  69. <el-checkbox label="实体渠道"></el-checkbox>
  70. <el-checkbox label="门户网站"></el-checkbox>
  71. <el-checkbox label="移动旗舰店app"></el-checkbox>
  72. <el-checkbox label="官方网站"></el-checkbox>
  73. <el-checkbox label="官方微信"></el-checkbox>
  74. <el-checkbox label="电视营业厅(魔百和)"></el-checkbox>
  75. <el-checkbox label="其他"></el-checkbox>
  76. </el-checkbox-group>
  77. <el-input v-model="checkList1" size="mini" style="margin-left: 20px;"></el-input>
  78. </div>
  79. </div>
  80. <div class="zy">
  81. <span>外部渠道</span>
  82. <div>
  83. <el-checkbox-group v-model="checkList2">
  84. <el-checkbox label="广播"></el-checkbox>
  85. <el-checkbox label="电视"></el-checkbox>
  86. <el-checkbox label="报纸"></el-checkbox>
  87. <el-checkbox label="互联网"></el-checkbox>
  88. <el-checkbox label="户外"></el-checkbox>
  89. <el-checkbox label="社会渠道"></el-checkbox>
  90. <el-checkbox label="手机卖场"></el-checkbox>
  91. </el-checkbox-group>
  92. </div>
  93. </div>
  94. <div class="zy">
  95. <span style="width: 60px;text-align: right;">其他</span>
  96. <div>
  97. <el-input v-model="checkList3" size="mini"></el-input>
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. <el-form-item class="info-line online" prop="propaganda">
  103. <span>产品及卖点</span>
  104. <el-input v-model="infolist.propaganda" placeholder="产品及卖点" type="textarea" :rows="3">
  105. </el-input>
  106. </el-form-item>
  107. <el-form-item class="info-line online" prop="explain">
  108. <span>宣传内容</span>
  109. <el-input v-model="infolist.explain" placeholder="宣传内容" type="textarea" :rows="3"></el-input>
  110. </el-form-item>
  111. <div style="padding-left: 80px">
  112. <myUpload @uploadBack="uploadBack" :fileInfo="fileInfo" :fileList="fileInfo.fileList">
  113. </myUpload>
  114. </div>
  115. </div>
  116. <div class="t-footer">
  117. <el-button type="primary" @click="checkexa = true">确 定</el-button>
  118. <el-button @click="dialogCli(1)">取 消</el-button>
  119. </div>
  120. </el-form>
  121. </div>
  122. <el-dialog title="选择审批人" :visible.sync="checkexa" width="50%" :destroy-on-close="true"
  123. :modal-append-to-body="false" :close-on-click-modal="false">
  124. <div>
  125. <el-form :model="infolist" ref="infolist" :rules="rules">
  126. <el-form-item prop="visiblec" class="info-line online">
  127. <span>审批人员</span>
  128. <deptTreeOnly class="tree" @treeCheck="treeCheckonly" :defaultList="defaultList"
  129. :type="depttype" :closeList="closeList"></deptTreeOnly>
  130. <div class="tree treeUser">
  131. <p>{{treeListonly.leaderAuditName}}
  132. <i v-if="treeListonly.leaderAuditName" @click="deletes()"
  133. class="el-icon-error"></i>
  134. </p>
  135. </div>
  136. </el-form-item>
  137. </el-form>
  138. <div slot="footer" style="text-align: right;padding-bottom: 20px;">
  139. <el-button type="primary" @click="dialogCli(2)">确 定</el-button>
  140. <el-button @click="checkexa = false">取 消</el-button>
  141. </div>
  142. </div>
  143. </el-dialog>
  144. </div>
  145. </template>
  146. <script>
  147. import mySearch from "../../../components/search.vue";
  148. import myUpload from "../../../components/upload.vue";
  149. import deptTreeOnly from "../../../components/deptTreeOnly.vue"
  150. export default {
  151. components: {
  152. mySearch,
  153. myUpload,
  154. deptTreeOnly
  155. },
  156. data() {
  157. const tit = (rule, value, callback) => {
  158. if (!this.infolist.tit) {
  159. callback(new Error('不能为空'))
  160. } else {
  161. callback()
  162. }
  163. }
  164. const dept = (rule, value, callback) => {
  165. if (!this.infolist.dept) {
  166. callback(new Error('不能为空'))
  167. } else {
  168. callback()
  169. }
  170. }
  171. const opName = (rule, value, callback) => {
  172. if (!this.infolist.opName) {
  173. callback(new Error('不能为空'))
  174. } else {
  175. callback()
  176. }
  177. }
  178. const phone = (rule, value, callback) => {
  179. if (!this.infolist.phone) {
  180. callback(new Error('不能为空'))
  181. } else {
  182. callback()
  183. }
  184. }
  185. const time = (rule, value, callback) => {
  186. if (!this.infolist.time) {
  187. callback(new Error('不能为空'))
  188. } else {
  189. callback()
  190. }
  191. }
  192. const num = (rule, value, callback) => {
  193. if (!this.infolist.num) {
  194. callback(new Error('不能为空'))
  195. } else {
  196. callback()
  197. }
  198. }
  199. const overtime = (rule, value, callback) => {
  200. if (!this.infolist.overtime) {
  201. callback(new Error('不能为空'))
  202. } else {
  203. callback()
  204. }
  205. }
  206. const urgent = (rule, value, callback) => {
  207. if (!this.infolist.urgent) {
  208. callback(new Error('不能为空'))
  209. } else {
  210. callback()
  211. }
  212. }
  213. const materType = (rule, value, callback) => {
  214. if (!this.infolist.materType) {
  215. callback(new Error('不能为空'))
  216. } else {
  217. callback()
  218. }
  219. }
  220. const propaganda = (rule, value, callback) => {
  221. if (!this.infolist.propaganda) {
  222. callback(new Error('不能为空'))
  223. } else {
  224. callback()
  225. }
  226. }
  227. const explain = (rule, value, callback) => {
  228. if (!this.infolist.explain) {
  229. callback(new Error('不能为空'))
  230. } else {
  231. callback()
  232. }
  233. }
  234. return {
  235. rules: {
  236. tit: [{
  237. required: true,
  238. trigger: 'blur',
  239. validator: tit
  240. }],
  241. dept: [{
  242. required: true,
  243. trigger: 'blur',
  244. validator: dept
  245. }],
  246. opName: [{
  247. required: true,
  248. trigger: 'blur',
  249. validator: opName
  250. }],
  251. phone: [{
  252. required: true,
  253. trigger: 'blur',
  254. validator: phone
  255. }],
  256. time: [{
  257. required: true,
  258. trigger: 'change',
  259. validator: time
  260. }],
  261. num: [{
  262. required: true,
  263. trigger: 'blur',
  264. validator: num
  265. }],
  266. overtime: [{
  267. required: true,
  268. trigger: 'change',
  269. validator: overtime
  270. }],
  271. urgent: [{
  272. required: true,
  273. trigger: 'change',
  274. validator: urgent
  275. }],
  276. materType: [{
  277. required: true,
  278. trigger: 'change',
  279. validator: materType
  280. }],
  281. propaganda: [{
  282. required: true,
  283. trigger: 'blur',
  284. validator: propaganda
  285. }],
  286. explain: [{
  287. required: true,
  288. trigger: 'blur',
  289. validator: explain
  290. }],
  291. },
  292. fullscreen: false,
  293. total: 0,
  294. pageSize: 1,
  295. tableData: [{}],
  296. disableStatus: false,
  297. titname: '终端',
  298. infolist: {
  299. tit: '',
  300. terminal: '',
  301. dept: '',
  302. opName: '',
  303. time: '',
  304. phone: '',
  305. overtime: '',
  306. propaganda: '',
  307. explain: '',
  308. },
  309. terminal: '688225294361509888',
  310. terminalopt: [{
  311. procId: '111',
  312. procName: '1111',
  313. }],
  314. userInfo: {},
  315. params: {},
  316. infoApply: [],
  317. options: [],
  318. fireopt: [],
  319. typeopt: [],
  320. materTypeopt: [],
  321. attList: [],
  322. fileInfo: {
  323. type: 'img',
  324. limit: 50,
  325. url: '/bpm/api/upload',
  326. fileList: []
  327. },
  328. checkList:[],
  329. checkList1:'',
  330. checkList2:[],
  331. checkList3:'',
  332. checkexa: false,
  333. treeListonly: {},
  334. defaultList: [],
  335. closeList: false,
  336. visionchonly: false,
  337. depttype: 0,
  338. }
  339. },
  340. methods: {
  341. deletes() {
  342. this.treeListonly = {};
  343. this.closeList = !this.closeList;
  344. },
  345. treeCheckonly(v) {
  346. this.treeListonly = v;
  347. },
  348. //添加
  349. dialogCli(v) {
  350. if (v === 1) {
  351. this.fileInfo.fileList = [];
  352. this.infolist = {};
  353. return
  354. }
  355. let _this = this;
  356. let info = {};
  357. info.opTime = _this.$formatDate(new Date(), "YYYY-MM-DD");
  358. info.opNo = this.userInfo.loginNo;
  359. info.opName = this.userInfo.loginName;
  360. info.woTitle = this.infolist.tit;
  361. this.infolist.time = info.opTime;
  362. info.params = {};
  363. info.params.terminalRes = this.infolist;
  364. for (let i = 0; i < this.checkList.length; i++) {
  365. this.checkList[i] == '其他';
  366. this.checkList[i]=this.checkList1;
  367. }
  368. info.params.terminalRes.checkList = this.checkList;
  369. info.params.terminalRes.checkList2 = this.checkList2;
  370. info.params.terminalRes.checkList3 = this.checkList3;
  371. info.procId = this.terminal;
  372. for (let i = 0; i < this.options.length; i++) {
  373. if (this.terminal == this.options[i].procId) {
  374. info.procName = this.options[i].procName;
  375. info.procVersion = this.options[i].procVersion;
  376. }
  377. }
  378. let attList = [];
  379. for (let i = 0; i < this.attList.length; i++) {
  380. attList.push({
  381. id: this.attList[i].id,
  382. fileCode: this.attList[i].fileCode,
  383. fileName: this.attList[i].fileName,
  384. opName: this.attList[i].opName,
  385. opNo: this.attList[i].opNo,
  386. opTime: this.attList[i].opTime,
  387. woNo: this.infolist.woNo,
  388. attchFileId: this.attList[i].attchFileId,
  389. });
  390. }
  391. info.params.assigneeNo = this.treeListonly.leaderAuditNo;
  392. info.params.assigneeName = this.treeListonly.leaderAuditName;
  393. info.params.attList = JSON.stringify(attList)
  394. info.params.terminalRes = JSON.stringify(info.params.terminalRes)
  395. this.submitInfo("/bpm/api/startProc", info);
  396. },
  397. submitInfo(u, v) {
  398. let _this = this;
  399. this.$refs.infolist.validate(valid => {
  400. if (valid) {
  401. this.$http({
  402. url: u,
  403. method: "post",
  404. headers: {
  405. "Content-Type": "application/json",
  406. },
  407. data: v,
  408. }).then((res) => {
  409. if (res.data.result === 1) {
  410. _this.$message({
  411. message: res.data.desc,
  412. type: 'error'
  413. });
  414. } else {
  415. _this.$message({
  416. message: '成功',
  417. type: 'success'
  418. });
  419. _this.$router.push({
  420. path: "/advcheck",
  421. query:{
  422. type:0
  423. }
  424. });
  425. // _this.setabList("广告管理列表", "/advcheck?type="+0);
  426. }
  427. });
  428. }
  429. })
  430. },
  431. //流程
  432. getTermianl() {
  433. this.$http({
  434. url: "/bpm/api/queryBpmProcList",
  435. method: "post",
  436. headers: {
  437. "Content-Type": "application/json",
  438. "page": '{"pageNo":"' + 1 + '","pageSize":"100"}'
  439. },
  440. data: {},
  441. }).then((res) => {
  442. this.options = res.data.data;
  443. });
  444. },
  445. getlist() {
  446. this.$http({
  447. url: "/sysmgr/cfgDataDicts/queryMap",
  448. method: "post",
  449. headers: {
  450. "Content-Type": "application/json",
  451. },
  452. data: {
  453. dictCodePks: 'materType,jjcd,tgqd'
  454. },
  455. }).then((res) => {
  456. this.materTypeopt = res.data.body.materType;
  457. this.fireopt = res.data.body.jjcd;
  458. this.extensionopt = res.data.body.tgqd;
  459. });
  460. },
  461. getUser() {
  462. this.userInfo = JSON.parse(window.sessionStorage.userInfo);
  463. this.infolist.opName = this.userInfo.loginName
  464. this.infolist.phone = this.userInfo.phoneNo
  465. this.infolist.dept = this.userInfo.groupName
  466. },
  467. uploadBack(v) {
  468. this.attList = v;
  469. },
  470. },
  471. mounted() {
  472. this.getTermianl();
  473. this.getUser();
  474. this.getlist();
  475. },
  476. created() {
  477. }
  478. }
  479. </script>
  480. <style scoped lang="scss">
  481. .t-footer {
  482. text-align: right;
  483. padding-right: 20px;
  484. margin-top: 20px;
  485. }
  486. .onetab {
  487. padding: 20px;
  488. height: calc(100% - 180px);
  489. }
  490. .titbox {
  491. div {
  492. float: right;
  493. i {
  494. font-size: 22px;
  495. margin-left: 20px;
  496. cursor: pointer;
  497. }
  498. }
  499. }
  500. .tabbox {
  501. margin-top: 15px;
  502. }
  503. .pageBox {
  504. text-align: right;
  505. margin-top: 10px;
  506. }
  507. .info-line {
  508. width: 100%;
  509. display: block;
  510. padding-left: 20px;
  511. div {
  512. width: 50%;
  513. display: inline-block;
  514. }
  515. span {
  516. width: 80px;
  517. display: inline-block;
  518. text-align: left;
  519. i {
  520. color: red;
  521. display: inline-block;
  522. padding-right: 5px;
  523. }
  524. }
  525. .el-select,
  526. .el-input {
  527. width: calc(100% - 100px);
  528. }
  529. .el-checkbox-group {
  530. border: 1px solid #ddd;
  531. padding-left: 20px;
  532. height: 40px;
  533. width: calc(100% - 100px);
  534. border-radius: 5px;
  535. }
  536. }
  537. .online {
  538. width: 100%;
  539. .el-select {
  540. width: calc(100% - 100px);
  541. }
  542. span {
  543. vertical-align: top;
  544. }
  545. .el-textarea {
  546. width: calc(100% - 100px);
  547. }
  548. .tree {
  549. width: calc(50% - 60px);
  550. display: inline-block;
  551. margin-right: 20px;
  552. height: 300px;
  553. overflow-y: scroll;
  554. .el-icon-error {
  555. float: right;
  556. font-size: 20px;
  557. margin-top: 9px;
  558. cursor: pointer;
  559. }
  560. }
  561. .treeUser {
  562. margin: 0;
  563. border: 1px solid #ddd;
  564. p {
  565. background: #f4f4f4;
  566. padding: 0 20px;
  567. margin-bottom: 5px;
  568. }
  569. }
  570. .treeUserb {
  571. width: calc(100% - 100px);
  572. border: 1px solid #ddd;
  573. background: #f4f4f4;
  574. border-radius: 3px;
  575. height: auto;
  576. overflow: hidden;
  577. p {
  578. display: inline-block;
  579. padding: 0 20px;
  580. margin-bottom: 5px;
  581. }
  582. }
  583. }
  584. .tgqd {
  585. margin-bottom: 20px;
  586. .qd-tit {
  587. display: inline-block;
  588. width: 100px;
  589. padding-left: 20px;
  590. vertical-align: top;
  591. }
  592. .qd-box {
  593. border: 1px solid #ddd;
  594. border-radius: 5px;
  595. display: inline-block;
  596. width: calc(100% - 120px);
  597. min-height: 120px;
  598. .zy{
  599. display: flex;
  600. line-height: 40px;
  601. span{
  602. display: inline-block;
  603. margin: 0 20px;
  604. }
  605. .el-input{
  606. width: 200px;
  607. }
  608. }
  609. }
  610. }
  611. </style>