index.vue 15 KB

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