1
0

index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  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="shopTransSn">-->
  5. <!-- <el-input-->
  6. <!-- v-model="queryParams.shopTransSn"-->
  7. <!-- placeholder="请输入门店调拨编号"-->
  8. <!-- clearable-->
  9. <!-- size="small"-->
  10. <!-- @keyup.enter.native="handleQuery"-->
  11. <!-- />-->
  12. <!-- </el-form-item>-->
  13. <!-- <el-form-item label="仓库编号" prop="wareSn">-->
  14. <!-- <el-input-->
  15. <!-- v-model="queryParams.wareSn"-->
  16. <!-- placeholder="请输入仓库编号"-->
  17. <!-- clearable-->
  18. <!-- size="small"-->
  19. <!-- @keyup.enter.native="handleQuery"-->
  20. <!-- />-->
  21. <!-- </el-form-item>-->
  22. <!-- <el-form-item label="库存编号" prop="inveSn">-->
  23. <!-- <el-input-->
  24. <!-- v-model="queryParams.inveSn"-->
  25. <!-- placeholder="请输入库存编号"-->
  26. <!-- clearable-->
  27. <!-- size="small"-->
  28. <!-- @keyup.enter.native="handleQuery"-->
  29. <!-- />-->
  30. <!-- </el-form-item>-->
  31. <el-form-item label="门店名称" prop="shopName">
  32. <el-input
  33. v-model="queryParams.shopName"
  34. placeholder="请输入门店名称"
  35. clearable
  36. size="small"
  37. @keyup.enter.native="handleQuery"
  38. />
  39. </el-form-item>
  40. <!-- <el-form-item label="商户编号" prop="merchSn">-->
  41. <!-- <el-input-->
  42. <!-- v-model="queryParams.merchSn"-->
  43. <!-- placeholder="请输入商户编号"-->
  44. <!-- clearable-->
  45. <!-- size="small"-->
  46. <!-- @keyup.enter.native="handleQuery"-->
  47. <!-- />-->
  48. <!-- </el-form-item>-->
  49. <!-- <el-form-item label="商户名称" prop="merchName">-->
  50. <!-- <el-input-->
  51. <!-- v-model="queryParams.merchName"-->
  52. <!-- placeholder="请输入商户名称"-->
  53. <!-- clearable-->
  54. <!-- size="small"-->
  55. <!-- @keyup.enter.native="handleQuery"-->
  56. <!-- />-->
  57. <!-- </el-form-item>-->
  58. <!-- <el-form-item label="第三方商户代码" prop="thirdPartyMerchCode">-->
  59. <!-- <el-input-->
  60. <!-- v-model="queryParams.thirdPartyMerchCode"-->
  61. <!-- placeholder="请输入第三方商户代码"-->
  62. <!-- clearable-->
  63. <!-- size="small"-->
  64. <!-- @keyup.enter.native="handleQuery"-->
  65. <!-- />-->
  66. <!-- </el-form-item>-->
  67. <!-- <el-form-item label="第三方商户名称" prop="thirdPartyMerchName">-->
  68. <!-- <el-input-->
  69. <!-- v-model="queryParams.thirdPartyMerchName"-->
  70. <!-- placeholder="请输入第三方商户名称"-->
  71. <!-- clearable-->
  72. <!-- size="small"-->
  73. <!-- @keyup.enter.native="handleQuery"-->
  74. <!-- />-->
  75. <!-- </el-form-item>-->
  76. <!-- <el-form-item label="门店类型" prop="shopType">-->
  77. <!-- <el-select v-model="queryParams.shopType" placeholder="请选择门店类型" clearable size="small">-->
  78. <!-- <el-option-->
  79. <!-- v-for="dict in shopTypeOptions"-->
  80. <!-- :key="dict.dictValue"-->
  81. <!-- :label="dict.dictLabel"-->
  82. <!-- :value="dict.dictValue"-->
  83. <!-- />-->
  84. <!-- </el-select>-->
  85. <!-- </el-form-item>-->
  86. <el-form-item label="SKU" prop="sku">
  87. <el-input
  88. v-model="queryParams.sku"
  89. placeholder="请输入SKU"
  90. clearable
  91. size="small"
  92. @keyup.enter.native="handleQuery"
  93. />
  94. </el-form-item>
  95. <!-- <el-form-item label="货品业务类型" prop="goodsBizType">-->
  96. <!-- <el-select v-model="queryParams.goodsBizType" placeholder="请选择货品业务类型" clearable size="small">-->
  97. <!-- <el-option-->
  98. <!-- v-for="dict in goodsBizTypeOptions"-->
  99. <!-- :key="dict.dictValue"-->
  100. <!-- :label="dict.dictLabel"-->
  101. <!-- :value="dict.dictValue"-->
  102. <!-- />-->
  103. <!-- </el-select>-->
  104. <!-- </el-form-item>-->
  105. <el-form-item>
  106. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  107. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  108. </el-form-item>
  109. </el-form>
  110. <el-row :gutter="10" class="mb8">
  111. <!-- <el-col :span="1.5">-->
  112. <!-- <el-button-->
  113. <!-- type="primary"-->
  114. <!-- icon="el-icon-plus"-->
  115. <!-- size="mini"-->
  116. <!-- @click="handleAdd"-->
  117. <!-- v-hasPermi="['biz:shopout:add']"-->
  118. <!-- >新增</el-button>-->
  119. <!-- </el-col>-->
  120. <!-- <el-col :span="1.5">-->
  121. <!-- <el-button-->
  122. <!-- type="success"-->
  123. <!-- icon="el-icon-edit"-->
  124. <!-- size="mini"-->
  125. <!-- :disabled="single"-->
  126. <!-- @click="handleUpdate"-->
  127. <!-- v-hasPermi="['biz:shopout:edit']"-->
  128. <!-- >修改</el-button>-->
  129. <!-- </el-col>-->
  130. <!-- <el-col :span="1.5">-->
  131. <!-- <el-button-->
  132. <!-- type="danger"-->
  133. <!-- icon="el-icon-delete"-->
  134. <!-- size="mini"-->
  135. <!-- :disabled="multiple"-->
  136. <!-- @click="handleDelete"-->
  137. <!-- v-hasPermi="['biz:shopout:remove']"-->
  138. <!-- >删除</el-button>-->
  139. <!-- </el-col>-->
  140. <el-col :span="1.5">
  141. <el-button
  142. type="warning"
  143. icon="el-icon-download"
  144. size="mini"
  145. @click="handleExport"
  146. v-hasPermi="['biz:shopout:export']"
  147. >导出</el-button>
  148. </el-col>
  149. <el-col :span="1.5">
  150. <el-button
  151. type="warning"
  152. icon="el-icon-download"
  153. size="mini"
  154. @click="handlePull"
  155. v-hasPermi="['biz:shopout:pull']"
  156. >拉取</el-button>
  157. </el-col>
  158. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  159. </el-row>
  160. <el-table v-loading="loading" :data="shopoutList" @selection-change="handleSelectionChange">
  161. <el-table-column type="selection" width="55" align="center" />
  162. <!-- <el-table-column label="门店出场编号" align="center" prop="shopOutSn" />-->
  163. <!-- <el-table-column label="门店调拨编号" align="center" prop="shopTransSn" />-->
  164. <!-- <el-table-column label="仓库编号" align="center" prop="wareSn" />-->
  165. <!-- <el-table-column label="库存编号" align="center" prop="inveSn" />-->
  166. <el-table-column label="门店编号" align="center" prop="shopSn" />
  167. <el-table-column label="门店名称" align="center" prop="shopName" />
  168. <!-- <el-table-column label="商户编号" align="center" prop="merchSn" />-->
  169. <!-- <el-table-column label="商户名称" align="center" prop="merchName" />-->
  170. <!-- <el-table-column label="第三方商户代码" align="center" prop="thirdPartyMerchCode" />-->
  171. <!-- <el-table-column label="第三方商户名称" align="center" prop="thirdPartyMerchName" />-->
  172. <!-- <el-table-column label="门店类型" align="center" prop="shopType" :formatter="shopTypeFormat" />-->
  173. <el-table-column label="SKU" align="center" prop="sku" />
  174. <!-- <el-table-column label="货品业务类型" align="center" prop="goodsBizType" :formatter="goodsBizTypeFormat" />-->
  175. <el-table-column label="出场数量" align="center" prop="inOutNum" />
  176. <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
  177. <!-- <template slot-scope="scope">-->
  178. <!-- <el-button-->
  179. <!-- size="mini"-->
  180. <!-- type="text"-->
  181. <!-- icon="el-icon-edit"-->
  182. <!-- @click="handleUpdate(scope.row)"-->
  183. <!-- v-hasPermi="['biz:shopout:edit']"-->
  184. <!-- >修改</el-button>-->
  185. <!-- <el-button-->
  186. <!-- size="mini"-->
  187. <!-- type="text"-->
  188. <!-- icon="el-icon-delete"-->
  189. <!-- @click="handleDelete(scope.row)"-->
  190. <!-- v-hasPermi="['biz:shopout:remove']"-->
  191. <!-- >删除</el-button>-->
  192. <!-- </template>-->
  193. <!-- </el-table-column>-->
  194. </el-table>
  195. <pagination
  196. v-show="total>0"
  197. :total="total"
  198. :page.sync="queryParams.pageNum"
  199. :limit.sync="queryParams.pageSize"
  200. @pagination="getList"
  201. />
  202. <!-- 添加或修改商户门店出场记录,全部类型门店(WMS回调后写入)对话框 -->
  203. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  204. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  205. </el-form>
  206. <div slot="footer" class="dialog-footer">
  207. <el-button type="primary" @click="submitForm">确 定</el-button>
  208. <el-button @click="cancel">取 消</el-button>
  209. </div>
  210. </el-dialog>
  211. </div>
  212. </template>
  213. <script>
  214. import { listShopout, getShopout, delShopout, addShopout, updateShopout, exportShopout,pullShopOutRecord } from "@/api/warehouse/shopout";
  215. import {pullShopInRecord} from "@/api/warehouse/shopin";
  216. export default {
  217. name: "Shopout",
  218. components: {
  219. },
  220. data() {
  221. return {
  222. // 遮罩层
  223. loading: true,
  224. // 选中数组
  225. ids: [],
  226. // 非单个禁用
  227. single: true,
  228. // 非多个禁用
  229. multiple: true,
  230. // 显示搜索条件
  231. showSearch: true,
  232. // 总条数
  233. total: 0,
  234. // 商户门店出场记录,全部类型门店(WMS回调后写入)表格数据
  235. shopoutList: [],
  236. // 弹出层标题
  237. title: "",
  238. // 是否显示弹出层
  239. open: false,
  240. // 门店类型字典
  241. shopTypeOptions: [],
  242. // 货品业务类型字典
  243. goodsBizTypeOptions: [],
  244. // 查询参数
  245. queryParams: {
  246. pageNum: 1,
  247. pageSize: 10,
  248. shopTransSn: null,
  249. wareSn: null,
  250. inveSn: null,
  251. shopSn: null,
  252. merchSn: null,
  253. merchName: null,
  254. thirdPartyMerchCode: null,
  255. thirdPartyMerchName: null,
  256. shopType: null,
  257. sku: null,
  258. goodsBizType: null,
  259. },
  260. // 表单参数
  261. form: {},
  262. // 表单校验
  263. rules: {
  264. }
  265. };
  266. },
  267. created() {
  268. this.getList();
  269. this.getDicts("shop_type").then(response => {
  270. this.shopTypeOptions = response.data;
  271. });
  272. this.getDicts("goods_biz_type").then(response => {
  273. this.goodsBizTypeOptions = response.data;
  274. });
  275. },
  276. methods: {
  277. /** 查询商户门店出场记录,全部类型门店(WMS回调后写入)列表 */
  278. getList() {
  279. this.loading = true;
  280. listShopout(this.queryParams).then(response => {
  281. this.shopoutList = response.rows;
  282. this.total = response.total;
  283. this.loading = false;
  284. });
  285. },
  286. // 门店类型字典翻译
  287. shopTypeFormat(row, column) {
  288. return this.selectDictLabel(this.shopTypeOptions, row.shopType);
  289. },
  290. // 货品业务类型字典翻译
  291. goodsBizTypeFormat(row, column) {
  292. return this.selectDictLabel(this.goodsBizTypeOptions, row.goodsBizType);
  293. },
  294. // 取消按钮
  295. cancel() {
  296. this.open = false;
  297. this.reset();
  298. },
  299. // 表单重置
  300. reset() {
  301. this.form = {
  302. shopOutSn: null,
  303. shopTransSn: null,
  304. wareSn: null,
  305. inveSn: null,
  306. shopSn: null,
  307. merchSn: null,
  308. merchName: null,
  309. thirdPartyMerchCode: null,
  310. thirdPartyMerchName: null,
  311. shopType: null,
  312. sku: null,
  313. goodsBizType: null,
  314. inOutNum: null,
  315. createrSn: null,
  316. createTime: null,
  317. moderSn: null,
  318. modTime: null,
  319. tstm: null
  320. };
  321. this.resetForm("form");
  322. },
  323. /** 搜索按钮操作 */
  324. handleQuery() {
  325. this.queryParams.pageNum = 1;
  326. this.getList();
  327. },
  328. /** 重置按钮操作 */
  329. resetQuery() {
  330. this.resetForm("queryForm");
  331. this.handleQuery();
  332. },
  333. // 多选框选中数据
  334. handleSelectionChange(selection) {
  335. this.ids = selection.map(item => item.shopOutSn)
  336. this.single = selection.length!==1
  337. this.multiple = !selection.length
  338. },
  339. /** 新增按钮操作 */
  340. handleAdd() {
  341. this.reset();
  342. this.open = true;
  343. this.title = "添加商户门店出场记录,全部类型门店(WMS回调后写入)";
  344. },
  345. /** 修改按钮操作 */
  346. handleUpdate(row) {
  347. this.reset();
  348. const shopOutSn = row.shopOutSn || this.ids
  349. getShopout(shopOutSn).then(response => {
  350. this.form = response.data;
  351. this.open = true;
  352. this.title = "修改商户门店出场记录,全部类型门店(WMS回调后写入)";
  353. });
  354. },
  355. /** 提交按钮 */
  356. submitForm() {
  357. this.$refs["form"].validate(valid => {
  358. if (valid) {
  359. if (this.form.shopOutSn != null) {
  360. updateShopout(this.form).then(response => {
  361. this.msgSuccess("修改成功");
  362. this.open = false;
  363. this.getList();
  364. });
  365. } else {
  366. addShopout(this.form).then(response => {
  367. this.msgSuccess("新增成功");
  368. this.open = false;
  369. this.getList();
  370. });
  371. }
  372. }
  373. });
  374. },
  375. /** 删除按钮操作 */
  376. handleDelete(row) {
  377. const shopOutSns = row.shopOutSn || this.ids;
  378. this.$confirm('是否确认删除商户门店出场记录,全部类型门店(WMS回调后写入)编号为"' + shopOutSns + '"的数据项?', "警告", {
  379. confirmButtonText: "确定",
  380. cancelButtonText: "取消",
  381. type: "warning"
  382. }).then(function() {
  383. return delShopout(shopOutSns);
  384. }).then(() => {
  385. this.getList();
  386. this.msgSuccess("删除成功");
  387. })
  388. },
  389. /** 导出按钮操作 */
  390. handleExport() {
  391. const queryParams = this.queryParams;
  392. this.$confirm('是否确认导出所有商户门店出场记录,全部类型门店(WMS回调后写入)数据项?', "警告", {
  393. confirmButtonText: "确定",
  394. cancelButtonText: "取消",
  395. type: "warning"
  396. }).then(function() {
  397. return exportShopout(queryParams);
  398. }).then(response => {
  399. this.download(response.msg);
  400. })
  401. },
  402. /** 拉取按钮操作 */
  403. handlePull() {
  404. const queryParams = this.queryParams;
  405. // 添加遮罩
  406. const _this=this
  407. this.$confirm('是否确认拉取门店出场记录?', "警告", {
  408. confirmButtonText: "确定",
  409. cancelButtonText: "取消",
  410. type: "warning"
  411. }).then(function() {
  412. const loading = _this.$loading({
  413. lock: true,
  414. text: 'Loading',
  415. spinner: 'el-icon-loading',
  416. background: 'rgba(0, 0, 0, 0.7)'
  417. });
  418. return pullShopOutRecord(queryParams,loading,_this);
  419. }).then(function(){
  420. _this.handleQuery();
  421. })
  422. }
  423. }
  424. };
  425. </script>