index.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. <div id="app" v-cloak>
  2. <el-card shadow="never" style="border:0;min-width: 1000px;"
  3. body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  4. <div slot="header">
  5. <span>提货管理</span>
  6. </div>
  7. <el-tabs v-model="activeName" @tab-click="handleClick">
  8. <el-tab-pane label="全部" name="all">
  9. </el-tab-pane>
  10. <el-tab-pane label="待调货" name="0">
  11. </el-tab-pane>
  12. <el-tab-pane label="已调货" name="1">
  13. </el-tab-pane>
  14. <el-tab-pane label="已拒绝" name="2">
  15. </el-tab-pane>
  16. </el-tabs>
  17. <div class="table-body">
  18. <div>
  19. <el-form :inline="true" :model="search_data" size="small" class="demo-form-inline">
  20. <div class="flex">
  21. <el-form-item label="关键词">
  22. <el-input v-model="search_data.keyword" placeholder="请输入小店名称/ID"
  23. size="small"></el-input>
  24. </el-form-item>
  25. <el-form-item>
  26. <el-button type="primary" @click="search">搜索</el-button>
  27. <el-button type="danger" @click="clearSearch" v-if="show_clear_search_btn">清除条件
  28. </el-button>
  29. </el-form-item>
  30. </div>
  31. </el-form>
  32. </div>
  33. <el-table :data="list" stripe v-loading="listLoading" size="small" style="margin-bottom: 15px; width: 100%">
  34. <el-table-column label="小店ID" width="200" prop="store_id" align="center">
  35. </el-table-column>
  36. <el-table-column label="小店信息" align="center" width="200">
  37. <template slot-scope="scope">
  38. <div class="user_img" flex="cross:center">
  39. <el-image class="default-avatar" :src="scope.row.logo_img">
  40. <div slot="error" class="image-slot">
  41. <com-image style="float: left;margin-right: 10px;" mode="aspectFill" :src="scope
  42. .row.logo_img"></com-image>
  43. </div>
  44. </el-image>
  45. <div>{{scope.row.store_name}}</div>
  46. </div>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="调货信息" align="center" width="200">
  50. <template slot-scope="scope">
  51. <div class="table-info-img-text">
  52. <el-image class="table-info-img " :src="scope.row.goods_image">
  53. <div slot="error" class="image-slot">
  54. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  55. </div>
  56. </el-image>
  57. <div class="table-info-text">
  58. <div>{{scope.row.goods_name}}</div>
  59. </div>
  60. </div>
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="调货数量" width="200" align="center">
  64. <template slot-scope="scope">
  65. <div>{{scope.row.total_num}}</div>
  66. </template>
  67. </el-table-column>
  68. <el-table-column label="价格" width="200" align="center">
  69. <template slot-scope="scope">
  70. <div>{{scope.row.total_price}}</div>
  71. </template>
  72. </el-table-column>
  73. <el-table-column label="备注" width="200" align="center">
  74. <template slot-scope="scope">
  75. <div>{{scope.row.remark}}</div>
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="调货小店ID" width="200" align="center">
  79. <template slot-scope="scope">
  80. <div>{{scope.row.give_store_id?scope.row.give_store_id:''}}</div>
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="调货小店信息" align="center" width="200">
  84. <template slot-scope="scope">
  85. <div class="user_img" flex="cross:center" v-if="scope.row.giveStore">
  86. <el-image class="default-avatar" :src="scope.row.giveStore.logo_img">
  87. <div slot="error" class="image-slot">
  88. <com-image style="float: left;margin-right: 10px;" mode="aspectFill" :src="scope
  89. .row.giveStore.logo_img"></com-image>
  90. </div>
  91. </el-image>
  92. <div>{{scope.row.giveStore.store_name}}</div>
  93. </div>
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="状态" width="200" align="center">
  97. <template slot-scope="scope">
  98. <div>{{scope.row.order_status_text}}</div>
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="操作" width="200" fixed="right" align="center">
  102. <template slot-scope="scope">
  103. <template>
  104. <el-button v-if="scope.row.order_status==0" type="text"
  105. size="small" @click="confirm(scope
  106. .row,1)">同意
  107. </el-button>
  108. <el-button v-if="scope.row.order_status==0" type="text"
  109. size="small" @click="confirm(scope
  110. .row,0)">拒绝
  111. </el-button>
  112. </template>
  113. </template>
  114. </el-table-column>
  115. </el-table>
  116. <div style="text-align: right;margin: 20px 0;">
  117. <el-pagination @current-change="pagination" background layout="prev, pager, next"
  118. :page-count="pageCount"></el-pagination>
  119. </div>
  120. </div>
  121. <el-dialog :title="audit_title" :visible.sync="dialogAuditVisible" width="1200px">
  122. <el-form ref="auditForm" :model="auditForm" label-width="120px">
  123. <el-table :data="attr_list" stripe v-loading="listLoading" size="small"
  124. style="margin-bottom: 15px; width: 100%">
  125. <el-table-column label="商品图片" width="200" align="center">
  126. <template slot-scope="scope">
  127. <el-image class="default-avatar" :src="scope.row.attr.pic_url?scope.row.attr
  128. .pic_url:scope.row.goods.cover_pic">
  129. <div slot="error" class="image-slot">
  130. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  131. </div>
  132. </el-image>
  133. </template>
  134. </el-table-column>
  135. <el-table-column label="商品规格" width="200">
  136. <template slot-scope="scope">
  137. <div>{{scope.row.attr.name}}</div>
  138. </template>
  139. </el-table-column>
  140. <el-table-column label="规格ID" width="200">
  141. <template slot-scope="scope">
  142. <div>{{scope.row.attr.id}}</div>
  143. </template>
  144. </el-table-column>
  145. <el-table-column label="调货数量" width="200">
  146. <template slot-scope="scope">
  147. <div>{{scope.row.num}}</div>
  148. </template>
  149. </el-table-column>
  150. </el-table>
  151. <el-form-item label="选择调货的小店" v-if="auditForm.audit_status==1">
  152. <el-select v-model="auditForm.store_id" placeholder="请选择" size="mini">
  153. <el-option v-for="item in give_store_list" :key="item.id" :label="item.store_name"
  154. :value="item.id">
  155. </el-option>
  156. </el-select>
  157. </el-form-item>
  158. <el-form-item label="备注">
  159. <el-input type="textarea" v-model="auditForm.remark" placeholder="请输入内容"></el-input>
  160. </el-form-item>
  161. </el-form>
  162. <div slot="footer" class="dialog-footer" style="text-align: center">
  163. <el-button size="mini" @click="dialogAuditVisible = false">取消</el-button>
  164. <el-button size="mini" type="primary" @click="audit">确定</el-button>
  165. </div>
  166. </el-dialog>
  167. </el-card>
  168. </div>
  169. <script>
  170. const app = new Vue({
  171. el: '#app',
  172. data() {
  173. return {
  174. search_data: {
  175. keyword: '',
  176. },
  177. activeName:'all',
  178. btnLoading: false,
  179. list: [],
  180. dates: null,
  181. page: 1,
  182. pageCount: 0,
  183. listLoading: false,
  184. btnLoading: false,
  185. detail: [],
  186. dialogExpressVisible: false,
  187. dialogAuditVisible: false,
  188. express_list: [],
  189. audit_title: '',
  190. auditForm: {
  191. remark: '',
  192. audit_status: '',
  193. store_id: '',
  194. id: ''
  195. },
  196. give_store_list:[],
  197. attr_list:[]
  198. };
  199. },
  200. mounted: function () {
  201. this.getList();
  202. },
  203. computed: {
  204. show_clear_search_btn: function () {
  205. return !isEmpty(this.search_data.keyword)
  206. }
  207. },
  208. methods: {
  209. handleClick()
  210. {
  211. this.page=1
  212. this.getList()
  213. },
  214. confirm(row, status) {
  215. if (status == 1) {
  216. this.audit_title = '是否同意调货';
  217. }
  218. if (status == 0) {
  219. this.audit_title = '是否拒绝调货';
  220. }
  221. this.auditForm.id = row.id
  222. this.auditForm.audit_status = status
  223. this.dialogAuditVisible = true
  224. this.btnLoading = true
  225. this.attr_list=[]
  226. this.give_store_list=[]
  227. this.$request({
  228. params: {
  229. r: 'happiness/agent/move/move',
  230. id: row.id
  231. },
  232. method: 'get',
  233. }).then(e => {
  234. if (e.data.code === 0) {
  235. this.attr_list=e.data.data.goods_list
  236. this.give_store_list=e.data.data.store_list
  237. this.btnLoading = false;
  238. } else {
  239. this.$message.error(e.data.msg);
  240. this.btnLoading = false;
  241. }
  242. }).catch(e => {
  243. });
  244. },
  245. audit() {
  246. let self = this
  247. this.btnLoading = true;
  248. this.$request({
  249. params: {
  250. r: 'happiness/agent/move/move'
  251. },
  252. data: self.auditForm,
  253. method: 'post',
  254. }).then(e => {
  255. if (e.data.code === 0) {
  256. this.getList();
  257. this.btnLoading = false;
  258. this.dialogAuditVisible=false;
  259. this.$message.success(e.data.msg);
  260. } else {
  261. this.$message.error(e.data.msg);
  262. this.btnLoading = false;
  263. }
  264. }).catch(e => {
  265. });
  266. },
  267. pagination(currentPage) {
  268. let self = this;
  269. self.page = currentPage;
  270. self.getList();
  271. },
  272. getList(id) {
  273. let self = this;
  274. let basic_params = {
  275. r: 'happiness/agent/move/index',
  276. page: self.page,
  277. status: self.activeName
  278. };
  279. params = Object.assign(basic_params, this.search_data);
  280. if (self.listLoading === false) {
  281. self.listLoading = true;
  282. request({
  283. params: params,
  284. method: 'get',
  285. }).then(e => {
  286. self.listLoading = false;
  287. if (e.data.code === 0) {
  288. self.list = e.data.data.list;
  289. self.pageCount = e.data.data.page_count;
  290. } else {
  291. self.$message.error(e.data.msg);
  292. }
  293. }).catch(e => {
  294. });
  295. }
  296. },
  297. search() {
  298. this.page = 1;
  299. this.getList();
  300. },
  301. clearSearch() {
  302. this.search_data.keyword = '';
  303. this.getList();
  304. }
  305. }
  306. })
  307. </script>
  308. <style>
  309. .flex {
  310. display: flex;
  311. align-items: center;
  312. }
  313. .stat_details {
  314. padding: 0 0 20px;
  315. display: flex;
  316. }
  317. .stat_details .order_module {
  318. flex: 1;
  319. background: #F2F2F2;
  320. margin: 0 5px;
  321. padding: 20px 25px;
  322. }
  323. .order_module {
  324. display: flex;
  325. flex-direction: column;
  326. }
  327. .order_module:last-child {
  328. margin-right: 0;
  329. }
  330. .order_module:first-child {
  331. margin-left: 0;
  332. }
  333. .price {
  334. font-size: 14px;
  335. flex: 1;
  336. word-break: break-all;
  337. }
  338. .oirder_modul_title {
  339. font-size: 12px;
  340. margin-bottom: 10px;
  341. display: flex;
  342. align-items: center;
  343. }
  344. ..el-input__inner {
  345. border-right: 1px solid #EBEEF5;
  346. }
  347. .oirder_modul_title .text {
  348. margin-right: 10px;
  349. }
  350. .stat_icon {
  351. font-size: 19px;
  352. color: #BFBFBF;
  353. }
  354. .user_img {
  355. position: relative;
  356. margin-right: 8px;
  357. /* height: 50px;
  358. width: 50px; */
  359. }
  360. .default-avatar {
  361. width: 50px;
  362. height: 50px;
  363. border-radius: 50%;
  364. margin-right: 8px;
  365. }
  366. </style>