index.vue 13 KB

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