79d9e7dec635e7e96fb356bda4dfe2a2b48100a7.svn-base 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. <template>
  2. <div class="index-container-ty">
  3. <a-spin :spinning="loading">
  4. <a-row type="flex" justify="start" :gutter="3">
  5. <a-col :sm="24" :lg="12">
  6. <a-card>
  7. <div slot="title" class="index-md-title">
  8. <img src="../../assets/daiban.png"/>
  9. 我的待办【{{ dataSource1.length }}】
  10. </div>
  11. <div slot="extra">
  12. <a v-if="dataSource1 && dataSource1.length>0" slot="footer" @click="goPage">更多 <a-icon type="double-right" /></a>
  13. </div>
  14. <a-table
  15. :class="'my-index-table tytable1'"
  16. ref="table1"
  17. size="small"
  18. rowKey="id"
  19. :columns="columns"
  20. :dataSource="dataSource1"
  21. :pagination="false">
  22. <template slot="ellipsisText" slot-scope="text">
  23. <j-ellipsis :value="text" :length="textMaxLength"></j-ellipsis>
  24. </template>
  25. <template slot="dayWarnning" slot-scope="text,record">
  26. <a-icon type="bulb" theme="twoTone" style="font-size:22px" :twoToneColor="getTipColor(record)"/>
  27. </template>
  28. <span slot="action" slot-scope="text, record">
  29. <a @click="handleData">办理</a>
  30. </span>
  31. </a-table>
  32. </a-card>
  33. </a-col>
  34. <a-col :sm="24" :lg="12">
  35. <a-card>
  36. <div slot="title" class="index-md-title">
  37. <img src="../../assets/zaiban.png"/>
  38. 我的在办【{{ dataSource2.length }}】
  39. </div>
  40. <div slot="extra">
  41. <a v-if="dataSource2 && dataSource2.length>0" slot="footer" @click="goPage">更多 <a-icon type="double-right" /></a>
  42. </div>
  43. <a-table
  44. :class="'my-index-table tytable2'"
  45. ref="table2"
  46. size="small"
  47. rowKey="id"
  48. :columns="columns"
  49. :dataSource="dataSource2"
  50. :pagination="false">
  51. <template slot="ellipsisText" slot-scope="text">
  52. <j-ellipsis :value="text" :length="textMaxLength"></j-ellipsis>
  53. </template>
  54. <template slot="dayWarnning" slot-scope="text,record">
  55. <a-icon type="bulb" theme="twoTone" style="font-size:22px" :twoToneColor="getTipColor(record)"/>
  56. </template>
  57. <span slot="action" slot-scope="text, record">
  58. <a @click="handleData">办理</a>
  59. </span>
  60. </a-table>
  61. </a-card>
  62. </a-col>
  63. <a-col :span="24">
  64. <div style="height: 5px;"></div>
  65. </a-col>
  66. <a-col :sm="24" :lg="12">
  67. <a-card>
  68. <div slot="title" class="index-md-title">
  69. <img src="../../assets/guaz.png"/>
  70. 我的挂账【{{ dataSource4.length }}】
  71. </div>
  72. <a-table
  73. :class="'my-index-table tytable4'"
  74. ref="table4"
  75. size="small"
  76. rowKey="id"
  77. :columns="columns"
  78. :dataSource="dataSource4"
  79. :pagination="false">
  80. <template slot="ellipsisText" slot-scope="text">
  81. <j-ellipsis :value="text" :length="textMaxLength"></j-ellipsis>
  82. </template>
  83. <template slot="dayWarnning" slot-scope="text,record">
  84. <a-icon type="bulb" theme="twoTone" style="font-size:22px" :twoToneColor="getTipColor(record)"/>
  85. </template>
  86. <span slot="action" slot-scope="text, record">
  87. <a @click="handleData">办理</a>
  88. </span>
  89. </a-table>
  90. </a-card>
  91. </a-col>
  92. <a-col :sm="24" :lg="12">
  93. <a-card>
  94. <div slot="title" class="index-md-title">
  95. <img src="../../assets/duban.png"/>
  96. 我的督办【{{ dataSource3.length }}】
  97. </div>
  98. <a-table
  99. :class="'my-index-table tytable3'"
  100. ref="table3"
  101. size="small"
  102. rowKey="id"
  103. :columns="columns"
  104. :dataSource="dataSource3"
  105. :pagination="false">
  106. <template slot="ellipsisText" slot-scope="text">
  107. <j-ellipsis :value="text" :length="textMaxLength"></j-ellipsis>
  108. </template>
  109. <template slot="dayWarnning" slot-scope="text,record">
  110. <a-icon type="bulb" theme="twoTone" style="font-size:22px" :twoToneColor="getTipColor(record)"/>
  111. </template>
  112. <span slot="action" slot-scope="text, record">
  113. <a @click="handleData">办理</a>
  114. </span>
  115. </a-table>
  116. </a-card>
  117. </a-col>
  118. </a-row>
  119. </a-spin>
  120. </div>
  121. </template>
  122. <script>
  123. import noDataPng from '@/assets/nodata.png'
  124. import JEllipsis from '@/components/jeecg/JEllipsis'
  125. const tempSs1=[{
  126. id:"001",
  127. orderNo:"电[1]1267102",
  128. orderTitle:"药品出问题了",
  129. restDay:1
  130. },{
  131. id:"002",
  132. orderNo:"电[4]5967102",
  133. orderTitle:"吃了xxx医院的药,病情越来越严重",
  134. restDay:0
  135. },{
  136. id:"003",
  137. orderNo:"电[3]5988987",
  138. orderTitle:"今天去超市买鸡蛋,鸡蛋都是坏的",
  139. restDay:7
  140. },{
  141. id:"004",
  142. orderNo:"电[2]5213491",
  143. orderTitle:"xx宝实体店高价售卖xx",
  144. restDay:5
  145. },{
  146. id:"005",
  147. orderNo:"电[1]1603491",
  148. orderTitle:"以红利相诱,答应退保后扣一年费用",
  149. restDay:0
  150. }]
  151. const tempSs2=[{
  152. id:"001",
  153. orderTitle:"我要投诉这个大超市",
  154. orderNo:"电[1]10299456",
  155. restDay:6
  156. },{
  157. id:"002",
  158. orderTitle:"xxx医院乱开药方,售卖假药",
  159. orderNo:"电[2]20235691",
  160. restDay:0
  161. },{
  162. id:"003",
  163. orderTitle:"我想问问这家店是干啥的",
  164. orderNo:"电[3]495867322",
  165. restDay:7
  166. },{
  167. id:"004",
  168. orderTitle:"我要举报朝阳区奥森公园酒店",
  169. orderNo:"电[2]1193849",
  170. restDay:3
  171. },{
  172. id:"005",
  173. orderTitle:"我今天吃饭吃到一个石头子",
  174. orderNo:"电[4]56782344",
  175. restDay:9
  176. }]
  177. //4-7天
  178. const tip_green = "rgba(0, 255, 0, 1)"
  179. //1-3天
  180. const tip_yellow = "rgba(255, 255, 0, 1)"
  181. //超期
  182. const tip_red = "rgba(255, 0, 0, 1)"
  183. export default {
  184. name: "IndexTask",
  185. components:{ JEllipsis },
  186. data() {
  187. return {
  188. loading:false,
  189. textMaxLength:8,
  190. dataSource1:[],
  191. dataSource2:[],
  192. dataSource3:[],
  193. dataSource4:[],
  194. columns: [
  195. {
  196. title: '',
  197. dataIndex: '',
  198. key:'rowIndex',
  199. width:50,
  200. fixed:'left',
  201. align:"center",
  202. scopedSlots: {customRender: "dayWarnning"}
  203. },
  204. {
  205. title:'剩余天数',
  206. align:"center",
  207. dataIndex: 'restDay',
  208. width:80
  209. },
  210. {
  211. title:'工单标题',
  212. align:"center",
  213. dataIndex: 'orderTitle',
  214. scopedSlots: {customRender: "ellipsisText"}
  215. },
  216. {
  217. title:'工单编号',
  218. align:"center",
  219. dataIndex: 'orderNo',
  220. },
  221. {
  222. title: '操作',
  223. dataIndex: 'action',
  224. align:"center",
  225. scopedSlots: { customRender: 'action' }
  226. }
  227. ]
  228. }
  229. },
  230. created() {
  231. this.mock();
  232. },
  233. mounted(){
  234. },
  235. methods: {
  236. getTipColor(rd){
  237. let num = rd.restDay
  238. if(num<=0){
  239. return tip_red
  240. }else if(num>=1 && num<4){
  241. return tip_yellow
  242. }else if(num>=4){
  243. return tip_green
  244. }
  245. },
  246. goPage(){
  247. this.$message.success("请根据具体业务跳转页面")
  248. //this.$router.push({ path: '/comp/mytask' })
  249. },
  250. mock(){
  251. this.dataSource1=tempSs1
  252. this.dataSource2=tempSs2
  253. this.dataSource3=tempSs1
  254. this.dataSource4=[]
  255. this.ifNullDataSource(this.dataSource4,'.tytable4')
  256. },
  257. ifNullDataSource(ds,tb){
  258. this.$nextTick(()=>{
  259. if(!ds || ds.length==0){
  260. var tmp = document.createElement('img');
  261. tmp.src=noDataPng
  262. tmp.width=300
  263. let tbclass=`${tb} .ant-table-placeholder`
  264. document.querySelector(tbclass).innerHTML=""
  265. document.querySelector(tbclass).appendChild(tmp)
  266. }
  267. })
  268. },
  269. handleData(){
  270. this.$message.success("办理完成")
  271. }
  272. }
  273. }
  274. </script>
  275. <style>
  276. .my-index-table{height:270px}
  277. .my-index-table table{font-size: 14px !important;}
  278. .index-container-ty .ant-card-head-title{padding-top: 6px;padding-bottom: 6px;}
  279. .index-container-ty .ant-card-extra{padding:0}
  280. .index-container-ty .ant-card-extra a{color:#fff}
  281. .index-container-ty .ant-card-extra a:hover{color:#152ede}
  282. .index-container-ty .ant-card-head-wrapper,.index-container-ty .ant-card-head{
  283. line-height:24px;
  284. min-height:24px;
  285. /*background: #90aeff;*/
  286. background: #7196fb;
  287. }
  288. .index-container-ty .ant-card-body{padding: 10px 12px 0px 12px}
  289. /* .index-container-ty .ant-card-actions{background: #fff}
  290. .index-container-ty .ant-card-actions li {margin:2px 0;}
  291. .index-container-ty .ant-card-actions > li > span{width: 100%}*/
  292. .index-container-ty .ant-table-footer{text-align: right;padding:6px 12px 6px 6px;background: #fff;border-top: 2px solid #f7f1f1;}
  293. .index-md-title{
  294. postion:relative;
  295. padding-left:24px;
  296. width: 100%;
  297. color: #fff;
  298. font-size: 21px;
  299. font-family: cursive;
  300. }
  301. .index-md-title img{
  302. position: absolute;
  303. height:32px;
  304. top: 2px;
  305. left:14px;
  306. }
  307. .index-container-ty .ant-card-body{
  308. /*border-left:1px solid #90aeff;
  309. /*border-right:1px solid #90aeff;
  310. border-bottom:1px solid #90aeff;*/
  311. }
  312. .index-container-ty .ant-table-thead > tr > th,
  313. .index-container-ty .ant-table-tbody > tr > td{
  314. border-bottom: 1px solid #90aeff;
  315. }
  316. .index-container-ty .ant-table-small > .ant-table-content > .ant-table-fixed-left > .ant-table-body-outer > .ant-table-body-inner > table > .ant-table-thead > tr > th,
  317. .index-container-ty .ant-table-small > .ant-table-content > .ant-table-fixed-right > .ant-table-body-outer > .ant-table-body-inner > table > .ant-table-thead > tr > th{
  318. border-bottom: 1px solid #90aeff;
  319. }
  320. .index-container-ty .ant-table-small > .ant-table-content > .ant-table-scroll > .ant-table-body > table > .ant-table-thead > tr > th{
  321. border-bottom: 1px solid #90aeff;
  322. }
  323. .index-container-ty .ant-table-small{
  324. border: 1px solid #90aeff;
  325. }
  326. .index-container-ty .ant-table-placeholder {
  327. padding: 0
  328. }
  329. </style>