stock.blade.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  1. @extends('layouts.base')
  2. @section('title', "库存详情")
  3. @section('content')
  4. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}"/>
  5. <style>
  6. .edit-i {
  7. display: none;
  8. }
  9. .el-table_1_column_2:hover .edit-i {
  10. font-weight: 900;
  11. padding: 0;
  12. margin: 0;
  13. display: inline-block;
  14. }
  15. .el-tabs__item, .is-top {
  16. font-size: 16px
  17. }
  18. .el-tabs__active-bar {
  19. height: 3px;
  20. }
  21. .list-title {
  22. display: flex;
  23. width: 100%;
  24. background: #f9f9f9;
  25. padding: 15px 10px;
  26. font-weight: 900;
  27. border: 1px solid #e9e9e9;
  28. }
  29. .list-title .list-title-1 {
  30. display: flex;
  31. align-items: center;
  32. justify-content: center;
  33. }
  34. .list-info {
  35. display: flex;
  36. padding: 10px;
  37. justify-content: left;
  38. background: #f9f9f9;
  39. }
  40. .list-con {
  41. display: flex;
  42. width: 100%;
  43. font-size: 12px;
  44. font-weight: 500;
  45. align-items: stretch;
  46. border-bottom: 1px solid rgb(233, 233, 233);
  47. }
  48. .list-con-goods {
  49. display: flex;
  50. align-items: center;
  51. justify-content: center;
  52. box-sizing: border-box;
  53. padding-left: 10px;
  54. border-top: 1px solid #e9e9e9;
  55. min-height: 90px
  56. }
  57. .list-con-goods-text {
  58. min-height: 70px;
  59. overflow: hidden;
  60. flex: 1;
  61. display: flex;
  62. flex-direction: column;
  63. justify-content: space-between;
  64. }
  65. .list-con-goods-price {
  66. border-right: 1px solid #e9e9e9;
  67. border-left: 1px solid #e9e9e9;
  68. min-width: 150px;
  69. min-height: 90px;
  70. text-align: left;
  71. padding: 20px;
  72. display: flex;
  73. flex-direction: column;
  74. }
  75. .list-con-goods-title {
  76. font-size: 14px;
  77. line-height: 20px;
  78. text-overflow: -o-ellipsis-lastline;
  79. overflow: hidden;
  80. text-overflow: ellipsis;
  81. display: -webkit-box;
  82. -webkit-line-clamp: 2;
  83. line-clamp: 2;
  84. -webkit-box-orient: vertical;
  85. }
  86. .list-con-goods-option {
  87. font-size: 12px;
  88. color: #999
  89. }
  90. .list-con-member-info {
  91. display: flex;
  92. padding: 0 2px;
  93. flex-direction: column;
  94. flex: 1;
  95. min-width: 120px;
  96. line-height: 28px;
  97. justify-content: center;
  98. text-align: left;
  99. font-size: 14px;
  100. border-top: 1px solid #e9e9e9;
  101. border-right: 1px solid #e9e9e9;
  102. }
  103. .list-member {
  104. padding: 10px;
  105. font-size: 12px;
  106. font-weight: 500;
  107. }
  108. .list-num {
  109. flex: 3;
  110. display: flex;
  111. align-items: center;
  112. border-right: 1px solid #e9e9e9;
  113. justify-content: center;
  114. }
  115. .list-gen {
  116. display: flex;
  117. align-items: center;
  118. justify-content: center;
  119. line-height: 28px;
  120. }
  121. .list-gen-txt {
  122. flex: 1;
  123. border-right: 1px solid #e9e9e9;
  124. border-bottom: 1px solid #e9e9e9;
  125. align-items: center;
  126. justify-content: center;
  127. display: flex;
  128. }
  129. .list-opt {
  130. flex: 1;
  131. display: flex;
  132. align-items: center;
  133. border-left: 1px solid #e9e9e9;
  134. justify-content: center;
  135. }
  136. /* 导航 */
  137. .el-radio-button .el-radio-button__inner, .el-radio-button:first-child .el-radio-button__inner {
  138. border-radius: 4px 4px 4px 4px;
  139. border-left: 0px;
  140. }
  141. .el-radio-button__inner {
  142. border: 0;
  143. }
  144. .el-radio-button:last-child .el-radio-button__inner {
  145. border-radius: 4px 4px 4px 4px;
  146. }
  147. .panel .active a {
  148. background-color: #29ba9c !important;
  149. border-radius: 18px !important;
  150. color: #fff;
  151. }
  152. .add-shopnav li a {
  153. display: inline-block;
  154. padding: 0 12px;
  155. line-height: 32px;
  156. color: #333;
  157. border: 1px solid #e5e5e5;
  158. background: #f8f8f8;
  159. min-width: 80px;
  160. text-align: center;
  161. }
  162. .panel a {
  163. border: none !important;
  164. background-color: #fff !important;
  165. }
  166. </style>
  167. <div class="all">
  168. <div id="app" v-cloak>
  169. {{--<div class="vue-head">--}}
  170. {{--<div class="vue-main-title" style="margin-bottom:20px">--}}
  171. {{--<div class="vue-main-title-left"></div>--}}
  172. {{--<div class="vue-main-title-content">库存详情</div>--}}
  173. {{--<div class="vue-main-title-button">--}}
  174. {{--<a href="{!! yzWebFullUrl('plugin.agency.admin.stock.addStock') !!} ">--}}
  175. {{--<el-button size="mini" type="primary">添加库存</el-button>--}}
  176. {{--</a>--}}
  177. {{--</div>--}}
  178. {{--</div>--}}
  179. {{--<div class="vue-search">--}}
  180. {{--<el-form :inline="true" :model="search_form" class="demo-form-inline">--}}
  181. {{--<el-form-item label="">--}}
  182. {{--<el-input v-model="search_form.member_info" placeholder="会员ID/昵称/姓名/手机号"></el-input>--}}
  183. {{--</el-form-item>--}}
  184. {{--<el-form-item label="">--}}
  185. {{--<el-input v-model="search_form.goods_id" placeholder="商品ID"></el-input>--}}
  186. {{--</el-form-item>--}}
  187. {{--<el-form-item label="">--}}
  188. {{--<el-input v-model="search_form.goods_name" placeholder="商品昵称"></el-input>--}}
  189. {{--</el-form-item>--}}
  190. {{--<el-form-item label="">--}}
  191. {{--<el-button type="primary" @click="search(1)">搜索</el-button>--}}
  192. {{--</el-form-item>--}}
  193. {{--</el-form>--}}
  194. {{--</div>--}}
  195. {{--</div>--}}
  196. <div class="vue-main">
  197. <div class="vue-main-form">
  198. <div class="vue-main-title" style="margin-bottom:20px">
  199. <div class="vue-main-title-left"></div>
  200. <div class="vue-main-title-content" style="flex:0 0 140px">库存详情列表</div>
  201. </div>
  202. <template style="margin-top:-10px;">
  203. <el-table
  204. :data="list"
  205. style="padding:0 10px"
  206. >
  207. <el-table-column
  208. prop="uid"
  209. align="center"
  210. label="会员ID"
  211. >
  212. </el-table-column>
  213. <el-table-column
  214. align="center"
  215. label="代理商"
  216. >
  217. <template slot-scope="scope">
  218. <div>
  219. <div class="vue-ellipsis">
  220. <el-image :src="scope.row.avatar"
  221. style='width:30px;height:30px;padding:1px;border:1px solid #ccc'></el-image>
  222. </div>
  223. <div class="vue-ellipsis">[[scope.row.nickname]]</div>
  224. </div>
  225. </template>
  226. </el-table-column>
  227. <el-table-column
  228. prop="goods_id"
  229. align="center"
  230. label="商品ID"
  231. >
  232. </el-table-column>
  233. <el-table-column
  234. align="center"
  235. label="商品"
  236. >
  237. <template slot-scope="scope">
  238. <div class="list-con-goods">
  239. <div class="list-con-goods-img" style="width:80px">
  240. <el-image :src="scope.row.thumb" style="width:70px;height:70px"></el-image>
  241. </div>
  242. <div class="list-con-goods-text"
  243. :style="{justifyContent:(scope.row.option_title?'':'center')}">
  244. <div class="list-con-goods-title">
  245. [[scope.row.title]]
  246. </div>
  247. <div class="list-con-goods-option" v-if="scope.row.option_title">
  248. 规格:[[scope.row.option_title]]
  249. </div>
  250. </div>
  251. </div>
  252. </template>
  253. </el-table-column>
  254. <el-table-column label="剩余库存" align="center" max-width="80">
  255. <template slot-scope="scope">
  256. <el-popover class="item" placement="top" effect="light">
  257. <div style="text-align:center;">
  258. <el-input v-model="change_stock" size="small"
  259. style="width:100px;"></el-input>
  260. <el-button size="small"
  261. @click="confirmChange(scope.row.id,'stock')">确定
  262. </el-button>
  263. </div>
  264. <a slot="reference">
  265. <i class="el-icon-edit edit-i"
  266. title="点击编辑"
  267. @click="editStock(scope.$index,'stock')"></i>
  268. </a>
  269. </el-popover>
  270. [[scope.row.stock]]
  271. </template>
  272. </el-table-column>
  273. {{--<el-table-column--}}
  274. {{--align="center"--}}
  275. {{--label="操作"--}}
  276. {{-->--}}
  277. {{--<template slot-scope="scope">--}}
  278. {{--<el-button size="mini" style="margin-right: 10px;" @click="goDetail(scope.row)">库存明细--}}
  279. {{--</el-button>--}}
  280. {{--</template>--}}
  281. {{--</el-table-column>--}}
  282. </el-table>
  283. </template>
  284. </div>
  285. </div>
  286. <div class="vue-page" v-if="total>0">
  287. <el-row>
  288. <el-col align="right">
  289. <el-pagination layout="prev, pager, next,jumper" @current-change="search" :total="total"
  290. :page-size="per_page" :current-page="current_page" background
  291. ></el-pagination>
  292. </el-col>
  293. </el-row>
  294. </div>
  295. </div>
  296. </div>
  297. <script>
  298. var app = new Vue({
  299. el: "#app",
  300. delimiters: ['[[', ']]'],
  301. name: 'test',
  302. data() {
  303. return {
  304. goods_id: '{!! $_REQUEST['goods_id'] !!}',
  305. uid: '{!! $_REQUEST['uid'] !!}',
  306. change_stock: "",//修改库存弹框赋值
  307. listUrl: '{!! yzWebUrl('plugin.agency.admin.stock.get-list') !!}',//获取订单数据链接
  308. list: [],
  309. has_many_level: [],
  310. change_sort: '',
  311. times: [],
  312. data: "",
  313. expressCompanies: [],//快递公司
  314. extra_param: {},
  315. code: 'all',
  316. search_form: {
  317. member_id: "",
  318. },
  319. order_type: '',
  320. close_order_show: false,//关闭订单弹窗
  321. close_order_con: "",//关闭订单原因
  322. close_order_id: "",
  323. close_order1_show: false,//手动关闭订单弹窗
  324. close_order1_con: "",//手动关闭订单原因
  325. close_order1_id: "",
  326. cancel_send_show: false,// 取消发货弹窗
  327. cancel_send_con: "",//取消发货原因
  328. cancel_send_id: '',
  329. confirm_send_show: false,// 确认发货弹窗
  330. confirm_send_id: "",
  331. change_price_show: false,//修改价格弹窗
  332. change_price_id: "",
  333. change_all_money: 0.00,//价格修改
  334. all_money: 0.00,//买家实付
  335. order_model: {},
  336. dispatch_price: 0,//运费
  337. order_goods_model: [],
  338. address_info: {},
  339. send: {
  340. dispatch_type_id: 1,
  341. express_code: "",
  342. express_sn: "",
  343. },
  344. send_rules: {},
  345. more_send_show: false,
  346. order_goods_send_list: [],
  347. send_order_goods_ids: [],
  348. street: 0,
  349. province_list: [],
  350. city_list: [],
  351. district_list: [],
  352. street_list: [],
  353. areaLoading: false,
  354. rules: {},
  355. current_page: 1,
  356. total: 1,
  357. per_page: 1,
  358. readonly: false,
  359. }
  360. },
  361. created() {
  362. let result = this.viewReturn();
  363. this.__initial(result);
  364. this.search_form.member_id = this.getParam('member_id') ? this.getParam('member_id') : '';
  365. },
  366. mounted() {
  367. this.getData(1);
  368. },
  369. methods: {
  370. // 编辑库存
  371. editStock(index, type) {
  372. let that = this;
  373. if (type == 'stock') {
  374. that.change_stock = "";
  375. that.change_stock = that.list[index].stock;
  376. }
  377. },
  378. // 确认修改标题、价格、库存
  379. confirmChange(id, type) {
  380. let that = this;
  381. let value = '';
  382. if (type == 'stock') {
  383. value = that.change_stock;
  384. if (!(/^\d+$/.test(that.change_stock))) {
  385. that.$message.error('请输入正确数字');
  386. return false;
  387. }
  388. }
  389. let json = {
  390. id: id,
  391. type: type,
  392. value: value,
  393. };
  394. that.table_loading = true;
  395. that.$http.post("{!! yzWebFullUrl('plugin.agency.admin.stock.change') !!}", json).then(response => {
  396. console.log(response);
  397. if (response.data.result == 1) {
  398. that.$message.success('操作成功!');
  399. if (document.all) {
  400. document.getElementById('app').click();
  401. } else {// 其它浏览器
  402. var e = document.createEvent('MouseEvents')
  403. e.initEvent('click', true, true)
  404. document.getElementById('app').dispatchEvent(e)
  405. }
  406. window.location.reload();
  407. } else {
  408. that.$message.error(response.data.msg);
  409. }
  410. that.table_loading = false;
  411. }), function (res) {
  412. console.log(res);
  413. that.table_loading = false;
  414. };
  415. },
  416. viewReturn() {
  417. return {!! $data?:'{}' !!};
  418. },
  419. __initial(data) {
  420. if (data.code) {
  421. this.code = data.code;
  422. }
  423. if (data.listUrl) {
  424. this.listUrl = data.listUrl;
  425. }
  426. if (data.extraParam) {
  427. this.extra_param = data.extraParam;
  428. }
  429. this.expressCompanies = data.expressCompanies;
  430. console.log(data);
  431. },
  432. getData(page) {
  433. let requestData = {
  434. goods_id: this.goods_id,
  435. uid: this.uid,
  436. page: page,
  437. code: this.code,
  438. search: JSON.parse(JSON.stringify(this.search_form)),
  439. };
  440. if (this.times && this.times.length > 0) {
  441. requestData.search.start_time = this.times[0];
  442. requestData.search.end_time = this.times[1];
  443. }
  444. console.log(requestData);
  445. let loading = this.$loading({
  446. target: document.querySelector(".content"),
  447. background: 'rgba(0, 0, 0, 0)'
  448. });
  449. this.$http.post(this.listUrl, requestData).then(function (response) {
  450. if (response.data.result) {
  451. this.list = response.data.data.data;
  452. this.current_page = response.data.data.current_page;
  453. this.total = response.data.data.total;
  454. this.per_page = response.data.data.per_page;
  455. loading.close();
  456. } else {
  457. this.$message({
  458. message: response.data.msg,
  459. type: 'error'
  460. });
  461. }
  462. loading.close();
  463. }, function (response) {
  464. this.$message({
  465. message: response.data.msg,
  466. type: 'error'
  467. });
  468. loading.close();
  469. });
  470. },
  471. search(val) {
  472. this.getData(val);
  473. },
  474. escapeHTML(a) {
  475. a = "" + a;
  476. return a.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, "\"").replace(/&apos;/g, "'");
  477. },
  478. getParam(name) {
  479. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  480. var r = window.location.search.substr(1).match(reg);
  481. if (r != null) return unescape(r[2]);
  482. return null;
  483. },
  484. currentChange(val) {
  485. this.loading = true;
  486. this.$http.post('{!! yzWebFullUrl('plugin.agency.admin.stock.get-list') !!}', {
  487. page: val,
  488. search: this.real_search_form
  489. }).then(function (response) {
  490. if (response.data.result) {
  491. this.list = response.data.data.data;
  492. this.current_page = response.data.data.current_page;
  493. this.total = response.data.data.total;
  494. this.per_page = response.data.data.per_page;
  495. loading.close();
  496. } else {
  497. this.$message({
  498. message: response.data.msg,
  499. type: 'error'
  500. });
  501. }
  502. loading.close();
  503. }, function (response) {
  504. console.log(response);
  505. this.loading = false;
  506. }
  507. );
  508. },
  509. },
  510. })
  511. </script>
  512. @endsection