conversion.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. <template>
  2. <div>
  3. <div class="all" style="padding: 20px;">
  4. <FormBox>
  5. <div class="form-item">
  6. <div class="form-label">发放时间</div>
  7. <div class="form-search">
  8. <el-date-picker size="medium" style="width:290px" class="first-element-btn" :clearable="false"
  9. v-model="time_range" type="daterange" value-format="yyyy-MM-dd" range-separator="至"
  10. start-placeholder="开始日期" end-placeholder="结束日期"
  11. :picker-options="instantPickerOptions"></el-date-picker>
  12. </div>
  13. </div>
  14. <div class="form-item">
  15. <div class="form-label">姓名搜索</div>
  16. <div class="form-search">
  17. <el-select v-model="formData.employee_id" size="medium" filterable placeholder="请输入或选择人员" clearable>
  18. <el-option v-for="item in employee_map" :key="item.id" :label="item.name" :value="item.id"></el-option>
  19. </el-select>
  20. </div>
  21. </div>
  22. <div class="form-item">
  23. <div class="form-label">发放状态</div>
  24. <div class="form-search">
  25. <el-select v-model="formData.status" size="medium" placeholder="请选择" clearable>
  26. <el-option v-for="(item, index) in event_type" :key="index" :label="item.name" :value="item.id"></el-option>
  27. </el-select>
  28. </div>
  29. </div>
  30. <div class="form-item">
  31. <div class="form-label">兑换码</div>
  32. <div class="form-search">
  33. <el-input placeholder="请输入兑换码" size="medium" v-model="formData.sn" clearable></el-input>
  34. </div>
  35. </div>
  36. </FormBox>
  37. <div style="margin: 10px 0;">
  38. <el-button type="primary" size="medium" plain @click="grants"
  39. style="margin-right: 10px;">批量发放</el-button>
  40. <el-button type="primary" size="medium" plain @click="exportExcel">导出</el-button>
  41. </div>
  42. <el-table :data="list" style="width: 100%;cursor: pointer;" v-loading="loading" @row-click="openDetail"
  43. @selection-change="handleSelectionChange">
  44. <el-table-column type="selection" :selectable="selectable"></el-table-column>
  45. <el-table-column label="姓名" align="left">
  46. <template slot-scope="scope">
  47. <div style="display:flex;">
  48. <userImage :user_name="scope.row.employee.name" :id="scope.row.employee.id" width="50px"
  49. height="50px"></userImage>
  50. <span style="line-height: 50px; padding-left: 10px;">{{ scope.row.employee.name }}</span>
  51. </div>
  52. </template>
  53. </el-table-column>
  54. <el-table-column prop="goods_name" label="奖品名称" align="center"></el-table-column>
  55. <el-table-column prop="num" label="数量" align="center"></el-table-column>
  56. <el-table-column prop="total_price" label="总价" align="center"></el-table-column>
  57. <el-table-column prop="create_time" label="兑换时间" align="center">
  58. <template slot-scope="scope">
  59. {{ $moment.unix(scope.row.create_time).format('YYYY-MM-DD HH:mm:ss') }}
  60. </template>
  61. </el-table-column>
  62. <el-table-column prop="sn" label="兑换码" align="center" min-width="140"></el-table-column>
  63. <el-table-column prop="complete_time" label="发放时间" align="center">
  64. <template slot-scope="scope">
  65. <span
  66. v-if="scope.row.complete_time">{{ $moment.unix(scope.row.complete_time).format('YYYY-MM-DD HH:mm:ss') }}</span>
  67. <span v-else>--</span>
  68. </template>
  69. </el-table-column>
  70. <el-table-column prop="status" label="状态" align="center">
  71. <template slot-scope="scope">
  72. <span v-if="scope.row.status == 0" class="fontColorD">未发放</span>
  73. <span v-if="scope.row.status == 1" class="green">已发放</span>
  74. <span v-if="scope.row.status == 2" class="red">已取消</span>
  75. </template>
  76. </el-table-column>
  77. <el-table-column prop="point" label="操作" align="left">
  78. <template slot="header" slot-scope="scope">
  79. <el-tooltip effect="dark" placement="top-start">
  80. <div slot="content">
  81. <div style="margin-bottom: 10px;">7日内可执行撤销操作</div>
  82. </div>
  83. <span>
  84. <span>操作</span>
  85. <i class="el-icon-warning"></i>
  86. </span>
  87. </el-tooltip>
  88. </template>
  89. <template slot-scope="scope">
  90. <el-link type="primary" :underline="false" @click.stop="grant(scope.row.id)"
  91. v-if="scope.row.status == 0" style="padding-right: 10px;">发放</el-link>
  92. <el-link type="primary" :underline="false" @click.stop="revoke(scope.row.id)"
  93. v-if="scope.row.status == 1" style="padding-right: 10px;">撤销</el-link>
  94. <el-link type="primary" :underline="false" @click.stop="cancel(scope.row.id)"
  95. v-if="scope.row.status == 0" style="padding-right: 10px;">取消</el-link>
  96. <el-link type="primary" :underline="false">查看明细</el-link>
  97. </template>
  98. </el-table-column>
  99. <template slot="empty">
  100. <noData></noData>
  101. </template>
  102. </el-table>
  103. <center style="padding: 20px 0;">
  104. <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
  105. :current-page="formData.page" :page-sizes="[10, 20, 50, 100]"
  106. layout="total, sizes, prev, pager, next" :page-size="pageLimit" :total="total"></el-pagination>
  107. </center>
  108. </div>
  109. <el-dialog title="发放结果" :visible.sync="isResult" width="600" :close-on-click-modal="false"
  110. :close-on-press-escape="false" :show-close="false">
  111. <div v-if="!isShowError">
  112. <div style="text-align: center;margin-bottom: 10px;" class="red" v-if="isShowError2">{{ errorMsg }}
  113. </div>
  114. <el-progress :text-inside="true" :stroke-width="24" :percentage="percentage"></el-progress>
  115. <div style="margin-top: 20px;border: 1px solid #f1f1f1;max-height: 500px;overflow-y: auto;"
  116. class="scroll-bar">
  117. <div class="flex-box-ce results" style="font-weight: 600;">
  118. <div style="border-right: 1px solid #f1f1f1;width: 50px;">序号</div>
  119. <div class="flex-1" style="border-right: 1px solid #f1f1f1;">姓名</div>
  120. <div class="flex-2">提交结果</div>
  121. </div>
  122. <div class="flex-box-ce results" v-for="(item, index) in results" :key="index">
  123. <div style="border-right: 1px solid #f1f1f1;width: 50px;">{{ results.length - index }}</div>
  124. <div class="flex-1" style="border-right: 1px solid #f1f1f1;">{{ item.source_msg.name }}</div>
  125. <div class="flex-2 green" v-if="item.status == 1">{{ item.msg }}</div>
  126. <div class="flex-2 red" v-else>{{ item.msg }}</div>
  127. </div>
  128. </div>
  129. <span slot="footer">
  130. <div class="flex-box-end" style="margin-top: 20px;"
  131. v-show="isShowError2 && results.length != resultList.length">
  132. <el-button type="primary" @click="isResult = false" size="small">确 定</el-button>
  133. </div>
  134. <div class="flex-box-end" style="margin-top: 20px;" v-show="results.length == resultList.length">
  135. <el-button type="primary" @click="isResult = false" size="small">确 定</el-button>
  136. </div>
  137. </span>
  138. </div>
  139. <div v-else>
  140. <div style="text-align: center;" class="red">{{ errorMsg }}</div>
  141. <span slot="footer">
  142. <div class="flex-box-end" style="margin-top: 20px;"><el-button type="primary"
  143. @click="isResult = false" size="small">确 定</el-button></div>
  144. </span>
  145. </div>
  146. </el-dialog>
  147. <!-- 缓存的奖扣 -->
  148. <el-dialog title="网络中断发放对象列表" :visible.sync="isShowBreak" width="800" :close-on-click-modal="false"
  149. :close-on-press-escape="false" :show-close="false">
  150. <div>
  151. <div style="margin-top: 20px;border: 1px solid #f1f1f1;max-height: 500px;overflow-y: auto;"
  152. class="scroll-bar">
  153. <div class="flex-box-ce results" style="font-weight: 600;">
  154. <div style="border-right: 1px solid #f1f1f1;width: 50px;">序号</div>
  155. <div class="flex-1" style="border-right: 1px solid #f1f1f1;">姓名</div>
  156. </div>
  157. <div class="flex-box-ce results" v-for="(item, index) in breakList" :key="index">
  158. <div style="border-right: 1px solid #f1f1f1;width: 50px;">{{ index + 1 }}</div>
  159. <div class="flex-1" style="border-right: 1px solid #f1f1f1;">{{ item.name }}</div>
  160. </div>
  161. </div>
  162. <span slot="footer">
  163. <div class="flex-box-end" style="margin-top: 20px;">
  164. <el-button type="primary" @click="colseBreak()" size="small">取 消</el-button>
  165. <el-button type="primary" @click="submitBreak()" size="small">再次提交</el-button>
  166. </div>
  167. </span>
  168. </div>
  169. </el-dialog>
  170. <!-- 取消 -->
  171. <el-dialog title="取消兑换" :visible.sync="isCancel" width="500px">
  172. <div style="margin: 10px 0;">
  173. <el-form ref="addTypeName" :model="addTypeName" label-width="85px" @submit.native.prevent>
  174. <el-form-item label="取消原因"
  175. :rules="[{ required: true, message: '取消原因不能为空' }, { min: 2, max: 200, message: '长度在 2 到 200 个字符', trigger: 'blur' }]"
  176. prop="remark">
  177. <el-input v-model="addTypeName.remark" type="textarea" placeholder="请输入取消原因" :rows="5"
  178. maxlength="200" show-word-limit></el-input>
  179. </el-form-item>
  180. </el-form>
  181. <span class="dialog-footer" style="display:flex;justify-content: flex-end;">
  182. <el-button @click="isCancel = false">取 消</el-button>
  183. <el-button type="primary" @click="subGroupForm('addTypeName')">确 定</el-button>
  184. </span>
  185. </div>
  186. </el-dialog>
  187. <!-- 详情 -->
  188. <el-dialog title="兑换详情" :visible.sync="isDetail" width="600px">
  189. <div style="margin: 10px 0;" v-loading="attendload">
  190. <div class="flex-box-ce">
  191. <div class="flex-box-ce flex-1">
  192. <userImage :user_name="detailData.employee.name" :id="detailData.employee.id" width="50px"
  193. height="50px" fontSize="1"></userImage>
  194. <div style="margin-left:10px;margin-right:4px;">
  195. <div style="font-size: 16px;font-weight: 700;">{{ detailData.employee.name }}</div>
  196. <div v-if="detailData.employee.employee_detail">
  197. <span v-for="(item, index) in detailData.employee.employee_detail.dept_list"
  198. :key="index">
  199. {{ item.dept_name }}
  200. <span
  201. v-if="detailData.employee.employee_detail.dept_list.length - index > 1">,</span>
  202. </span>
  203. </div>
  204. </div>
  205. </div>
  206. <div v-if="detailData.status == 0" class="fontColorD" style="font-size: 16px;">未发放</div>
  207. <div v-if="detailData.status == 1" class="green" style="font-size: 16px;">已发放</div>
  208. <div v-if="detailData.status == 2" class="red" style="font-size: 16px;">已取消</div>
  209. </div>
  210. <div class="imgBox flex-box" style="height: 100px">
  211. <el-image style="width: 100px; height: 100px" :src="detailData.goods_image"
  212. :preview-src-list="[detailData.goods_image]"></el-image>
  213. <div class="flex-box-v" style="padding: 10px;">
  214. <div class="flex-1" style="width: 230px;">{{ detailData.goods_name }}</div>
  215. <div>单价 :<span class="blue">{{ detailData.price }}</span> 功勋点</div>
  216. </div>
  217. </div>
  218. <div style="margin-bottom: 30px;" class="message">
  219. <div class="flex-box-ce">
  220. <span class="tabel">数量</span>
  221. <span class="flex-1">{{ detailData.num }}</span>
  222. </div>
  223. <div class="flex-box-ce">
  224. <span class="tabel">总价</span>
  225. <span class="flex-1">{{ detailData.total_price }}</span>
  226. </div>
  227. <div class="flex-box-ce">
  228. <span class="tabel">兑换时间</span>
  229. <span
  230. class="flex-1">{{ $moment.unix(detailData.create_time).format('YYYY-MM-DD HH:mm:ss') }}</span>
  231. </div>
  232. <div class="flex-box" style="margin-bottom: 10px;">
  233. <span class="tabel">备注</span>
  234. <div class="flex-1"
  235. style="min-height: 80px;border-radius: 5px;background-color: #f1f1f1;padding: 10px;">
  236. {{ detailData.remark }}</div>
  237. </div>
  238. <div class="flex-box-ce" v-if="detailData.status == 1">
  239. <span class="tabel">发放时间</span>
  240. <span
  241. class="flex-1">{{ $moment.unix(detailData.complete_time).format('YYYY-MM-DD HH:mm:ss') }}</span>
  242. </div>
  243. <div class="flex-box-ce" v-if="detailData.status == 2">
  244. <span class="tabel">取消时间</span>
  245. <span
  246. class="flex-1">{{ $moment.unix(detailData.complete_time).format('YYYY-MM-DD HH:mm:ss') }}</span>
  247. </div>
  248. <div class="flex-box" v-if="detailData.status == 2">
  249. <span class="tabel">取消原因</span>
  250. <div class="flex-1"
  251. style="min-height: 80px;border-radius: 5px;background-color: #f1f1f1;padding: 10px;">
  252. {{ detailData.cancel_remark }}</div>
  253. </div>
  254. </div>
  255. <span class="dialog-footer" style="display:flex;justify-content: flex-end;">
  256. <el-button type="primary" @click="isDetail = false">确 定</el-button>
  257. </span>
  258. </div>
  259. </el-dialog>
  260. </div>
  261. </template>
  262. <script>
  263. export default {
  264. data() {
  265. return {
  266. instantPickerOptions: {
  267. shortcuts: [{
  268. text: '本周',
  269. onClick(picker) {
  270. const now = new Date();
  271. const start = new Date();
  272. start.setTime(now.getTime() - (now.getDay() - 1) * 24 * 60 * 60 * 1000);
  273. now.setTime(start.getTime() + 6 * 24 * 60 * 60 * 1000 - 1000);
  274. picker.$emit('pick', [start, now]);
  275. }
  276. },
  277. {
  278. text: '上周',
  279. onClick(picker) {
  280. const end = new Date();
  281. const start = new Date();
  282. start.setTime(start.getTime() - (start.getDay() + 6) * 3600 * 1000 * 24);
  283. end.setTime(start.getTime() + 6 * 24 * 60 * 60 * 1000 - 1000);
  284. picker.$emit('pick', [start, end]);
  285. }
  286. },
  287. {
  288. text: '本月',
  289. onClick(picker) {
  290. const now = new Date();
  291. const startDate = new Date(now.getFullYear(), now.getMonth(), 1);
  292. const endDate = new Date(now.getFullYear(), now.getMonth() + 1, 0);
  293. picker.$emit('pick', [startDate, endDate]);
  294. }
  295. },
  296. {
  297. text: '上月',
  298. onClick(picker) {
  299. const now = new Date();
  300. const startDate = new Date(now.getFullYear() - (now.getMonth() > 0 ? 0 : 1), (now
  301. .getMonth() + 11) % 12, 1);
  302. const endDate = new Date(now.getFullYear(), now.getMonth(), 0);
  303. picker.$emit('pick', [startDate, endDate]);
  304. }
  305. }
  306. ]
  307. },
  308. employee_map: [],
  309. event_type: [{
  310. id: 0,
  311. name: '未发放'
  312. }, {
  313. id: 1,
  314. name: '已发放'
  315. }, {
  316. id: 2,
  317. name: '已取消'
  318. }],
  319. attendload: false,
  320. loading: false,
  321. list: null,
  322. time_range: [
  323. this.$moment()
  324. .startOf('month')
  325. .format('YYYY-MM-DD'),
  326. this.$moment()
  327. .endOf('month')
  328. .format('YYYY-MM-DD')
  329. ],
  330. formData: {
  331. this_only: '',
  332. status: '',
  333. page: 1,
  334. page_size: 10,
  335. export: 0,
  336. sn: '',
  337. employee_id: '',
  338. start_time: '',
  339. end_time: ''
  340. },
  341. total: 0,
  342. pageLimit: 10,
  343. selectIds: [],
  344. // 长连接结果
  345. results: [], //提交的返回结果集合
  346. isResult: false,
  347. percentage: 0,
  348. resultList: [], //要发送数据的集合
  349. resultIndex: 0,
  350. isShowError: false,
  351. isShowError2: false,
  352. errorMsg: '服务器繁忙,请稍后再试',
  353. breakList: [],
  354. isShowBreak: false,
  355. isCancel: false,
  356. isDetail: false,
  357. addTypeName: {
  358. id: '',
  359. remark: ''
  360. },
  361. detailData: {
  362. employee: {}
  363. }
  364. };
  365. },
  366. watch: {
  367. 'formData.employee_id'() {
  368. this.formData.page = 1;
  369. this.getList();
  370. },
  371. 'formData.sn'() {
  372. this.formData.page = 1;
  373. this.getList();
  374. },
  375. 'formData.status'() {
  376. this.formData.page = 1;
  377. this.getList();
  378. },
  379. time_range() {
  380. this.formData.page = 1;
  381. this.getList();
  382. },
  383. isResult(val) {
  384. if (!val) {
  385. this.isShowError = false;
  386. this.isShowBreak = false;
  387. this.errorMsg = '服务器繁忙,请稍后再试';
  388. this.$socketApiTow.closewebsocket();
  389. this.getList();
  390. }
  391. }
  392. },
  393. created() {
  394. this.employee_map = this.$getCache('userList');
  395. },
  396. mounted() {
  397. this.getList(); //考勤组
  398. let data = this.$getCache('conversion');
  399. if (data) {
  400. this.breakList = data.obj;
  401. this.isShowBreak = true;
  402. }
  403. },
  404. methods: {
  405. operation(url, str, data) {
  406. this.$confirm(`您确认${str}该奖品?`, '提示', {
  407. confirmButtonText: '确定',
  408. cancelButtonText: '取消',
  409. type: 'warning'
  410. }).then(() => {
  411. this.$axios('post', url, data).then(res => {
  412. this.$message.success(`已${str}`);
  413. this.isCancel = false;
  414. this.getList();
  415. });
  416. });
  417. },
  418. // 提交表单
  419. subGroupForm(formName) {
  420. this.$refs[formName].validate(valid => {
  421. if (valid) {
  422. this.operation('api/shop/exchange/cancel', '取消', this.addTypeName);
  423. }
  424. });
  425. },
  426. //取消
  427. cancel(id) {
  428. this.isCancel = true;
  429. if (this.$refs['addTypeName']) {
  430. this.$refs['addTypeName'].resetFields();
  431. }
  432. this.addTypeName.remark = '';
  433. this.addTypeName.id = id;
  434. },
  435. //撤销
  436. revoke(id) {
  437. this.operation('api/shop/exchange/revoke', '撤销', {
  438. id: id
  439. });
  440. },
  441. //发放
  442. grant(id) {
  443. this.operation('api/shop/exchange/deal', '发放', {
  444. id: id
  445. });
  446. },
  447. selectable(e) {
  448. return e.status == 0;
  449. },
  450. // 关闭缓存弹窗
  451. colseBreak() {
  452. this.isShowBreak = false;
  453. this.breakList = [];
  454. this.$removeCache('conversion');
  455. },
  456. // 提交缓存奖扣
  457. submitBreak() {
  458. this.$removeCache('conversion');
  459. this.resultList = JSON.parse(JSON.stringify(this.breakList));
  460. this.resultIndex = 0;
  461. this.percentage = 0;
  462. this.results = [];
  463. this.isResult = true;
  464. this.opneWebSocket();
  465. },
  466. returnName(id) {
  467. return this.employee_map[id].name;
  468. },
  469. grants() {
  470. if (this.selectIds.length == 0) {
  471. this.$message.error('请选择兑换记录');
  472. return false;
  473. }
  474. this.webSocket();
  475. },
  476. webSocket() {
  477. let arr = [];
  478. this.selectIds.forEach(item => {
  479. let data = {
  480. type: 'consume_deal',
  481. id: item.id,
  482. name: item.name
  483. };
  484. arr.push(data);
  485. });
  486. this.resultList = arr;
  487. this.resultIndex = 0;
  488. this.percentage = 0;
  489. this.results = [];
  490. this.isResult = true;
  491. this.opneWebSocket();
  492. },
  493. opneWebSocket() {
  494. let wsData = this.resultList;
  495. if (wsData[this.resultIndex] && !this.isShowError) {
  496. this.$socketApiTow.sendData(wsData[this.resultIndex], this.onmessageWS);
  497. }
  498. },
  499. onmessageWS(e) {
  500. if (e.type == 'consume_deal') {
  501. let result = e.result;
  502. result.status = e.code
  503. result.msg = e.msg
  504. this.results.unshift(result);
  505. this.resultIndex++;
  506. this.opneWebSocket();
  507. // 进度条
  508. let lng = this.resultList.length;
  509. this.percentage = Math.floor(this.resultIndex / (lng / 100))
  510. if (lng == this.results.length) {
  511. this.percentage = 100;
  512. }
  513. }
  514. // 中途断开
  515. if (e.type == 'break') {
  516. let wsData = this.resultList;
  517. this.errorMsg = e.msg;
  518. let data = {
  519. obj: wsData.slice(this.resultIndex, wsData.length)
  520. };
  521. this.$setCache('conversion', data);
  522. this.isShowError2 = true;
  523. }
  524. // 连接不上
  525. if (e.type == 'error') {
  526. this.errorMsg = e.msg;
  527. this.isShowError = true;
  528. }
  529. },
  530. handleSelectionChange(e) {
  531. this.selectIds = e.map(item => {
  532. let data = {
  533. id: item.id,
  534. name: item.employee.name
  535. };
  536. return data;
  537. });
  538. },
  539. openDetail(e) {
  540. this.isDetail = true;
  541. this.attendload = true;
  542. this.$axios('get', '/api/shop/exchange/detail', {
  543. id: e.id
  544. })
  545. .then(res => {
  546. this.detailData = res.data.data;
  547. })
  548. .finally(() => {
  549. this.attendload = false;
  550. });
  551. },
  552. exportExcel() {
  553. let url =
  554. `${process.env.VUE_APP_BASE_API}/api/download/shop/achievement/exchange/list?page=1&download_employee_id=${this.$getUserData().id}&page_size=8000&self_only=2&start_time=${this.time_range[0]}&end_time=${this.time_range[1]}`;
  555. window.open(url, '_blank');
  556. },
  557. //分页
  558. handleSizeChange(val) {
  559. this.pageLimit = val;
  560. this.formData.page_size = this.pageLimit;
  561. this.getList();
  562. },
  563. handleCurrentChange(val) {
  564. this.formData.page = val;
  565. this.getList();
  566. },
  567. //请求数据
  568. getList() {
  569. this.loading = true;
  570. let data = {
  571. self_only: '2',
  572. page: this.formData.page,
  573. page_size: this.formData.page_size,
  574. // status: this.formData.status,
  575. export: this.formData.export,
  576. sn: this.formData.sn
  577. // employee_id: this.formData.employee_id,
  578. };
  579. if (this.formData.employee_id) {
  580. data.employee_id = this.formData.employee_id;
  581. }
  582. if (this.formData.status === 0 || this.formData.status === 1 || this.formData.status === 2) {
  583. data.status = this.formData.status;
  584. }
  585. data.start_time = this.time_range[0];
  586. data.end_time = this.time_range[1];
  587. this.$axios('get', '/api/shop/exchange/list', data)
  588. .then(res => {
  589. this.list = res.data.data.list;
  590. this.total = res.data.data.count;
  591. })
  592. .finally(() => {
  593. this.loading = false;
  594. });
  595. }
  596. }
  597. };
  598. </script>
  599. <style scoped lang="scss">
  600. .message .flex-box-ce {
  601. margin-bottom: 10px;
  602. }
  603. .tabel {
  604. width: 80px;
  605. color: #606266;
  606. }
  607. .imgBox {
  608. width: 350px;
  609. border-radius: 5px;
  610. border: 1px solid #f1f1f1;
  611. margin: 10px 0;
  612. box-shadow: 0 0 5px #f1f1f1;
  613. }
  614. .results {
  615. border-bottom: 1px solid #f1f1f1;
  616. text-align: center;
  617. }
  618. .results div {
  619. padding: 10px;
  620. }
  621. .el-date-editor.el-input {
  622. width: auto;
  623. }
  624. .date-picker-width {
  625. width: 145px !important;
  626. }
  627. .search ::v-deep .el-input-group__append:active {
  628. background: #26a2ff;
  629. }
  630. .search ::v-deep .el-input-group__append:active .el-icon-search {
  631. color: #fff;
  632. }
  633. ::v-deep .el-dialog__body {
  634. padding: 0px 20px 30px;
  635. }
  636. </style>