myAward.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. <template>
  2. <div>
  3. <FormBox :isShowHeader="false">
  4. <template #footer>
  5. <el-form ref="form" :inline="true" label-width="70PX">
  6. <el-form-item label="时间">
  7. <el-date-picker size="medium" v-model="month" :disabled="checked" type="month" :clearable="false" placeholder="请选择月份" value-format="yyyy-MM"></el-date-picker>
  8. </el-form-item>
  9. <el-form-item label="内容搜索">
  10. <el-input size="medium" v-model="keyword" clearable placeholder="内容搜索" maxlength="20"></el-input>
  11. </el-form-item>
  12. <el-form-item>
  13. <el-checkbox v-model="checked" border size="medium">查看所有累计奖票</el-checkbox>
  14. </el-form-item>
  15. </el-form>
  16. </template>
  17. </FormBox>
  18. <div class="all">
  19. <div>
  20. <el-table :data="list" style="width: 100%" v-loading="loading">
  21. <el-table-column prop="name" min-width="300" label="奖票事件">
  22. <template slot-scope="scope">
  23. <span>{{scope.row.remark.customize||scope.row.remark.rule}}</span>
  24. </template>
  25. </el-table-column>
  26. <el-table-column prop="ct" label="事件时间" width="100">
  27. <template slot-scope="scope">
  28. <span>{{$moment(scope.row.date+'').format("YYYY-MM-DD")}}</span>
  29. </template>
  30. </el-table-column>
  31. <el-table-column label="操作" align="right">
  32. <template slot-scope="scope">
  33. <el-link type="primary" :underline="false" @click="openDetail(scope.row)">查看详情</el-link>
  34. </template>
  35. </el-table-column>
  36. <template slot="empty">
  37. <noData></noData>
  38. </template>
  39. </el-table>
  40. <center style="padding: 20px 0;">
  41. <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"
  42. :page-sizes="[10, 20, 50, 100]" layout="total, sizes, prev, pager, next" :page-size="page_size" :total="total">
  43. </el-pagination>
  44. </center>
  45. </div>
  46. </div>
  47. <!-- 检查单详情 -->
  48. <BrawerBox :showDrawer.sync="isShowDetail" drawerTitle="奖票详情">
  49. <template slot="main">
  50. <div>
  51. <div class="flex-box-v">
  52. <div class="message-box">
  53. <div class="flex-box-ce">
  54. <div class="fontColorC">奖票对象</div>
  55. <div class="flex-1">{{detail.employee_name}}</div>
  56. </div>
  57. <div class="flex-box-ce">
  58. <div class="fontColorC">事件时间</div>
  59. <div class="flex-1">{{$moment(detail.date+'').format("YYYY-MM-DD")}}</div>
  60. </div>
  61. <div class="flex-box-ce">
  62. <div class="fontColorC">发放人</div>
  63. <div class="flex-1">{{detail.publisher_name||'--'}}</div>
  64. </div>
  65. <div class="flex-box-ce">
  66. <div class="fontColorC">发放时间</div>
  67. <div class="flex-1">{{detail.ct}}</div>
  68. </div>
  69. <div class="flex-box-ce">
  70. <div class="fontColorC">奖票事件</div>
  71. <div class="flex-1">{{detail.remark.customize||detail.remark.rule}}</div>
  72. </div>
  73. </div>
  74. </div>
  75. <div class="message-box" v-if="detail.event">
  76. <div style="font-size: 16px;margin-bottom: 20px;">对应积分事件</div>
  77. <div class="flex-box" @click="open_detail()" style="cursor: pointer;background-color: rgb(248, 252, 255);margin-bottom: 14px;position: relative;padding: 8px;border-radius: 5px;">
  78. <div class="flex-1" style="padding-right: 20px;">
  79. {{detail.event.remark.customize||detail.event.remark.rule}}
  80. </div>
  81. <div class="red" v-if="detail.event.point>0">+{{detail.event.point}} {{detail.event.pt_id==3? 'B分':'A分'}}</div>
  82. <div class="green" v-else>{{detail.event.point}} {{detail.event.pt_id==3? 'B分':'A分'}}</div>
  83. </div>
  84. </div>
  85. </div>
  86. </template>
  87. <template slot="footer">
  88. <el-button type="danger" plain @click="deleteItem" v-if="detail.publisher_id==$getUserData().id||($supremeAuthority()!='dept_manager'&&$supremeAuthority()!='employee')">{{detail.publisher_id==$getUserData().id ?'撤回奖票':'删除奖票'}}</el-button>
  89. <div class="flex-1"></div>
  90. <el-button plain @click="isShowDetail=false">关 闭</el-button>
  91. </template>
  92. </BrawerBox>
  93. <el-drawer title="事件详情" :visible.sync="detail_popup" ref="drawer" :with-header="false" :width="'500px'" direction="rtl">
  94. <div class="drawer_title flex-box-ce">
  95. <span class="flex-1">事件详情</span>
  96. <i @click="detail_popup=false" style="cursor: pointer;" class="el-icon-close"></i>
  97. </div>
  98. <div class="detail_popup" v-loading="detail_loading" v-if="detail_info !== null">
  99. <el-row style="padding-bottom:10px;border-bottom:1px #f8f8f8 solid;">
  100. <div class="flex-box flex-v-ce">
  101. <userImage :user_name="detail_info.employee_name" :img_url="detail_info.img_url" width="50px" height="50px" fontSize="1"></userImage>
  102. <span style="font-size: 18px;line-height:50px; margin-left:10px;margin-right:4px;">{{ detail_info.employee_name }}</span>
  103. <span class="red point" v-if="detail_info.point >= 0">+{{ detail_info.point }} {{ point_name(detail_info.pt_id) }}</span>
  104. <span class="green point" v-if="detail_info.point < 0">{{ detail_info.point }} {{ point_name(detail_info.pt_id) }}</span>
  105. </div>
  106. </el-row>
  107. <el-row >
  108. <el-col :span="6">事件内容</el-col>
  109. <el-col :span="18" v-if="detail_info.remark">{{ detail_info.remark && (detail_info.remark.customize || detail_info.remark.rule) }}</el-col>
  110. </el-row>
  111. <el-row v-show="detail_info.files && detail_info.files.length > 0">
  112. <el-col :span="18" :offset="6">
  113. <el-image
  114. v-for="(itme, index) in detail_info.files"
  115. :key="index"
  116. style="width: 80px; height: 80px;margin: 0 5px;"
  117. :src="itme"
  118. :preview-src-list="detail_info.files"
  119. ></el-image>
  120. </el-col>
  121. </el-row>
  122. <el-row v-show="detail_info.rule_list">
  123. <el-col :span="6">规则分类</el-col>
  124. <el-col :span="18">{{ detail_info.rule_list }}</el-col>
  125. </el-row>
  126. <el-row v-show="detail_info.source_type_mark">
  127. <el-col :span="6">来源类型</el-col>
  128. <el-col :span="18">{{ detail_info.source_type_mark }}</el-col>
  129. </el-row>
  130. <el-row v-show="detail_info.recorder_name">
  131. <el-col :span="6">记录人</el-col>
  132. <el-col :span="18">{{ detail_info.recorder_name }}</el-col>
  133. </el-row>
  134. <el-row v-show="detail_info.date">
  135. <el-col :span="6">事件时间</el-col>
  136. <el-col :span="18">{{ detail_info.date }}</el-col>
  137. </el-row>
  138. <el-row v-show="detail_info.complete_task.time">
  139. <el-col :span="6">完成时间</el-col>
  140. <el-col :span="18">{{ detail_info.complete_task.time }}</el-col>
  141. </el-row>
  142. <el-row v-show="detail_info.complete_task.remark">
  143. <el-col :span="6">完成备注</el-col>
  144. <el-col :span="18">{{ detail_info.complete_task.remark }}</el-col>
  145. </el-row>
  146. <el-row v-show="detail_info.complete_task && detail_info.complete_task.files && detail_info.complete_task.files.length > 0">
  147. <el-col :span="18" :offset="6">
  148. <el-image
  149. v-for="(itme, index) in detail_info.complete_task.files"
  150. :key="index"
  151. style="width: 80px; height: 80px;margin: 0 5px;"
  152. :src="itme"
  153. :preview-src-list="detail_info.complete_task.files"
  154. ></el-image>
  155. </el-col>
  156. </el-row>
  157. <div v-show="detail_info.rule_id">
  158. <p class="row_title">规则依据</p>
  159. <el-row>
  160. <el-col :span="6">规则分类</el-col>
  161. <el-col :span="18">{{ detail_info.rule_list }}</el-col>
  162. </el-row>
  163. <el-row v-show="detail_info.remark.rule">
  164. <el-col :span="6">积分规则</el-col>
  165. <el-col :span="18">{{ detail_info.remark.rule }}</el-col>
  166. </el-row>
  167. <el-row>
  168. <el-col :span="6">积分</el-col>
  169. <el-col :span="18" v-show="detail_info.rule_item.min_point == detail_info.rule_item.max_point">{{ detail_info.rule_item.min_point }} {{ point_name(detail_info.pt_id) }}</el-col>
  170. <el-col :span="18" v-show="detail_info.rule_item.min_point != detail_info.rule_item.max_point">
  171. {{ detail_info.rule_item.min_point }} ~ {{ detail_info.rule_item.max_point }} {{ point_name(detail_info.pt_id) }}
  172. </el-col>
  173. </el-row>
  174. </div>
  175. <div v-show="detail_info.process"><Steps :process="detail_info.process"></Steps></div>
  176. <div v-show="detail_info.dc_remark.flow"><Review :process="detail_info.dc_remark.flow" :status="detail_info.dc_status"></Review></div>
  177. </div>
  178. <div style="position: absolute; bottom: 20px;right: 20px;left: 20px;" class="flex-box-ce">
  179. <!-- <el-button type="primary" v-if="!detail_info.has_ticket" @click="deleteInBatches({id:detail_info.event_id},true)">发放奖票</el-button>
  180. <el-button type="primary" v-else @click="openDetail({id:detail_info.event_id})">查看奖票</el-button> -->
  181. <div class="flex-1"></div>
  182. <el-button @click="detail_popup=false">取消</el-button>
  183. </div>
  184. </el-drawer>
  185. </div>
  186. </template>
  187. <script>
  188. import {_debounce} from '@/api/auth';
  189. import Steps from '@/components/Steps';
  190. import Review from '@/components/Review';
  191. import toLead from '@/components/toLead';
  192. export default {
  193. components:{Steps,Review,toLead},
  194. data() {
  195. return {
  196. checked:false,
  197. loading: false,
  198. list: null,
  199. month: this.$moment().format("YYYY-MM"),
  200. page:1,
  201. page_size:10,
  202. total: 0,
  203. keyword:'',
  204. //部门
  205. dept_name: [],
  206. dept_tree: [],
  207. isShowDetail:false,
  208. detail:{remark:{},event:{remark:{}},date:''},
  209. selectItem:{},
  210. detail_info: {complete_task:{},remark:{},rule_item:{},dc_remark:{},pt_id:3},
  211. detail_popup: false,
  212. detail_loading: false,
  213. };
  214. },
  215. watch: {
  216. 'keyword': {
  217. deep: true,
  218. handler: _debounce(function(val) {
  219. this.getUserAwardList();
  220. },1000)
  221. },
  222. month(val, old_val) {
  223. this.getUserAwardList();
  224. },
  225. checked(){
  226. this.getUserAwardList();
  227. }
  228. },
  229. mounted() {
  230. this.getUserAwardList();
  231. },
  232. methods: {
  233. point_name(id) {
  234. let point_types=this.$getTyps();
  235. return point_types.find(item => {
  236. if (item.id == id) {
  237. return item.name;
  238. }
  239. }).name;
  240. },
  241. open_detail() {
  242. this.detail_popup = true;
  243. let data = {event_id:this.detail.event_id};
  244. this.detail_loading = true;
  245. this.$axios('get', '/api/integral/statistics/integral/info',data).then(res => {
  246. this.detail_info = res.data.data;
  247. }).finally(() => {
  248. this.detail_loading = false;
  249. });
  250. },
  251. deleteItem(){
  252. this.$confirm(`确定${this.detail.publisher_id==this.$getUserData().id? '撤回':'删除'}此奖票?`, '提示', {
  253. confirmButtonText: '确定',
  254. cancelButtonText: '取消',
  255. type: 'warning'
  256. }).then(() => {
  257. this.$axios("post", "/api/integral/ticket/del",{id:this.detail.id}).then(res => {
  258. this.$message.success(this.detail.publisher_id==this.$getUserData().id? "已撤回":'已删除');
  259. this.getUserAwardList(true);
  260. this.isShowDetail=false;
  261. })
  262. }).catch(() => {});
  263. },
  264. openDetail(item){
  265. this.$axios("get", "/api/integral/ticket/info",{id:item.id}).then(res => {
  266. this.detail=res.data.data;
  267. this.isShowDetail=true;
  268. })
  269. },
  270. getUserAwardList(is){
  271. this.loading2 = true;
  272. !is? this.page=1:'';
  273. let formData={
  274. page: this.page,
  275. page_size: this.page_size,
  276. employee_id:this.$getUserData().id,
  277. keyword:this.keyword,
  278. }
  279. if(this.checked){
  280. formData.start_date="2010-01-01";
  281. formData.end_date=this.$moment().format('YYYY-MM-DD')
  282. }else{
  283. formData.month=this.month
  284. }
  285. this.$axios("get", "/api/integral/ticket", formData,'v2').then(res => {
  286. this.list = res.data.data.list;
  287. this.total = res.data.data.total;
  288. }).finally(() => {
  289. this.loading2 = false;
  290. });
  291. },
  292. // 页面变更
  293. handleCurrentChange(val) {
  294. this.page = val;
  295. this.getUserAwardList(true);
  296. },
  297. // 页面跳转
  298. handleSizeChange(val) {
  299. this.page_size = val;
  300. this.getUserAwardList();
  301. },
  302. }
  303. };
  304. </script>
  305. <style scoped lang="scss">
  306. .all{
  307. margin-top:10px;
  308. padding:10px 20px 0px 20px;
  309. min-height: calc(100vh - 204px);
  310. }
  311. .drawer_title {
  312. font-size: 18px;
  313. padding: 20px;
  314. border-bottom: 1px #efefef solid;
  315. }
  316. .detail_popup {
  317. padding: 20px;
  318. height: calc(100vh - 140px);
  319. overflow: auto;
  320. padding-bottom: 100px;
  321. .row_title {
  322. position: relative;
  323. margin: 0 0 20px 0;
  324. padding-top: 12px;
  325. font-size: 16px;
  326. color: #303133;
  327. line-height: 22px;
  328. }
  329. .row_title:before {
  330. position: absolute;
  331. top: 0;
  332. content: ' ';
  333. width: 100%;
  334. border-top: 1px #f8f8f8 solid;
  335. }
  336. .el-row {
  337. margin-bottom: 10px;
  338. font-size: 14px;
  339. .el-col-4 {
  340. color: #606266;
  341. }
  342. }
  343. }
  344. .message-box .label{
  345. font-size: 18px;
  346. font-weight: 600;
  347. margin-bottom: 20px;
  348. }
  349. .message-box .flex-box-ce{
  350. margin-bottom:16px ;
  351. }
  352. .message-box .fontColorC{
  353. width: 100px;
  354. }
  355. .el-date-editor.el-input {
  356. width: auto;
  357. }
  358. .date-picker-width {
  359. width: 145px !important;
  360. }
  361. .search{
  362. margin: 0 10px;
  363. }
  364. .search ::v-deep .el-input-group__append{
  365. background: #FFF;
  366. }
  367. .search ::v-deep .el-input-group__append:active {
  368. background: #26a2ff;
  369. }
  370. .search ::v-deep .el-input-group__append:active .el-icon-search {
  371. color: #fff;
  372. }
  373. .el-checkbox.is-bordered.el-checkbox--medium {
  374. padding: 9px 20px 7px 10px;
  375. }
  376. </style>