index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <div id="transferOrder">
  3. <div v-if="isList">
  4. <el-card style="position: relative" v-loading="loading">
  5. <el-super-search
  6. v-model="params"
  7. :size="size"
  8. :dict="dict"
  9. :columns="SearchColumns"
  10. @reset="resetList"
  11. @submit="getList(params, Pages)"
  12. ></el-super-search>
  13. <el-row class="my-4" style="text-align: right">
  14. <el-button-group style="margin-right: 5px">
  15. <el-button type="primary" :size="size" @click="back"
  16. >返回</el-button>
  17. <el-button type="primary" :size="size" @click="verify"
  18. >确认</el-button
  19. >
  20. </el-button-group>
  21. </el-row>
  22. <el-super-ux-table
  23. v-model="tableList"
  24. :size="size"
  25. :dict="dict"
  26. :page="Pages"
  27. :columns="TableColumns"
  28. index
  29. pagination
  30. height="400"
  31. showSummary
  32. convenitentOperation
  33. storage-key="TransferOrderSuperTable"
  34. @row-click="select"
  35. @pagination="getList(params, Pages)"
  36. >
  37. </el-super-ux-table>
  38. <el-tabs v-model="tabName" style="margin-top: 10px">
  39. <el-tab-pane
  40. v-for="({ item, TableColumns: columns }, index) in TabColumns"
  41. :key="index"
  42. :label="item.title"
  43. :name="item.key"
  44. lazy
  45. >
  46. <el-super-ux-table
  47. v-loading="itemLoading"
  48. index
  49. v-model="tabParams[item.key]"
  50. :ref="tabName"
  51. :height="tabHeight"
  52. :columns="columns"
  53. :size="size"
  54. ></el-super-ux-table>
  55. </el-tab-pane>
  56. </el-tabs>
  57. </el-card>
  58. </div>
  59. </div>
  60. </template>
  61. <script>
  62. import useColumns from "../columns";
  63. import { dicts } from "../dicts";
  64. import { getOrderList,listStAllotItem,bipPullVerify} from "@/api/purchase/transferOrder.js";
  65. export default {
  66. name: "transferOrder",
  67. dicts: [...dicts, "oa_templete_id"],
  68. components: {
  69. ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
  70. BatchImport: () => import("@/components/BatchImport/index.vue"),
  71. ElSuperSearch: () => import("@/components/super-search/index.vue"),
  72. },
  73. data() {
  74. const { TableColumns, TabColumns, SearchColumns } = useColumns();
  75. const Pages = this.$init.page();
  76. const params = this.$init.params(SearchColumns);
  77. return {
  78. params: {
  79. ...params,
  80. code: this.$route.query.billCode,
  81. },
  82. TableColumns: TableColumns,
  83. TabColumns: TabColumns,
  84. SearchColumns: SearchColumns,
  85. tabName: "materialInfo",
  86. size: "mini",
  87. Pages: Pages,
  88. loading: false,
  89. itemLoading: false,
  90. // 页面配置
  91. isList: true,
  92. // 页面状态
  93. page: "",
  94. referCondition: {
  95. type: "",
  96. isPage: true,
  97. title: "",
  98. },
  99. options: [
  100. {
  101. value: "1",
  102. label: "是",
  103. },
  104. {
  105. value: "0",
  106. label: "否",
  107. },
  108. ],
  109. tableList: [],
  110. // total: 0,
  111. tabParams: {
  112. materialInfo: [],
  113. receiveInfo: [],
  114. priceList: [],
  115. resultList: [],
  116. },
  117. rowDetail: {},
  118. disable: false,
  119. ids: [],
  120. //选择的行
  121. selectedRow:null
  122. };
  123. },
  124. computed: {
  125. tabHeight: {
  126. get() {
  127. let { materialInfo } = this.tabParams;
  128. return `${
  129. materialInfo.length
  130. ? materialInfo.length > 8
  131. ? 500
  132. : materialInfo * 36 + 120
  133. : 120
  134. }px`;
  135. },
  136. set() {},
  137. },
  138. },
  139. created() {
  140. this.getList(this.params, this.Pages);
  141. },
  142. methods: {
  143. resetList() {
  144. this.Pages = this.$init.page();
  145. const { SearchColumns } = useColumns();
  146. this.params = {
  147. ...this.$init.params(SearchColumns),
  148. code: this.$route.query.billCode,
  149. };
  150. this.getList(this.params, this.Pages);
  151. },
  152. getList(params, Pages) {
  153. this.loading = true;
  154. getOrderList({
  155. ...this.addDateRange(params, params.billDates),
  156. ...Pages,
  157. })
  158. .then((res) => {
  159. if (res.code === 200) {
  160. this.tableList = res.rows;
  161. this.Pages.total = res.total;
  162. }
  163. this.loading = false;
  164. })
  165. .then(() => {
  166. // 合计不显示重绘
  167. this.$refs.multipleTable.doLayout();
  168. })
  169. .catch((err) => {});
  170. },
  171. getlistStAllotItem(pid) {
  172. this.itemLoading = true;
  173. listStAllotItem(pid).then((response) => {
  174. this.tabParams.materialInfo = response.rows;
  175. this.itemLoading = false;
  176. });
  177. },
  178. //确认
  179. verify() {
  180. if(this.selectedRow){
  181. this.$modal.loading("处理中...");
  182. bipPullVerify(this.selectedRow).then((response) => {
  183. if (response.code === 200) {
  184. this.$modal.notifySuccess("拉单成功");
  185. }
  186. this.$modal.closeLoading();
  187. }).catch(() => {
  188. this.$modal.closeLoading();
  189. });
  190. }else{
  191. this.$modal.msgWarning("请选择一条数据!");
  192. }
  193. },
  194. //返回
  195. back(){
  196. var userAgent = navigator.userAgent;
  197. if (userAgent.indexOf("Firefox") != -1 || userAgent.indexOf("Chrome") !=-1) {
  198. window.location.href="about:blank";
  199. window.close();
  200. } else {
  201. window.opener = null;
  202. window.open("", "_self");
  203. window.close();
  204. }
  205. },
  206. // 选中某行
  207. select(row) {
  208. this.getlistStAllotItem(row.id);
  209. this.selectedRow = row;
  210. },
  211. },
  212. };
  213. </script>
  214. <style lang="scss" scoped>
  215. #transferOrder {
  216. padding: 12px;
  217. box-sizing: border-box;
  218. overflow-y: scroll;
  219. }
  220. </style>