agencyTask.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. <template>
  2. <div class="container">
  3. <fullscreen :fullscreen.sync="fullscreen" class="container-box">
  4. <div class="titbox">
  5. <h2>待办任务</h2>
  6. <div>
  7. <i class="el-icon-refresh" @click="iconCli(1)"></i>
  8. <i class="el-icon-full-screen" @click="iconCli(2)"></i>
  9. <!-- <i class="el-icon-folder-opened"></i>-->
  10. <!-- <i class="el-icon-view"></i>-->
  11. <!-- <i class="el-icon-more"></i>-->
  12. </div>
  13. </div>
  14. <div class="search">
  15. <mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch>
  16. </div>
  17. <div class="tabbox">
  18. <el-table height="calc(100% - 40px)" class="com-table" ref="multipleTable" :data="tableData" tooltip-effect="dark" size="small"
  19. border style="width: 100%">
  20. <el-table-column prop="terminalTypeName" label="任务标题">
  21. </el-table-column>
  22. <el-table-column prop="brandName" label="派发人">
  23. </el-table-column>
  24. <el-table-column prop="modelType" label="派发姓名">
  25. </el-table-column>
  26. <el-table-column prop="num" label="派发时间">
  27. </el-table-column>
  28. <el-table-column label="操作" width="180px" align="center">
  29. <template slot-scope="scope">
  30. <el-button size="mini" type="primary" @click="dialogCheck(1,scope.row)">查看</el-button>
  31. <el-button size="mini" type="primary" @click="dialogCheck(2,scope.row)">回复</el-button>
  32. <el-button size="mini" type="primary" @click="dialogCheck(3,scope.row)">回复确认</el-button>
  33. </template>
  34. </el-table-column>
  35. </el-table>
  36. <el-pagination class="pageBox" @current-change="currchange" layout="prev, pager, next" background
  37. :total="total">
  38. </el-pagination>
  39. </div>
  40. </fullscreen>
  41. <el-dialog :title="titname" :visible.sync="dialogStatus" width="50%" :destroy-on-close="true" :modal-append-to-body="false"
  42. :close-on-click-modal="false">
  43. <el-form :model="infolist" ref="infolist" :rules="rules">
  44. <div class="info-line">
  45. <el-form-item >
  46. <span>任务标题</span>
  47. <el-input v-model="infolist.noticeTitle" placeholder="标题" disabled></el-input>
  48. </el-form-item>
  49. <el-form-item >
  50. <span>反馈时间</span>
  51. <el-date-picker v-model="infolist.BackTime" type="date" placeholder="要求反馈时间" disabled>
  52. </el-date-picker>
  53. </el-form-item>
  54. </div>
  55. <el-form-item class="info-line online">
  56. <span>接收部门</span>
  57. <el-select v-model="visiblec" placeholder="接收部门" multiple clearable disabled>
  58. <el-option v-for="item in typeOptions" :key="item.id" :label="item.ou" :value="item.id">
  59. </el-option>
  60. </el-select>
  61. </el-form-item>
  62. <el-form-item class="info-line online" >
  63. <span>任务描述</span>
  64. <el-input v-model="infolist.noticeContent" placeholder="任务描述" type="textarea" :rows="3" disabled></el-input>
  65. </el-form-item>
  66. <div style="padding:0 20px 0 100px;margin-bottom: 20px;">
  67. <uploadDown :datalist="datalist" :dialogStatus="uploadstatus"></uploadDown>
  68. </div>
  69. <el-form-item class="info-line online" >
  70. <span>回复内容</span>
  71. <el-input v-model="infolist.noticeContent" placeholder="回复内容" type="textarea" :rows="3" :disabled='disableStatus'></el-input>
  72. </el-form-item>
  73. <div style="padding-left: 80px" v-if="!disableStatus">
  74. <myUpload @uploadBack="uploadBack" :fileInfo="fileInfo" :fileList="fileInfo.fileList"></myUpload>
  75. </div>
  76. <div style="padding:0 20px 0 100px;margin-bottom: 20px;" v-if="disableStatus">
  77. <uploadDown :datalist="datalistback" :dialogStatus="uploadstatus"></uploadDown>
  78. </div>
  79. </el-form>
  80. <div slot="footer" class="dialog-footer">
  81. <el-button @click="dialogCli(1)">取 消</el-button>
  82. <el-button type="primary" @click="dialogCli(2)">确 定</el-button>
  83. </div>
  84. </el-dialog>
  85. </div>
  86. </template>
  87. <script>
  88. import mySearch from "../../../components/search.vue";
  89. import myUpload from '../../../components/upload'
  90. import uploadDown from '../../../components/uploadDown'
  91. export default {
  92. components: {
  93. mySearch,
  94. myUpload,
  95. uploadDown
  96. },
  97. data() {
  98. const terminalTypeName = (rule, value, callback) => {
  99. if (!this.infolist.tit) {
  100. callback(new Error('不能为空'))
  101. } else {
  102. callback()
  103. }
  104. }
  105. const brandName = (rule, value, callback) => {
  106. if (!this.infolist.num) {
  107. callback(new Error('不能为空'))
  108. } else {
  109. if (this.infolist.num > 10) {
  110. this.infolist.num = 10;
  111. }
  112. callback()
  113. }
  114. }
  115. const modelType = (rule, value, callback) => {
  116. if (!this.infolist.time) {
  117. callback(new Error('不能为空'))
  118. } else {
  119. callback()
  120. }
  121. }
  122. return {
  123. rules: {
  124. terminalTypeName: [{
  125. required: true,
  126. trigger: 'blur',
  127. validator: terminalTypeName
  128. }],
  129. brandName: [{
  130. required: true,
  131. trigger: 'blur',
  132. validator: brandName
  133. }],
  134. modelType: [{
  135. required: true,
  136. trigger: 'blur',
  137. validator: modelType
  138. }],
  139. },
  140. searchList: [{
  141. type: 'input',
  142. tit: '公告标题',
  143. value: '',
  144. width: '24%',
  145. },
  146. {
  147. type: 'date',
  148. tit: '开始时间',
  149. value: '',
  150. width: '24%',
  151. },
  152. {
  153. type: 'date',
  154. tit: '结束时间',
  155. value: '',
  156. width: '24%',
  157. },
  158. {
  159. type: 'sel',
  160. tit: '任务状态',
  161. value: '',
  162. width: '24%',
  163. options: [{
  164. dataCode: 1,
  165. dataName: '待回复',
  166. },
  167. {
  168. dataCode: 2,
  169. dataName: '已回复',
  170. }
  171. ],
  172. },
  173. ],
  174. fullscreen: false,
  175. total: 0,
  176. pageSize: 1,
  177. tableData: [{}],
  178. dialogStatus: false,
  179. disableStatus: false,
  180. titname: '终端',
  181. infolist: {},
  182. typeOptions: [{
  183. dataCode: 1,
  184. dataName: 111,
  185. }],
  186. userInfo: {},
  187. params: {},
  188. infoApply: [],
  189. fileInfo: {
  190. limit: 1,
  191. url: '/sysmgr/noticeatt/upload',
  192. fileList: []
  193. },
  194. datalist: {
  195. url: '/sysmgr/noticeatt/downfile',
  196. type: 2
  197. },
  198. datalistback: {
  199. url: '/sysmgr/noticeatt/downfile',
  200. type: 2
  201. },
  202. uploadstatus: false,
  203. visiblec:[]
  204. }
  205. },
  206. methods: {
  207. //搜索数据
  208. searchInfo(v) {
  209. this.params = {};
  210. v[0] ? this.params.terminalTypeName = v[0] : '';
  211. v[1] ? this.params.brandName = v[1] : '';
  212. v[2] ? this.params.modelType = v[2] : '';
  213. this.getList(this.params, this.pageSize);
  214. },
  215. //获取列表
  216. getList(v, n) {
  217. // this.pageSize = n;
  218. // let _this = this;
  219. // this.$http({
  220. // url: "/market/terminal/terminaltype/queryPage",
  221. // method: "post",
  222. // headers: {
  223. // "Content-Type": "application/json",
  224. // "page": '{"pageNo":"' + n + '","pageSize":"10"}'
  225. // },
  226. // data: v,
  227. // }).then((res) => {
  228. // this.tableData = res.data.data;
  229. // this.total = res.data.totalRecord;
  230. // for (let i = 0; i < this.tableData.length; i++) {
  231. // _this.tableData[i].opTime = _this.timeChange(_this.tableData[i].opTime);
  232. // }
  233. // });
  234. },
  235. // 分页
  236. currchange(v) {
  237. this.pageSize = v;
  238. this.getList(this.params, this.pageSize);
  239. },
  240. //申请
  241. dialogCheck(v,n) {
  242. this.dialogStatus = true;
  243. this.infolist = Object.assign({}, n);
  244. this.infolist.opNo = this.userInfo.loginNo;
  245. this.infolist.opName = this.userInfo.loginName;
  246. if (v === 1) {
  247. this.titname = '查看';
  248. this.disableStatus = true;
  249. return
  250. } else if (v === 2) {
  251. this.titname = '回复';
  252. this.disableStatus = false;
  253. }
  254. },
  255. //添加
  256. dialogCli(v) {
  257. if (v === 1) {
  258. this.infolist = {};
  259. this.dialogStatus = false;
  260. return
  261. }
  262. this.infolist.opTime = new Date().getTime();
  263. this.submitInfo("/market/terminal/terminaltypes/add");
  264. },
  265. submitInfo(u) {
  266. let _this = this;
  267. this.$refs.infolist.validate(valid => {
  268. if (valid) {
  269. this.$http({
  270. url: u,
  271. method: "post",
  272. headers: {
  273. "Content-Type": "application/json",
  274. },
  275. data: this.infolist,
  276. }).then((res) => {
  277. if (res.data.result === 1) {
  278. _this.$message({
  279. message: res.data.desc,
  280. type: 'error'
  281. });
  282. } else {
  283. _this.$message({
  284. message: '成功',
  285. type: 'success'
  286. });
  287. _this.infolist = {};
  288. _this.dialogStatus = false;
  289. _this.getList({}, _this.pageSize);
  290. }
  291. });
  292. }
  293. })
  294. },
  295. //删除
  296. delLine(v) {
  297. let _this = this;
  298. this.$confirm('即将删除此条数据, 是否删除?', '提示', {
  299. confirmButtonText: '确定',
  300. cancelButtonText: '取消',
  301. type: 'warning'
  302. }).then(() => {
  303. this.$http({
  304. url: "/market/terminal/terminaltype/del",
  305. method: "post",
  306. headers: {
  307. "Content-Type": "application/json",
  308. },
  309. data: {
  310. id: v.id
  311. },
  312. }).then((res) => {
  313. if (res.data.result === 1) {
  314. _this.$message({
  315. message: res.data.desc,
  316. type: 'error'
  317. });
  318. } else {
  319. _this.$message({
  320. message: '删除成功',
  321. type: 'success'
  322. });
  323. _this.getList(this.params, this.pageSize);
  324. }
  325. });
  326. })
  327. },
  328. //文件返回值
  329. uploadBack(v) {
  330. console.log(v)
  331. },
  332. //时间转换
  333. timeChange(v) {
  334. var time = new Date(v * 1);
  335. var y = time.getFullYear();
  336. var m = time.getMonth() + 1;
  337. m < 10 ? '0' + m : m;
  338. var d = time.getDate();
  339. d < 10 ? '0' + d : d;
  340. var h = time.getHours();
  341. h < 10 ? '0' + h : h;
  342. var mm = time.getMinutes();
  343. mm < 10 ? '0' + mm : mm;
  344. var s = time.getSeconds();
  345. s < 10 ? '0' + s : s;
  346. return y + '-' + m + '-' + d + ' ' + h + ':' + mm + ':' + s;
  347. },
  348. //功能栏
  349. iconCli(v) {
  350. if (v === 1) {
  351. this.getList(this.params, this.pageSize);
  352. }
  353. if (v === 2) {
  354. this.fullscreen = !this.fullscreen
  355. }
  356. },
  357. getUser() {
  358. this.userInfo = JSON.parse(window.sessionStorage.userInfo);
  359. this.infolist = {
  360. opNo: '',
  361. opName: '',
  362. };
  363. this.infolist.opNo = this.userInfo.loginNo;
  364. this.infolist.opName = this.userInfo.loginName;
  365. }
  366. },
  367. mounted() {
  368. this.getList({}, 1);
  369. this.getUser();
  370. },
  371. created() {
  372. }
  373. }
  374. </script>
  375. <style scoped lang="scss">
  376. .onetab {
  377. margin-bottom: 20px;
  378. padding: 0 20px;
  379. }
  380. .titbox {
  381. div {
  382. float: right;
  383. i {
  384. font-size: 22px;
  385. margin-left: 20px;
  386. cursor: pointer;
  387. }
  388. }
  389. }
  390. .tabbox {
  391. margin-top: 15px;
  392. }
  393. .pageBox {
  394. text-align: right;
  395. margin-top: 10px;
  396. }
  397. .info-line {
  398. width: 100%;
  399. display: block;
  400. padding-left: 20px;
  401. div {
  402. width: 50%;
  403. display: inline-block;
  404. }
  405. span {
  406. width: 80px;
  407. display: inline-block;
  408. text-align: left;
  409. i {
  410. color: red;
  411. display: inline-block;
  412. padding-right: 5px;
  413. }
  414. }
  415. .el-select,
  416. .el-input {
  417. width: calc(100% - 100px);
  418. }
  419. }
  420. .online {
  421. width: 100%;
  422. .el-select {
  423. width: calc(100% - 100px);
  424. }
  425. span {
  426. vertical-align: top;
  427. }
  428. .el-textarea {
  429. width: calc(100% - 100px);
  430. }
  431. }
  432. </style>