advertincrease.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  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="true"></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="完成时间" :pickerOptions = "pickerOptions">
  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. computed:{
  341. pickerOptions:function(){
  342. return {
  343. disabledDate(time) {
  344. // if(time.getTime() < Date.now() - 8.64e7 || (time.getTime() > Date.now() && time.getTime() < Date.now() + 8.64e7*3) ){
  345. // return true
  346. // }
  347. if(time.getTime() < Date.now() + 8.64e7*3){
  348. return true
  349. }
  350. }
  351. }
  352. }
  353. },
  354. methods: {
  355. deletes() {
  356. this.treeListonly = {};
  357. this.closeList = !this.closeList;
  358. },
  359. treeCheckonly(v) {
  360. this.treeListonly = v;
  361. },
  362. //添加
  363. dialogCli(v) {
  364. if (v === 1) {
  365. this.fileInfo.fileList = [];
  366. this.infolist = {};
  367. return
  368. }
  369. let _this = this;
  370. let info = {};
  371. info.opTime = _this.$formatDate(new Date(), "YYYY-MM-DD");
  372. info.opNo = this.userInfo.loginNo;
  373. info.opName = this.userInfo.loginName;
  374. info.woTitle = this.infolist.tit;
  375. this.infolist.time = info.opTime;
  376. info.params = {};
  377. info.params.terminalRes = this.infolist;
  378. for (let i = 0; i < this.checkList.length; i++) {
  379. this.checkList[i] == '其他';
  380. this.checkList[i]=this.checkList1;
  381. }
  382. info.params.terminalRes.checkList = this.checkList;
  383. info.params.terminalRes.checkList2 = this.checkList2;
  384. info.params.terminalRes.checkList3 = this.checkList3;
  385. info.procId = this.terminal;
  386. for (let i = 0; i < this.options.length; i++) {
  387. if (this.terminal == this.options[i].procId) {
  388. info.procName = this.options[i].procName;
  389. info.procVersion = this.options[i].procVersion;
  390. }
  391. }
  392. let attList = [];
  393. for (let i = 0; i < this.attList.length; i++) {
  394. attList.push({
  395. id: this.attList[i].id,
  396. fileCode: this.attList[i].fileCode,
  397. fileName: this.attList[i].fileName,
  398. opName: this.attList[i].opName,
  399. opNo: this.attList[i].opNo,
  400. opTime: this.attList[i].opTime,
  401. woNo: this.infolist.woNo,
  402. attchFileId: this.attList[i].attchFileId,
  403. });
  404. }
  405. info.params.assigneeNo = this.treeListonly.leaderAuditNo;
  406. info.params.assigneeName = this.treeListonly.leaderAuditName;
  407. info.params.attList = JSON.stringify(attList)
  408. info.params.terminalRes = JSON.stringify(info.params.terminalRes)
  409. this.submitInfo("/bpm/api/startProc", info);
  410. },
  411. submitInfo(u, v) {
  412. let _this = this;
  413. this.$refs.infolist.validate(valid => {
  414. if (valid) {
  415. this.$http({
  416. url: u,
  417. method: "post",
  418. headers: {
  419. "Content-Type": "application/json",
  420. },
  421. data: v,
  422. }).then((res) => {
  423. if (res.data.result === 1) {
  424. _this.$message({
  425. message: res.data.desc,
  426. type: 'error'
  427. });
  428. } else {
  429. _this.$message({
  430. message: '成功',
  431. type: 'success'
  432. });
  433. _this.$router.push({
  434. path: "/advcheck",
  435. query:{
  436. type:0
  437. }
  438. });
  439. // _this.setabList("广告管理列表", "/advcheck?type="+0);
  440. }
  441. });
  442. }
  443. })
  444. },
  445. //流程
  446. getTermianl() {
  447. this.$http({
  448. url: "/bpm/api/queryBpmProcList",
  449. method: "post",
  450. headers: {
  451. "Content-Type": "application/json",
  452. "page": '{"pageNo":"' + 1 + '","pageSize":"100"}'
  453. },
  454. data: {},
  455. }).then((res) => {
  456. this.options = res.data.data;
  457. });
  458. },
  459. getlist() {
  460. this.$http({
  461. url: "/sysmgr/cfgDataDicts/queryMap",
  462. method: "post",
  463. headers: {
  464. "Content-Type": "application/json",
  465. },
  466. data: {
  467. dictCodePks: 'materType,jjcd,tgqd'
  468. },
  469. }).then((res) => {
  470. this.materTypeopt = res.data.body.materType;
  471. this.fireopt = res.data.body.jjcd;
  472. this.extensionopt = res.data.body.tgqd;
  473. });
  474. },
  475. getUser() {
  476. this.userInfo = JSON.parse(window.sessionStorage.userInfo);
  477. this.infolist.opName = this.userInfo.loginName
  478. this.infolist.phone = this.userInfo.phoneNo
  479. this.infolist.dept = this.userInfo.groupName
  480. },
  481. uploadBack(v) {
  482. this.attList = v;
  483. },
  484. },
  485. mounted() {
  486. this.getTermianl();
  487. this.getUser();
  488. this.getlist();
  489. var _this = this;
  490. let yy = new Date().getFullYear();
  491. let mm = new Date().getMonth()+1;
  492. let dd = new Date().getDate();
  493. let hh = new Date().getHours();
  494. let mf = new Date().getMinutes()<10 ? '0'+new Date().getMinutes() : new Date().getMinutes();
  495. let ss = new Date().getSeconds()<10 ? '0'+new Date().getSeconds() : new Date().getSeconds();
  496. _this.gettime = yy+""+mm+""+dd+""+hh+""+mf+""+ss;
  497. this.infolist.num=_this.gettime
  498. },
  499. created() {
  500. }
  501. }
  502. </script>
  503. <style scoped lang="scss">
  504. .t-footer {
  505. text-align: right;
  506. padding-right: 20px;
  507. margin-top: 20px;
  508. }
  509. .onetab {
  510. padding: 20px;
  511. height: calc(100% - 180px);
  512. }
  513. .titbox {
  514. div {
  515. float: right;
  516. i {
  517. font-size: 22px;
  518. margin-left: 20px;
  519. cursor: pointer;
  520. }
  521. }
  522. }
  523. .tabbox {
  524. margin-top: 15px;
  525. }
  526. .pageBox {
  527. text-align: right;
  528. margin-top: 10px;
  529. }
  530. .info-line {
  531. width: 100%;
  532. display: block;
  533. padding-left: 20px;
  534. div {
  535. width: 50%;
  536. display: inline-block;
  537. }
  538. span {
  539. width: 80px;
  540. display: inline-block;
  541. text-align: left;
  542. i {
  543. color: red;
  544. display: inline-block;
  545. padding-right: 5px;
  546. }
  547. }
  548. .el-select,
  549. .el-input {
  550. width: calc(100% - 100px);
  551. }
  552. .el-checkbox-group {
  553. border: 1px solid #ddd;
  554. padding-left: 20px;
  555. height: 40px;
  556. width: calc(100% - 100px);
  557. border-radius: 5px;
  558. }
  559. }
  560. .online {
  561. width: 100%;
  562. .el-select {
  563. width: calc(100% - 100px);
  564. }
  565. span {
  566. vertical-align: top;
  567. }
  568. .el-textarea {
  569. width: calc(100% - 100px);
  570. }
  571. .tree {
  572. width: calc(50% - 60px);
  573. display: inline-block;
  574. margin-right: 20px;
  575. height: 300px;
  576. overflow-y: scroll;
  577. .el-icon-error {
  578. float: right;
  579. font-size: 20px;
  580. margin-top: 9px;
  581. cursor: pointer;
  582. }
  583. }
  584. .treeUser {
  585. margin: 0;
  586. border: 1px solid #ddd;
  587. p {
  588. background: #f4f4f4;
  589. padding: 0 20px;
  590. margin-bottom: 5px;
  591. }
  592. }
  593. .treeUserb {
  594. width: calc(100% - 100px);
  595. border: 1px solid #ddd;
  596. background: #f4f4f4;
  597. border-radius: 3px;
  598. height: auto;
  599. overflow: hidden;
  600. p {
  601. display: inline-block;
  602. padding: 0 20px;
  603. margin-bottom: 5px;
  604. }
  605. }
  606. }
  607. .tgqd {
  608. margin-bottom: 20px;
  609. .qd-tit {
  610. display: inline-block;
  611. width: 100px;
  612. padding-left: 20px;
  613. vertical-align: top;
  614. }
  615. .qd-box {
  616. border: 1px solid #ddd;
  617. border-radius: 5px;
  618. display: inline-block;
  619. width: calc(100% - 120px);
  620. min-height: 120px;
  621. .zy{
  622. display: flex;
  623. line-height: 40px;
  624. span{
  625. display: inline-block;
  626. margin: 0 20px;
  627. }
  628. .el-input{
  629. width: 200px;
  630. }
  631. }
  632. }
  633. }
  634. </style>