index.vue 15 KB

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