pointPosition.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. <template>
  2. <fullscreen :fullscreen.sync="fullscreen" class="container">
  3. <div class="container-box">
  4. <toolList @iconCli='iconCli' :tooltit='tooltit'></toolList>
  5. <div class="search">
  6. <mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch>
  7. <el-button type="primary" @click="dialogCheck(3)" size="medium">添加</el-button>
  8. </div>
  9. <div class="tabbox">
  10. <el-table height="calc(100% - 40px)" class="com-table" ref="multipleTable" :data="tableData"
  11. tooltip-effect="dark" size="small" border style="width: 100%" v-loading="loading">
  12. <el-table-column prop="listTitle" label="标题">
  13. </el-table-column>
  14. <el-table-column prop="opTime" label="发布时间">
  15. </el-table-column>
  16. <el-table-column prop="cityName" label="接收范围">
  17. </el-table-column>
  18. <el-table-column prop="opName" label="发起人">
  19. </el-table-column>
  20. <el-table-column label="操作" width="220px" align="center">
  21. <template slot-scope="scope">
  22. <el-button size="mini" type="primary" @click="dialogCheck(1,scope.row)">查看</el-button>
  23. <el-button size="mini" v-if="scope.row.opNo == userInfo.loginNo" type="primary" @click="dialogCheck(2,scope.row)">修改</el-button>
  24. <el-button size="mini" v-if="scope.row.opNo == userInfo.loginNo" type="danger" @click="delLine(scope.row)">删除
  25. </el-button>
  26. </template>
  27. </el-table-column>
  28. </el-table>
  29. <el-pagination class="pageBox" @current-change="currchange" layout="prev, pager, next" background
  30. :total="total">
  31. </el-pagination>
  32. </div>
  33. </div>
  34. <el-dialog :title="titname" :visible.sync="dialogStatus" width="50%" :destroy-on-close="true"
  35. :modal-append-to-body="false" :close-on-click-modal="false" :before-close="closedia">
  36. <div v-loading="loadinged">
  37. <el-form :model="infolist" ref="infolist" :rules="rules" style="height: 300px;">
  38. <div>
  39. <el-form-item prop="listTitle" class="info-line online">
  40. <span>标题</span>
  41. <el-input v-model="infolist.listTitle" placeholder="标题" :disabled="disableStatus">
  42. </el-input>
  43. </el-form-item>
  44. <el-form-item prop="cityName" class="info-line online">
  45. <span>发布范围</span>
  46. <el-select clearable v-model="infolist.cityName" placeholder="发布范围"
  47. :disabled="disableStatus">
  48. <el-option v-for="items in regionopt" :key="items.ou" :label="items.ou"
  49. :value="items.ou">
  50. </el-option>
  51. </el-select>
  52. </el-form-item>
  53. </div>
  54. <div v-if="disableStatus">
  55. <uploadDown :datalist="datalist" :dialogStatus="uploadstatus"></uploadDown>
  56. </div>
  57. <div v-if="!disableStatus">
  58. <myUpload @uploadBack="uploadBack" :fileInfo="fileInfo" :fileList="fileInfo.fileList">
  59. </myUpload>
  60. </div>
  61. </el-form>
  62. <div slot="footer" style="padding-bottom: 20px;text-align: right;">
  63. <el-button type="primary" @click="dialogCliadd(2)">确 定</el-button>
  64. <el-button @click="dialogCliadd(1)">取 消</el-button>
  65. </div>
  66. </div>
  67. </el-dialog>
  68. <myMessage :messTit='messTit' @closeMessage="closeMessage" :centerDialogVisible="centerDialogVisible"
  69. v-if="centerDialogVisible"></myMessage>
  70. </fullscreen>
  71. </template>
  72. <script>
  73. import mySearch from "../../../components/search.vue";
  74. import myMessage from "../../../components/myMessage.vue"
  75. import toolList from '../../../components/toolList'
  76. import myUpload from '../../../components/upload'
  77. import uploadDown from '../../../components/uploadDown.vue'
  78. import deptTreeOnly from "../../../components/deptTreeOnly.vue"
  79. export default {
  80. components: {
  81. mySearch,
  82. myMessage,
  83. toolList,
  84. myUpload,
  85. uploadDown,
  86. deptTreeOnly
  87. },
  88. data() {
  89. const listTitle = (rule, value, callback) => {
  90. if (!this.infolist.listTitle) {
  91. callback(new Error('不能为空'))
  92. } else {
  93. callback()
  94. }
  95. }
  96. const cityName = (rule, value, callback) => {
  97. if (!this.infolist.cityName) {
  98. callback(new Error('不能为空'))
  99. } else {
  100. callback()
  101. }
  102. }
  103. return {
  104. rules: {
  105. listTitle: [{
  106. required: true,
  107. trigger: 'blur',
  108. validator: listTitle
  109. }],
  110. cityName: [{
  111. required: true,
  112. trigger: 'change',
  113. validator: cityName
  114. }],
  115. },
  116. searchList: [{
  117. type: 'input',
  118. tit: '标题',
  119. value: '',
  120. width: '98%',
  121. }],
  122. tooltit: '宣传点位清单',
  123. fullscreen: false,
  124. total: 0,
  125. pageSize: 1,
  126. tableData: [{}],
  127. dialogStatus: false,
  128. disableStatus: false,
  129. titname: '',
  130. infolist: {
  131. },
  132. userInfo: {},
  133. params: {},
  134. centerDialogVisible: false,
  135. messTit: '',
  136. delid: '',
  137. loading: false,
  138. loadinged: false,
  139. docType: [],
  140. contentType: [],
  141. infodata: [{}],
  142. infodatat: [{}],
  143. datalist: {
  144. url: '/market/compatt/downfile',
  145. type: 1
  146. },
  147. uploadstatus: false,
  148. attList: [],
  149. fileInfo: {
  150. limit: 1,
  151. url: '/market/cmkAttachInfo/upload',
  152. fileList: [],
  153. uploadType: 'trainList'
  154. },
  155. regionopt: [],
  156. companyFlag: '',
  157. treeListonly: {},
  158. defaultList: [],
  159. closeList: false,
  160. visionchonly: false,
  161. depttype: 0,
  162. }
  163. },
  164. methods: {
  165. uploadBack(v) {
  166. this.attList = v;
  167. },
  168. //搜索数据
  169. searchInfo(v) {
  170. this.params = {};
  171. v[0] ? this.params.listTitle = v[0] : '';
  172. this.getList(this.params, this.pageSize);
  173. },
  174. closedia() {
  175. this.infolist = {};
  176. this.infodata = [{}];
  177. this.attList = [];
  178. this.fileInfo.fileList = [];
  179. this.dialogStatus = false;
  180. },
  181. //获取列表
  182. getList(v, n) {
  183. this.pageSize = n;
  184. let _this = this;
  185. this.loading = true;
  186. this.$http({
  187. url: "/market/cStoreScheTrainList/queryPage",
  188. method: "post",
  189. headers: {
  190. "Content-Type": "application/json",
  191. "page": '{"pageNo":"' + n + '","pageSize":"10"}'
  192. },
  193. data: v,
  194. }).then((res) => {
  195. this.tableData = res.data.data;
  196. this.total = res.data.totalRecord;
  197. this.loading = false;
  198. });
  199. },
  200. // 分页
  201. currchange(v) {
  202. this.pageSize = v;
  203. this.getList(this.params, this.pageSize);
  204. },
  205. //申请
  206. dialogCheck(v, n) {
  207. this.dialogStatus = true;
  208. let infolist = Object.assign({}, n);
  209. if (v === 1) {
  210. this.titname = '查看';
  211. this.disableStatus = true;
  212. } else if (v === 2) {
  213. this.titname = '修改';
  214. this.disableStatus = false;
  215. } else if (v === 3) {
  216. this.titname = '添加';
  217. this.disableStatus = false;
  218. return
  219. }
  220. this.infolist = infolist;
  221. this.$http({
  222. url: "/market/cStoreScheTrainList/query",
  223. method: "post",
  224. headers: {
  225. "Content-Type": "application/json",
  226. },
  227. data: {
  228. id: n.id
  229. },
  230. }).then((res) => {
  231. res.data.attList.forEach(item => {
  232. this.fileInfo.fileList.push({
  233. name: item.fileName,
  234. url: '',
  235. id: item.id,
  236. fileCode: item.fileCode,
  237. fileName: item.fileName
  238. });
  239. this.attList.push({
  240. name: item.fileName,
  241. url: '',
  242. id: item.id,
  243. fileCode: item.fileCode,
  244. fileName: item.fileName
  245. });
  246. })
  247. this.datalist.attList = [];
  248. this.datalist.attList = res.data.attList;
  249. this.uploadstatus = !this.uploadstatus;
  250. });
  251. },
  252. //添加
  253. dialogCliadd(v) {
  254. if (v == 1 || this.titname == '查看') {
  255. this.infolist = {
  256. };
  257. this.infodata = [{}];
  258. this.infodatat = [{}];
  259. this.attList = [];
  260. this.fileInfo.fileList = [];
  261. this.dialogStatus = false;
  262. return
  263. }
  264. let _this = this;
  265. let info = this.infolist;
  266. info.opTime = _this.$formatDate(new Date(), "YYYY-MM-DD");
  267. info.opNo = this.userInfo.loginNo;
  268. info.opName = this.userInfo.loginName;
  269. let attList = [];
  270. for (let i = 0; i < this.attList.length; i++) {
  271. attList.push({
  272. id: this.attList[i].id,
  273. fileCode: this.attList[i].fileCode,
  274. fileName: this.attList[i].fileName,
  275. });
  276. }
  277. info.attList = attList;
  278. for (let i = 0; i < this.regionopt.length; i++) {
  279. if(this.regionopt[i].ou == this.infolist.cityName){
  280. this.infolist.cityId = this.regionopt[i].o
  281. }
  282. }
  283. if(info.attList.length == 0){
  284. this.$message({
  285. message: '请上传附件!',
  286. type: 'error'
  287. });
  288. return
  289. }
  290. if (this.titname == '修改') {
  291. this.submitInfo("/market/cStoreScheTrainList/update", info);
  292. } else {
  293. this.submitInfo("/market/cStoreScheTrainList/add", info);
  294. }
  295. },
  296. submitInfo(u, v) {
  297. let _this = this;
  298. this.$refs.infolist.validate(valid => {
  299. if (valid) {
  300. this.$http({
  301. url: u,
  302. method: "post",
  303. headers: {
  304. "Content-Type": "application/json",
  305. },
  306. data: v,
  307. }).then((res) => {
  308. if (res.data.result === 1) {
  309. _this.$message({
  310. message: res.data.desc,
  311. type: 'error'
  312. });
  313. } else {
  314. _this.$message({
  315. message: '成功',
  316. type: 'success'
  317. });
  318. _this.closedia();
  319. _this.infolist = {
  320. };
  321. _this.infodata = [{}];
  322. _this.infodatat = [{}];
  323. _this.getList(this.params, this.pageSize);
  324. }
  325. });
  326. }
  327. })
  328. },
  329. closeMessage(v) {
  330. this.centerDialogVisible = false;
  331. let _this = this;
  332. if (v === 1) {
  333. _this.$http({
  334. url: "/market/cStoreScheTrainList/del",
  335. method: "post",
  336. headers: {
  337. "Content-Type": "application/json",
  338. },
  339. data: {
  340. id: this.delid
  341. },
  342. }).then((res) => {
  343. if (res.data.result === 1) {
  344. _this.$message({
  345. message: res.data.desc,
  346. type: 'error'
  347. });
  348. } else {
  349. _this.$message({
  350. message: '删除成功',
  351. type: 'success'
  352. });
  353. _this.getList(this.params, this.pageSize);
  354. }
  355. });
  356. }
  357. },
  358. //删除
  359. delLine(v) {
  360. this.centerDialogVisible = true;
  361. this.messTit = '即将删除此条数据, 是否删除?';
  362. this.delid = v.id;
  363. },
  364. //功能栏
  365. iconCli(v) {
  366. if (v === 1) {
  367. this.getList(this.params, this.pageSize);
  368. }
  369. if (v === 2) {
  370. this.fullscreen = !this.fullscreen
  371. }
  372. },
  373. getUser() {
  374. this.userInfo = JSON.parse(window.sessionStorage.userInfo);
  375. this.$http({
  376. url: "/sysmgr/csysdept/queryRegionDeptList",
  377. method: "post",
  378. headers: {
  379. "Content-Type": "application/json",
  380. },
  381. data: {},
  382. }).then((res) => {
  383. this.regionopt = res.data[0].children;
  384. });
  385. },
  386. },
  387. mounted() {
  388. this.getList({}, 1);
  389. this.getUser();
  390. },
  391. created() {
  392. }
  393. }
  394. </script>
  395. <style scoped lang="scss">
  396. .onetab {
  397. margin-bottom: 20px;
  398. padding: 0 20px;
  399. }
  400. .titbox {
  401. div {
  402. float: right;
  403. i {
  404. font-size: 22px;
  405. margin-left: 20px;
  406. cursor: pointer;
  407. }
  408. }
  409. }
  410. .tabbox {
  411. margin-top: 15px;
  412. }
  413. .pageBox {
  414. text-align: right;
  415. margin-top: 10px;
  416. }
  417. .info-line {
  418. width: 100%;
  419. display: block;
  420. padding-left: 20px;
  421. div {
  422. width: 50%;
  423. display: inline-block;
  424. }
  425. span {
  426. width: 100px;
  427. display: inline-block;
  428. text-align: left;
  429. i {
  430. color: red;
  431. display: inline-block;
  432. padding-right: 5px;
  433. }
  434. }
  435. .el-select,
  436. .el-input {
  437. width: calc(100% - 120px);
  438. }
  439. }
  440. .online {
  441. width: 100%;
  442. .el-select {
  443. width: calc(100% - 120px);
  444. }
  445. span {
  446. vertical-align: top;
  447. }
  448. .el-textarea {
  449. width: calc(100% - 120px);
  450. }
  451. .tree {
  452. width: calc(50% - 60px);
  453. display: inline-block;
  454. margin-right: 20px;
  455. height: 300px;
  456. overflow-y: scroll;
  457. .el-icon-error {
  458. float: right;
  459. font-size: 20px;
  460. margin-top: 9px;
  461. cursor: pointer;
  462. }
  463. }
  464. .treeUser {
  465. margin: 0;
  466. border: 1px solid #ddd;
  467. p {
  468. background: #f4f4f4;
  469. padding: 0 20px;
  470. margin-bottom: 5px;
  471. }
  472. }
  473. .treeUserb {
  474. width: calc(100% - 100px);
  475. border: 1px solid #ddd;
  476. background: #f4f4f4;
  477. border-radius: 3px;
  478. height: auto;
  479. overflow: hidden;
  480. p {
  481. display: inline-block;
  482. padding: 0 20px;
  483. margin-bottom: 5px;
  484. }
  485. }
  486. }
  487. .adv-type {
  488. margin-top: 20px;
  489. display: flex;
  490. justify-content: space-between;
  491. flex-wrap: wrap;
  492. // border: 1px solid #ddd;
  493. border-radius: 5px;
  494. padding: 20px;
  495. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
  496. div {
  497. width: 33%;
  498. text-align: center;
  499. height: 80px;
  500. overflow: hidden;
  501. min-width: 100px;
  502. cursor: pointer;
  503. padding-top: 10px;
  504. margin: 10px 0;
  505. }
  506. div:hover {
  507. background: #CFE8FC;
  508. border-radius: 5px;
  509. }
  510. span {
  511. width: 100%;
  512. display: inline-block;
  513. height: 40px;
  514. // line-height: 40px;
  515. i {
  516. color: #0074D9;
  517. font-size: 36px;
  518. }
  519. }
  520. }
  521. </style>