index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. <template>
  2. <div class="tenant">
  3. <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
  4. :selectConfig="selectConfig" :table-events="{
  5. select: select,
  6. }" :action-list="[]" @get-list="getList" @moreSearch="() => (queryDialogVisible = true)">
  7. </byTable>
  8. <!--详情-->
  9. <el-dialog z-index="1100" title="退货单详情" v-if="dialogVisible" v-model="formData.data" width="1500px" v-loading="loading">
  10. <el-descriptions title="基础信息" />
  11. <el-form label-width="auto" :rules="rules">
  12. <el-row>
  13. <el-col :span="8">
  14. <el-form-item label="退货单号:" :span="8">
  15. {{formData.data.returnId}}
  16. </el-form-item>
  17. </el-col>
  18. <el-col :span="8">
  19. <el-form-item label="供应商名称:" :span="8">
  20. {{formData.data.providerName}}
  21. </el-form-item>
  22. </el-col>
  23. <el-col :span="8">
  24. <el-form-item label="创建日期:" :span="8">
  25. {{formData.data.createDate}}
  26. </el-form-item>
  27. </el-col>
  28. </el-row>
  29. <el-row>
  30. <el-col :span="8">
  31. <el-form-item label="退货地配送中心名称:" :span="8">
  32. {{formData.data.fromDeliverCenterName}}
  33. </el-form-item>
  34. </el-col>
  35. <el-col :span="8">
  36. <el-form-item label="目的地配送中心名称:" :span="8">
  37. {{formData.data.toDeliverCenterName}}
  38. </el-form-item>
  39. </el-col>
  40. <el-col :span="8">
  41. <el-form-item label="退货单状态名称:" :span="8">
  42. {{formData.data.returnStateName}}
  43. </el-form-item>
  44. </el-col>
  45. </el-row>
  46. <el-row>
  47. <el-col :span="8">
  48. <el-form-item label="退货总数量:" :span="8">
  49. {{formData.data.totalNum}}
  50. </el-form-item>
  51. </el-col>
  52. <el-col :span="8">
  53. <el-form-item label="退货总金额:" :span="8">
  54. {{formData.data.totalPrice}}
  55. </el-form-item>
  56. </el-col>
  57. <el-col :span="8">
  58. <el-form-item label="商品库房名称:" :span="8">
  59. {{formData.data.stockName}}
  60. </el-form-item>
  61. </el-col>
  62. </el-row>
  63. <el-row>
  64. <el-col :span="8">
  65. <el-form-item label="退货地仓库地址:" :span="8">
  66. {{formData.data.wareHouseAddress}}
  67. </el-form-item>
  68. </el-col>
  69. <el-col :span="8">
  70. <el-form-item label="仓储联系人电话:" :span="8">
  71. {{formData.data.wareHouseCell}}
  72. </el-form-item>
  73. </el-col>
  74. <el-col :span="8">
  75. <el-form-item label="仓储联系人:" :span="8">
  76. {{formData.data.wareHouseContact}}
  77. </el-form-item>
  78. </el-col>
  79. </el-row>
  80. <el-row>
  81. <el-col :span="8">
  82. <el-form-item label="退货单出库时间:" :span="8">
  83. {{formData.data.outStoreRoomDate}}
  84. </el-form-item>
  85. </el-col>
  86. <el-col :span="8">
  87. <el-form-item label="退货单品种数:" :span="8">
  88. {{formData.data.wareVariety}}
  89. </el-form-item>
  90. </el-col>
  91. <el-col :span="8">
  92. <el-form-item label="退货结算状态名称:" :span="8">
  93. {{formData.data.balanceStateName}}
  94. </el-form-item>
  95. </el-col>
  96. </el-row>
  97. <el-row>
  98. <el-col :span="8">
  99. <el-form-item label="退货单结算时间:" :span="8">
  100. {{formData.data.balanceDate}}
  101. </el-form-item>
  102. </el-col>
  103. </el-row>
  104. <el-row>
  105. <el-descriptions title="退货单明细" />
  106. <el-table :data="formData.data.jdBackDetailsList" stripe style="width: 100%">
  107. <!-- <el-table stripe style="width: 100%">-->
  108. <el-table-column prop="wareId" label="京东商品编号" width="180">
  109. <template #default="scope">
  110. <span
  111. :style="scope.row.productName=='' || scope.row.productName == undefined || scope.row.productName == 'undefined'?'color: red':''">{{scope.row.wareId}}</span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column prop="wareName" label="京东商品名称">
  115. <template #default="scope">
  116. <span
  117. :style="scope.row.productName=='' || scope.row.productName == undefined || scope.row.productName == 'undefined'?'color: red':''">{{scope.row.wareName}}</span>
  118. </template>
  119. </el-table-column>
  120. <el-table-column prop="brandName" label="京东品牌名称" />
  121. <el-table-column prop="productName" label="产品名称" />
  122. <el-table-column prop="returnsPrice" label="申请退货价格" />
  123. <el-table-column prop="returnsNum" label="申请退货数量" />
  124. <el-table-column prop="factNum" label="实际退货数量" />
  125. <el-table-column prop="totalPrice" label="退货总金额" />
  126. </el-table>
  127. </el-row>
  128. </el-form>
  129. <template #footer>
  130. <el-button @click="dialogVisible = false" size="large">取 消</el-button>
  131. </template>
  132. </el-dialog>
  133. <!--高级搜索-->
  134. <el-dialog :title="'高级检索'" v-model="queryDialogVisible" width="500px" destroy-on-close>
  135. <el-form :model="sourceList.pagination" label-width="100px" label-position="top">
  136. <el-form-item label="退货单号">
  137. <el-input v-model="sourceList.pagination.returnId" placeholder="请输入退货单号" />
  138. </el-form-item>
  139. </el-form>
  140. <template #footer>
  141. <el-button @click="handleReset" size="large">重置</el-button>
  142. <el-button @click="handleQuery" type="primary" size="large">搜索</el-button>
  143. </template>
  144. </el-dialog>
  145. </div>
  146. </template>
  147. <script setup>
  148. import { ElMessage, ElMessageBox } from "element-plus";
  149. import byTable from "@/components/byTable/index";
  150. import byForm from "@/components/byForm/index";
  151. import { computed, nextTick, reactive, ref } from "vue";
  152. const { proxy } = getCurrentInstance();
  153. const router = useRouter();
  154. const loading = ref(false);
  155. const returnStates = ref([]);
  156. const submitLoading = ref(false);
  157. const sourceList = ref({
  158. data: [],
  159. pagination: {
  160. total: 0,
  161. pageNum: 1,
  162. pageSize: 10,
  163. },
  164. });
  165. let rules = ref({});
  166. let dialogVisible = ref(false);
  167. let queryDialogVisible = ref(false);
  168. let modalType = ref("add");
  169. const selectConfig = computed(() => {
  170. return [
  171. {
  172. label: "退货单状态",
  173. prop: "returnStateName",
  174. data: returnStates.value,
  175. },
  176. ];
  177. });
  178. const config = computed(() => {
  179. return [
  180. {
  181. attrs: {
  182. label: "退货单号",
  183. align: "left",
  184. width: 110,
  185. },
  186. renderHTML(row) {
  187. return [
  188. {
  189. attrs: {
  190. label: row.returnId,
  191. type: "primary",
  192. text: true,
  193. },
  194. el: "button",
  195. click() {
  196. getDtl(row);
  197. },
  198. },
  199. ];
  200. },
  201. },
  202. {
  203. attrs: {
  204. label: "创建日期",
  205. prop: "createDate",
  206. align: "left",
  207. width: 160,
  208. },
  209. },
  210. {
  211. attrs: {
  212. label: "供应商名称",
  213. prop: "providerName",
  214. align: "left",
  215. width: 220,
  216. },
  217. },
  218. {
  219. attrs: {
  220. label: "退货地配送中心名称",
  221. prop: "fromDeliverCenterName",
  222. align: "left",
  223. "min-width": 220,
  224. },
  225. },
  226. {
  227. attrs: {
  228. label: "目的地配送中心名称",
  229. prop: "toDeliverCenterName",
  230. align: "left",
  231. "min-width": 220,
  232. },
  233. },
  234. {
  235. attrs: {
  236. label: "退货总数量",
  237. prop: "totalNum",
  238. align: "left",
  239. width: 100,
  240. },
  241. },
  242. {
  243. attrs: {
  244. label: "退货总金额",
  245. prop: "totalPrice",
  246. align: "left",
  247. width: 110,
  248. },
  249. render(totalPrice) {
  250. return proxy.moneyFormat(totalPrice, 2);
  251. },
  252. },
  253. {
  254. attrs: {
  255. label: "退货单出库时间",
  256. prop: "outStoreRoomDate",
  257. align: "left",
  258. width: 155,
  259. },
  260. },
  261. {
  262. attrs: {
  263. label: "退货单品种数",
  264. prop: "wareVariety",
  265. align: "left",
  266. width: 110,
  267. },
  268. },
  269. {
  270. attrs: {
  271. label: "是否确认",
  272. prop: "businessStatus",
  273. align: "left",
  274. width: 80,
  275. },
  276. render(value) {
  277. return value == "1" ? "已确认" : "未确认";
  278. },
  279. },
  280. {
  281. attrs: {
  282. label: "操作",
  283. width: "100",
  284. align: "center",
  285. fixed: "right",
  286. },
  287. renderHTML(row) {
  288. return [
  289. // {
  290. // attrs: {
  291. // label: "详情",
  292. // type: "primary",
  293. // text: true,
  294. // },
  295. // el: "button",
  296. // click() {
  297. // getDtl(row);
  298. // },
  299. // },
  300. row.businessStatus != 1
  301. ? {
  302. attrs: {
  303. label: "退货单确认",
  304. type: "danger",
  305. text: true,
  306. },
  307. el: "button",
  308. click() {
  309. ElMessageBox.confirm("是否确认当前退货单?", "提示", {
  310. confirmButtonText: "确定",
  311. cancelButtonText: "取消",
  312. type: "warning",
  313. }).then(() => {
  314. confirmBusinessStatus(row);
  315. });
  316. },
  317. }
  318. : {},
  319. ];
  320. },
  321. },
  322. ];
  323. });
  324. let formData = reactive({
  325. data: {
  326. coverList: [],
  327. audioList: [],
  328. },
  329. });
  330. const formOption = reactive({
  331. inline: true,
  332. labelWidth: 100,
  333. itemWidth: 100,
  334. rules: [],
  335. });
  336. const getDictlist = async () => {
  337. proxy.getDictOne(["jd_return_states"]).then((res) => {
  338. returnStates.value = res["jd_return_states"].map((x) => ({
  339. label: x.dictValue,
  340. value: x.dictValue,
  341. }));
  342. });
  343. };
  344. const getList = async (req) => {
  345. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  346. loading.value = true;
  347. proxy.post("/jdBack/page", sourceList.value.pagination).then((res) => {
  348. sourceList.value.data = res.rows;
  349. sourceList.value.pagination.total = res.total;
  350. setTimeout(() => {
  351. loading.value = false;
  352. }, 200);
  353. });
  354. };
  355. const openModal = () => {
  356. dialogVisible.value = true;
  357. modalType.value = "add";
  358. formData.data = {
  359. content: "",
  360. };
  361. };
  362. const selection = ref({
  363. data: [],
  364. });
  365. const select = (_selection, row) => {
  366. selection.value.data = _selection;
  367. };
  368. const getDtl = (row) => {
  369. modalType.value = "edit";
  370. proxy.post("/jdBack/detail", { id: row.id }).then((res) => {
  371. formData.data = res;
  372. dialogVisible.value = true;
  373. });
  374. };
  375. const confirmBusinessStatus = (row) => {
  376. let businessStatus = row.businessStatus == "1" ? 0 : 1;
  377. proxy
  378. .post("/jdBack/confirmBusinessStatus", {
  379. id: row.id,
  380. businessStatus: businessStatus,
  381. })
  382. .then(
  383. () => {
  384. ElMessage({
  385. message: "确认成功",
  386. type: "success",
  387. });
  388. dialogVisible.value = false;
  389. submitLoading.value = false;
  390. getList();
  391. },
  392. (err) => {
  393. console.log(err);
  394. submitLoading.value = false;
  395. }
  396. );
  397. };
  398. //高级搜索
  399. const handleReset = () => {
  400. sourceList.value.pagination = {
  401. pageNum: sourceList.value.pagination.pageNum,
  402. pageSize: sourceList.value.pagination.pageSize,
  403. arr: [],
  404. };
  405. handleQuery();
  406. };
  407. const handleQuery = () => {
  408. if (
  409. sourceList.value.pagination.arr &&
  410. sourceList.value.pagination.arr.length > 1
  411. ) {
  412. sourceList.value.pagination.purchaseStartTime =
  413. sourceList.value.pagination.arr[0];
  414. sourceList.value.pagination.purchaseEndTime =
  415. sourceList.value.pagination.arr[1];
  416. }
  417. queryDialogVisible.value = false;
  418. getList();
  419. };
  420. getDictlist();
  421. getList();
  422. </script>
  423. <style lang='scss' scoped>
  424. .tenant {
  425. padding: 20px;
  426. }
  427. </style>