index.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <script>
  2. import test from "@/components/form-test/index.vue";
  3. import query from "@/components/query/index.vue";
  4. import * as API from "@/api/inbound-outbound/transfer.js";
  5. import { warehouseSelectList } from "@/api/product-material/warehouse/index.js";
  6. import addInspection from "./addInspection.vue";
  7. export default {
  8. components: {
  9. test,
  10. query,
  11. addInspection,
  12. },
  13. data() {
  14. return {
  15. warehouseSelectList: [],
  16. warehouseTypeList: [],
  17. btnForm: {
  18. otherButton: {
  19. list: [
  20. {
  21. name: "发起调仓",
  22. methodsText: "send",
  23. type: "primary",
  24. send: () => {
  25. this.handleSend();
  26. },
  27. },
  28. ],
  29. },
  30. },
  31. queryParams: {
  32. pageNum: 1,
  33. pageSize: 10,
  34. keyword: "",
  35. outWarehouseId: "",
  36. inWarehouseId: "",
  37. inStatus: "",
  38. },
  39. selectConfig: [
  40. {
  41. label: "异常来源",
  42. prop: "outWarehouseId",
  43. data: [],
  44. },
  45. {
  46. label: "处理状态",
  47. prop: "outWarehouseId",
  48. data: [],
  49. },
  50. ],
  51. tableList: [],
  52. total: 0,
  53. loading: false,
  54. titleText: "异常跟进",
  55. open: false,
  56. form: {
  57. outWarehouseId: "",
  58. inWarehouseId: "",
  59. remark: "",
  60. changeProductList: [],
  61. },
  62. };
  63. },
  64. created() {
  65. const businessDictData = JSON.parse(
  66. window.localStorage.getItem("businessDict")
  67. );
  68. this.warehouseTypeList = businessDictData.find(
  69. (item) => item.code === "warehouseType"
  70. ).children;
  71. warehouseSelectList().then((res) => {
  72. this.warehouseSelectList = res.data.data;
  73. this.selectConfig[0].data = this.warehouseSelectList.map((item) => ({
  74. label: item.name,
  75. value: item.id,
  76. }));
  77. this.selectConfig[1].data = this.warehouseSelectList.map((item) => ({
  78. label: item.name,
  79. value: item.id,
  80. }));
  81. });
  82. this.getList();
  83. },
  84. methods: {
  85. getList() {
  86. this.loading = true;
  87. API.transferList(this.queryParams).then(
  88. (res) => {
  89. this.tableList = res.data.data.records;
  90. this.total = res.data.data.total;
  91. this.loading = false;
  92. },
  93. (err) => {
  94. console.log("transferList: " + err);
  95. this.loading = false;
  96. }
  97. );
  98. },
  99. handleQuery() {
  100. this.getList();
  101. },
  102. handleSend() {
  103. this.form = {
  104. outWarehouseId: "",
  105. inWarehouseId: "",
  106. remark: "",
  107. changeProductList: [],
  108. };
  109. this.open = true;
  110. },
  111. handleCancel() {
  112. this.form = {
  113. outWarehouseId: "",
  114. inWarehouseId: "",
  115. remark: "",
  116. changeProductList: [],
  117. };
  118. this.open = false;
  119. },
  120. handleSubmit() {
  121. API.addInspection(this.form).then(
  122. () => {
  123. this.msgSuccess(this.$t("addSuccess"));
  124. this.$refs.addInspection.loading = false;
  125. this.open = false;
  126. this.getList();
  127. },
  128. (err) => {
  129. console.log("addInspection: " + err);
  130. this.$refs.addInspection.loading = false;
  131. }
  132. );
  133. },
  134. handleReceive(row) {
  135. this.open = true;
  136. // this.$confirm("是否确认接收 ?", {
  137. // confirmButtonText: this.$t("submitText"),
  138. // cancelButtonText: this.$t("cancelText"),
  139. // type: "warning",
  140. // }).then(() => {
  141. // API.receive({ id: row.id, inQuantity: row.outQuantity }).then(() => {
  142. // this.msgSuccess("接收成功");
  143. // this.getList();
  144. // });
  145. // });
  146. },
  147. showAddress(row) {
  148. return (
  149. <div>
  150. {row.countryName} , {row.provinceName} , {row.cityName}
  151. </div>
  152. );
  153. },
  154. },
  155. };
  156. </script>
  157. <template>
  158. <div class="box-card">
  159. <el-card class="body-main">
  160. <query
  161. :selectConfig="selectConfig"
  162. :req="queryParams"
  163. :isShowMore="true"
  164. @handleQuery="handleQuery"
  165. @handleMore="
  166. () => {
  167. queryDialog = true;
  168. }
  169. "
  170. ></query>
  171. <el-table :data="tableList" v-loading="loading">
  172. <el-table-column
  173. label="异常来源"
  174. align="left"
  175. prop="code"
  176. width="120"
  177. />
  178. <el-table-column label="异常说明" align="left" prop="name" />
  179. <el-table-column
  180. label="处理状态"
  181. align="left"
  182. prop="specs"
  183. width="100"
  184. />
  185. <el-table-column
  186. label="最近操作人"
  187. align="left"
  188. prop="outQuantity"
  189. width="120"
  190. />
  191. <el-table-column
  192. label="最近操作时间"
  193. align="left"
  194. prop="outUserName"
  195. width="160"
  196. />
  197. <el-table-column label="操作" align="center" width="120">
  198. <template slot-scope="scope">
  199. <el-button type="text" @click="handleReceive(scope.row)"
  200. >跟进
  201. </el-button>
  202. </template>
  203. </el-table-column>
  204. </el-table>
  205. <pagination
  206. v-show="total > 0"
  207. :total="total"
  208. :page.sync="queryParams.pageNum"
  209. :limit.sync="queryParams.pageSize"
  210. @pagination="getList"
  211. />
  212. </el-card>
  213. <el-dialog
  214. :title="titleText"
  215. :visible.sync="open"
  216. v-if="open"
  217. width="30%"
  218. top="60px"
  219. >
  220. <add-inspection
  221. :form="form"
  222. @submit="handleSubmit"
  223. @cancel="handleCancel"
  224. ref="addInspection"
  225. ></add-inspection>
  226. </el-dialog>
  227. </div>
  228. </template>
  229. <style lang="scss" scoped>
  230. .box-card {
  231. height: calc(100vh - 110px);
  232. overflow-y: auto;
  233. display: flex;
  234. flex-direction: column;
  235. .header {
  236. // height: 100px;
  237. margin-bottom: 10px;
  238. box-sizing: border-box;
  239. }
  240. .body-main {
  241. flex: 1;
  242. }
  243. }
  244. </style>