1
0

index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="门店名称" prop="shopSn">
  5. <el-input
  6. v-model="queryParams.shopName"
  7. placeholder="请输入门店名称"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <!-- <el-form-item label="商户编号" prop="merchSn">-->
  14. <!-- <el-input-->
  15. <!-- v-model="queryParams.merchSn"-->
  16. <!-- placeholder="请输入商户编号"-->
  17. <!-- clearable-->
  18. <!-- size="small"-->
  19. <!-- @keyup.enter.native="handleQuery"-->
  20. <!-- />-->
  21. <!-- </el-form-item>-->
  22. <!-- <el-form-item label="商户名称" prop="merchName">-->
  23. <!-- <el-input-->
  24. <!-- v-model="queryParams.merchName"-->
  25. <!-- placeholder="请输入商户名称"-->
  26. <!-- clearable-->
  27. <!-- size="small"-->
  28. <!-- @keyup.enter.native="handleQuery"-->
  29. <!-- />-->
  30. <!-- </el-form-item>-->
  31. <!-- <el-form-item label="第三方商户代码" prop="thirdPartyMerchCode">-->
  32. <!-- <el-input-->
  33. <!-- v-model="queryParams.thirdPartyMerchCode"-->
  34. <!-- placeholder="请输入第三方商户代码"-->
  35. <!-- clearable-->
  36. <!-- size="small"-->
  37. <!-- @keyup.enter.native="handleQuery"-->
  38. <!-- />-->
  39. <!-- </el-form-item>-->
  40. <!-- <el-form-item label="第三方商户名称" prop="thirdPartyMerchName">-->
  41. <!-- <el-input-->
  42. <!-- v-model="queryParams.thirdPartyMerchName"-->
  43. <!-- placeholder="请输入第三方商户名称"-->
  44. <!-- clearable-->
  45. <!-- size="small"-->
  46. <!-- @keyup.enter.native="handleQuery"-->
  47. <!-- />-->
  48. <!-- </el-form-item>-->
  49. <el-form-item label="SKU" prop="sku">
  50. <el-input
  51. v-model="queryParams.sku"
  52. placeholder="请输入SKU"
  53. clearable
  54. size="small"
  55. @keyup.enter.native="handleQuery"
  56. />
  57. </el-form-item>
  58. <!-- <el-form-item label="海关代码" prop="cusCode">-->
  59. <!-- <el-select v-model="queryParams.cusCode" placeholder="请选择海关代码" clearable size="small">-->
  60. <!-- <el-option-->
  61. <!-- v-for="dict in cusCodeOptions"-->
  62. <!-- :key="dict.dictValue"-->
  63. <!-- :label="dict.dictLabel"-->
  64. <!-- :value="dict.dictValue"-->
  65. <!-- />-->
  66. <!-- </el-select>-->
  67. <!-- </el-form-item>-->
  68. <!-- <el-form-item label="保税仓代码" prop="bondedCode">-->
  69. <!-- <el-select v-model="queryParams.bondedCode" placeholder="请选择保税仓代码" clearable size="small">-->
  70. <!-- <el-option-->
  71. <!-- v-for="dict in bondedCodeOptions"-->
  72. <!-- :key="dict.dictValue"-->
  73. <!-- :label="dict.dictLabel"-->
  74. <!-- :value="dict.dictValue"-->
  75. <!-- />-->
  76. <!-- </el-select>-->
  77. <!-- </el-form-item>-->
  78. <!-- <el-form-item label="仓库编号" prop="wareSn">-->
  79. <!-- <el-input-->
  80. <!-- v-model="queryParams.wareSn"-->
  81. <!-- placeholder="请输入仓库编号"-->
  82. <!-- clearable-->
  83. <!-- size="small"-->
  84. <!-- @keyup.enter.native="handleQuery"-->
  85. <!-- />-->
  86. <!-- </el-form-item>-->
  87. <!-- <el-form-item label="货品业务类型" prop="goodsBizType">-->
  88. <!-- <el-select v-model="queryParams.goodsBizType" placeholder="请选择货品业务类型" clearable size="small">-->
  89. <!-- <el-option-->
  90. <!-- v-for="dict in goodsBizTypeOptions"-->
  91. <!-- :key="dict.dictValue"-->
  92. <!-- :label="dict.dictLabel"-->
  93. <!-- :value="dict.dictValue"-->
  94. <!-- />-->
  95. <!-- </el-select>-->
  96. <!-- </el-form-item>-->
  97. <!-- <el-form-item label="是否有效" prop="isValid">-->
  98. <!-- <el-select v-model="queryParams.isValid" placeholder="请选择是否有效" clearable size="small">-->
  99. <!-- <el-option-->
  100. <!-- v-for="dict in isValidOptions"-->
  101. <!-- :key="dict.dictValue"-->
  102. <!-- :label="dict.dictLabel"-->
  103. <!-- :value="dict.dictValue"-->
  104. <!-- />-->
  105. <!-- </el-select>-->
  106. <!-- </el-form-item>-->
  107. <el-form-item>
  108. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  109. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  110. </el-form-item>
  111. </el-form>
  112. <el-row :gutter="10" class="mb8">
  113. <!-- <el-col :span="1.5">-->
  114. <!-- <el-button-->
  115. <!-- type="primary"-->
  116. <!-- icon="el-icon-plus"-->
  117. <!-- size="mini"-->
  118. <!-- @click="handleAdd"-->
  119. <!-- v-hasPermi="['biz:shopinve:add']"-->
  120. <!-- >新增</el-button>-->
  121. <!-- </el-col>-->
  122. <!-- <el-col :span="1.5">-->
  123. <!-- <el-button-->
  124. <!-- type="success"-->
  125. <!-- icon="el-icon-edit"-->
  126. <!-- size="mini"-->
  127. <!-- :disabled="single"-->
  128. <!-- @click="handleUpdate"-->
  129. <!-- v-hasPermi="['biz:shopinve:edit']"-->
  130. <!-- >修改</el-button>-->
  131. <!-- </el-col>-->
  132. <!-- <el-col :span="1.5">-->
  133. <!-- <el-button-->
  134. <!-- type="danger"-->
  135. <!-- icon="el-icon-delete"-->
  136. <!-- size="mini"-->
  137. <!-- :disabled="multiple"-->
  138. <!-- @click="handleDelete"-->
  139. <!-- v-hasPermi="['biz:shopinve:remove']"-->
  140. <!-- >删除</el-button>-->
  141. <!-- </el-col>-->
  142. <el-col :span="1.5">
  143. <el-button
  144. type="warning"
  145. icon="el-icon-download"
  146. size="mini"
  147. @click="handleExport"
  148. v-hasPermi="['biz:shopinve:export']"
  149. >导出</el-button>
  150. </el-col>
  151. <el-col :span="1.5">
  152. <el-button
  153. type="warning"
  154. icon="el-icon-download"
  155. size="mini"
  156. @click="handlePull"
  157. v-hasPermi="['biz:storeinvemng:pull']"
  158. >拉取</el-button>
  159. </el-col>
  160. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  161. </el-row>
  162. <el-table v-loading="loading" :data="shopinveList" @selection-change="handleSelectionChange">
  163. <el-table-column type="selection" width="55" align="center" />
  164. <!-- <el-table-column label="门店库存编号" align="center" prop="shopInveSn" />-->
  165. <el-table-column label="门店序号" align="center" prop="shopSn" />
  166. <el-table-column label="门店名称" align="center" prop="shopName" />
  167. <!-- <el-table-column label="商户编号" align="center" prop="merchSn" />-->
  168. <!-- <el-table-column label="商户名称" align="center" prop="merchName" />-->
  169. <!-- <el-table-column label="第三方商户代码" align="center" prop="thirdPartyMerchCode" />-->
  170. <!-- <el-table-column label="第三方商户名称" align="center" prop="thirdPartyMerchName" />-->
  171. <el-table-column label="SKU" align="center" prop="sku" />
  172. <!-- <el-table-column label="海关代码" align="center" prop="cusCode" :formatter="cusCodeFormat" />-->
  173. <!-- <el-table-column label="保税仓代码" align="center" prop="bondedCode" :formatter="bondedCodeFormat" />-->
  174. <!-- <el-table-column label="仓库编号" align="center" prop="wareSn" />-->
  175. <!-- <el-table-column label="货品业务类型" align="center" prop="goodsBizType" :formatter="goodsBizTypeFormat" />-->
  176. <el-table-column label="门店库存" align="center" prop="shopInve" />
  177. <el-table-column label="门店可用数" align="center" prop="shopValid" />
  178. <el-table-column label="门店冻结数" align="center" prop="shopFreezeNum" />
  179. <el-table-column label="门店破损数" align="center" prop="shopDamageNum" />
  180. <el-table-column label="门店灭失数" align="center" prop="shopDestroyLostNum" />
  181. <el-table-column label="门店过期数" align="center" prop="shopExpireNum" />
  182. <el-table-column label="样品展示冻结数" align="center" prop="shopSampleFreezeNum" />
  183. <el-table-column label="门店减扣数" align="center" prop="shopMinus" />
  184. <el-table-column label="门店增补数" align="center" prop="shopSupp" />
  185. <el-table-column label="进场数量" align="center" prop="inQty" />
  186. <el-table-column label="出场数量" align="center" prop="outQty" />
  187. <el-table-column label="退货数量" align="center" prop="returnQty" />
  188. <el-table-column label="销售数量" align="center" prop="saleQty" />
  189. <el-table-column label="移仓转入数量" align="center" prop="locInQty" />
  190. <el-table-column label="移仓转出数量" align="center" prop="locOutQty" />
  191. <!-- <el-table-column label="是否有效" align="center" prop="isValid" :formatter="isValidFormat" />-->
  192. <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
  193. <!-- <template slot-scope="scope">-->
  194. <!-- <el-button-->
  195. <!-- size="mini"-->
  196. <!-- type="text"-->
  197. <!-- icon="el-icon-edit"-->
  198. <!-- @click="handleUpdate(scope.row)"-->
  199. <!-- v-hasPermi="['biz:shopinve:edit']"-->
  200. <!-- >修改</el-button>-->
  201. <!-- <el-button-->
  202. <!-- size="mini"-->
  203. <!-- type="text"-->
  204. <!-- icon="el-icon-delete"-->
  205. <!-- @click="handleDelete(scope.row)"-->
  206. <!-- v-hasPermi="['biz:shopinve:remove']"-->
  207. <!-- >删除</el-button>-->
  208. <!-- </template>-->
  209. <!-- </el-table-column>-->
  210. </el-table>
  211. <pagination
  212. v-show="total>0"
  213. :total="total"
  214. :page.sync="queryParams.pageNum"
  215. :limit.sync="queryParams.pageSize"
  216. @pagination="getList"
  217. />
  218. <!-- 添加或修改商户店面库存,包括跨境,一般贸易对话框 -->
  219. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  220. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  221. <el-form-item label="门店序号" prop="shopSn">
  222. <el-input v-model="form.shopSn" placeholder="请输入门店序号" />
  223. </el-form-item>
  224. <el-form-item label="商户编号" prop="merchSn">
  225. <el-input v-model="form.merchSn" placeholder="请输入商户编号" />
  226. </el-form-item>
  227. <el-form-item label="商户名称" prop="merchName">
  228. <el-input v-model="form.merchName" placeholder="请输入商户名称" />
  229. </el-form-item>
  230. <el-form-item label="第三方商户代码" prop="thirdPartyMerchCode">
  231. <el-input v-model="form.thirdPartyMerchCode" placeholder="请输入第三方商户代码" />
  232. </el-form-item>
  233. <el-form-item label="第三方商户名称" prop="thirdPartyMerchName">
  234. <el-input v-model="form.thirdPartyMerchName" placeholder="请输入第三方商户名称" />
  235. </el-form-item>
  236. <el-form-item label="SKU" prop="sku">
  237. <el-input v-model="form.sku" placeholder="请输入SKU" />
  238. </el-form-item>
  239. <el-form-item label="海关代码" prop="cusCode">
  240. <el-select v-model="form.cusCode" placeholder="请选择海关代码">
  241. <el-option
  242. v-for="dict in cusCodeOptions"
  243. :key="dict.dictValue"
  244. :label="dict.dictLabel"
  245. :value="dict.dictValue"
  246. ></el-option>
  247. </el-select>
  248. </el-form-item>
  249. <el-form-item label="保税仓代码" prop="bondedCode">
  250. <el-select v-model="form.bondedCode" placeholder="请选择保税仓代码">
  251. <el-option
  252. v-for="dict in bondedCodeOptions"
  253. :key="dict.dictValue"
  254. :label="dict.dictLabel"
  255. :value="dict.dictValue"
  256. ></el-option>
  257. </el-select>
  258. </el-form-item>
  259. <el-form-item label="仓库编号" prop="wareSn">
  260. <el-input v-model="form.wareSn" placeholder="请输入仓库编号" />
  261. </el-form-item>
  262. <el-form-item label="货品业务类型" prop="goodsBizType">
  263. <el-select v-model="form.goodsBizType" placeholder="请选择货品业务类型">
  264. <el-option
  265. v-for="dict in goodsBizTypeOptions"
  266. :key="dict.dictValue"
  267. :label="dict.dictLabel"
  268. :value="dict.dictValue"
  269. ></el-option>
  270. </el-select>
  271. </el-form-item>
  272. </el-form>
  273. <div slot="footer" class="dialog-footer">
  274. <el-button type="primary" @click="submitForm">确 定</el-button>
  275. <el-button @click="cancel">取 消</el-button>
  276. </div>
  277. </el-dialog>
  278. </div>
  279. </template>
  280. <script>
  281. import { listShopinve, getShopinve, delShopinve, addShopinve, updateShopinve, exportShopinve,pullStoreInvemng } from "@/api/warehouse/shopinve";
  282. import {pullInvemng} from "@/api/warehouse/invemng";
  283. export default {
  284. name: "Shopinve",
  285. components: {
  286. },
  287. data() {
  288. return {
  289. // 遮罩层
  290. loading: true,
  291. // 选中数组
  292. ids: [],
  293. // 非单个禁用
  294. single: true,
  295. // 非多个禁用
  296. multiple: true,
  297. // 显示搜索条件
  298. showSearch: true,
  299. // 总条数
  300. total: 0,
  301. // 商户店面库存,包括跨境,一般贸易表格数据
  302. shopinveList: [],
  303. // 弹出层标题
  304. title: "",
  305. // 是否显示弹出层
  306. open: false,
  307. // 海关代码字典
  308. cusCodeOptions: [],
  309. // 保税仓代码字典
  310. bondedCodeOptions: [],
  311. // 货品业务类型字典
  312. goodsBizTypeOptions: [],
  313. // 是否有效字典
  314. isValidOptions: [],
  315. // 查询参数
  316. queryParams: {
  317. pageNum: 1,
  318. pageSize: 10,
  319. shopSn: null,
  320. merchSn: null,
  321. merchName: null,
  322. thirdPartyMerchCode: null,
  323. thirdPartyMerchName: null,
  324. sku: null,
  325. cusCode: null,
  326. bondedCode: null,
  327. wareSn: null,
  328. goodsBizType: null,
  329. isValid: null,
  330. shopName:null
  331. },
  332. // 表单参数
  333. form: {},
  334. // 表单校验
  335. rules: {
  336. }
  337. };
  338. },
  339. created() {
  340. this.getList();
  341. this.getDicts("cus_code").then(response => {
  342. this.cusCodeOptions = response.data;
  343. });
  344. this.getDicts("bonded_code").then(response => {
  345. this.bondedCodeOptions = response.data;
  346. });
  347. this.getDicts("goods_biz_type").then(response => {
  348. this.goodsBizTypeOptions = response.data;
  349. });
  350. this.getDicts("valid").then(response => {
  351. this.isValidOptions = response.data;
  352. });
  353. },
  354. methods: {
  355. /** 查询商户店面库存,包括跨境,一般贸易列表 */
  356. getList() {
  357. this.loading = true;
  358. listShopinve(this.queryParams).then(response => {
  359. this.shopinveList = response.rows;
  360. this.total = response.total;
  361. this.loading = false;
  362. });
  363. },
  364. // 海关代码字典翻译
  365. cusCodeFormat(row, column) {
  366. return this.selectDictLabel(this.cusCodeOptions, row.cusCode);
  367. },
  368. // 保税仓代码字典翻译
  369. bondedCodeFormat(row, column) {
  370. return this.selectDictLabel(this.bondedCodeOptions, row.bondedCode);
  371. },
  372. // 货品业务类型字典翻译
  373. goodsBizTypeFormat(row, column) {
  374. return this.selectDictLabel(this.goodsBizTypeOptions, row.goodsBizType);
  375. },
  376. // 是否有效字典翻译
  377. isValidFormat(row, column) {
  378. return this.selectDictLabel(this.isValidOptions, row.isValid);
  379. },
  380. // 取消按钮
  381. cancel() {
  382. this.open = false;
  383. this.reset();
  384. },
  385. // 表单重置
  386. reset() {
  387. this.form = {
  388. shopInveSn: null,
  389. shopSn: null,
  390. merchSn: null,
  391. merchName: null,
  392. thirdPartyMerchCode: null,
  393. thirdPartyMerchName: null,
  394. sku: null,
  395. cusCode: null,
  396. bondedCode: null,
  397. wareSn: null,
  398. goodsBizType: null,
  399. shopInve: null,
  400. shopValid: null,
  401. shopFreezeNum: null,
  402. shopDamageNum: null,
  403. shopDestroyLostNum: null,
  404. shopExpireNum: null,
  405. shopSampleFreezeNum: null,
  406. shopMinus: null,
  407. shopSupp: null,
  408. inQty: null,
  409. outQty: null,
  410. returnQty: null,
  411. saleQty: null,
  412. locInQty: null,
  413. locOutQty: null,
  414. isValid: null,
  415. createrSn: null,
  416. createTime: null,
  417. moderSn: null,
  418. modTime: null,
  419. tstm: null
  420. };
  421. this.resetForm("form");
  422. },
  423. /** 搜索按钮操作 */
  424. handleQuery() {
  425. this.queryParams.pageNum = 1;
  426. this.getList();
  427. },
  428. /** 重置按钮操作 */
  429. resetQuery() {
  430. this.resetForm("queryForm");
  431. this.handleQuery();
  432. },
  433. // 多选框选中数据
  434. handleSelectionChange(selection) {
  435. this.ids = selection.map(item => item.shopInveSn)
  436. this.single = selection.length!==1
  437. this.multiple = !selection.length
  438. },
  439. /** 新增按钮操作 */
  440. handleAdd() {
  441. this.reset();
  442. this.open = true;
  443. this.title = "添加商户店面库存,包括跨境,一般贸易";
  444. },
  445. /** 修改按钮操作 */
  446. handleUpdate(row) {
  447. this.reset();
  448. const shopInveSn = row.shopInveSn || this.ids
  449. getShopinve(shopInveSn).then(response => {
  450. this.form = response.data;
  451. this.open = true;
  452. this.title = "修改商户店面库存,包括跨境,一般贸易";
  453. });
  454. },
  455. /** 提交按钮 */
  456. submitForm() {
  457. this.$refs["form"].validate(valid => {
  458. if (valid) {
  459. if (this.form.shopInveSn != null) {
  460. updateShopinve(this.form).then(response => {
  461. this.msgSuccess("修改成功");
  462. this.open = false;
  463. this.getList();
  464. });
  465. } else {
  466. addShopinve(this.form).then(response => {
  467. this.msgSuccess("新增成功");
  468. this.open = false;
  469. this.getList();
  470. });
  471. }
  472. }
  473. });
  474. },
  475. /** 删除按钮操作 */
  476. handleDelete(row) {
  477. const shopInveSns = row.shopInveSn || this.ids;
  478. this.$confirm('是否确认删除商户店面库存,包括跨境,一般贸易编号为"' + shopInveSns + '"的数据项?', "警告", {
  479. confirmButtonText: "确定",
  480. cancelButtonText: "取消",
  481. type: "warning"
  482. }).then(function() {
  483. return delShopinve(shopInveSns);
  484. }).then(() => {
  485. this.getList();
  486. this.msgSuccess("删除成功");
  487. })
  488. },
  489. /** 导出按钮操作 */
  490. handleExport() {
  491. const queryParams = this.queryParams;
  492. this.$confirm('是否确认导出所有商户店面库存?', "警告", {
  493. confirmButtonText: "确定",
  494. cancelButtonText: "取消",
  495. type: "warning"
  496. }).then(function() {
  497. return exportShopinve(queryParams);
  498. }).then(response => {
  499. this.download(response.msg);
  500. })
  501. },
  502. /** 拉取按钮操作 */
  503. handlePull() {
  504. const queryParams = this.queryParams;
  505. // 添加遮罩
  506. const _this=this
  507. this.$confirm('是否确认拉取保税仓所有库存?', "警告", {
  508. confirmButtonText: "确定",
  509. cancelButtonText: "取消",
  510. type: "warning"
  511. }).then(function() {
  512. const loading = _this.$loading({
  513. lock: true,
  514. text: 'Loading',
  515. spinner: 'el-icon-loading',
  516. background: 'rgba(0, 0, 0, 0.7)'
  517. });
  518. return pullStoreInvemng(queryParams,loading,_this);
  519. })
  520. }
  521. }
  522. };
  523. </script>