index.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <template>
  2. <div class="recovery pagePadding">
  3. <div v-if="powers.some((i) => i == '001')">
  4. <ex-table
  5. v-loading="loading"
  6. :table="table"
  7. :data="tableData"
  8. :columns="columns"
  9. :page="pageInfo"
  10. :size="size"
  11. @page-curr-change="handlePageChange"
  12. @page-size-change="handleSizeChange"
  13. @screen-reset="
  14. pageInfo.curr = 1;
  15. parmValue.page = 1;
  16. searchList();
  17. "
  18. @screen-submit="
  19. pageInfo.curr = 1;
  20. parmValue.page = 1;
  21. searchList();
  22. "
  23. >
  24. <template #table-header="{}">
  25. <div style="width: 100%">
  26. <el-row style="padding: 0 0 10px 80px">
  27. <el-col :span="6" style="width: 200px">
  28. <el-input
  29. clearable
  30. placeholder="任务单号"
  31. v-model="parmValue.infoNo"
  32. maxlength="40"
  33. :size="searchSize"
  34. @blur="
  35. pageInfo.curr = 1;
  36. parmValue.page = 1;
  37. searchList();
  38. "
  39. >
  40. </el-input>
  41. </el-col>
  42. <el-col :span="6" style="width: 400px; padding: 0 0 0 10px">
  43. <el-input
  44. clearable
  45. placeholder="商品名称"
  46. v-model="parmValue.good_name"
  47. maxlength="40"
  48. :size="searchSize"
  49. @blur="
  50. pageInfo.curr = 1;
  51. parmValue.page = 1;
  52. searchList();
  53. "
  54. >
  55. </el-input>
  56. </el-col>
  57. <!-- <el-col :span="6" style="width: 150px; padding: 0 0 0 10px">
  58. <el-input
  59. clearable
  60. placeholder="采购员部门"
  61. v-model="parmValue.company_name"
  62. maxlength="40"
  63. :size="searchSize"
  64. @blur="
  65. pageInfo.curr = 1;
  66. parmValue.page = 1;
  67. searchList();
  68. "
  69. >
  70. </el-input>
  71. </el-col> -->
  72. <el-col :span="4" style="width: 66px; float: right">
  73. <el-button
  74. type="warning"
  75. class="fr"
  76. :size="searchSize"
  77. @click="restSearch"
  78. >
  79. 重置
  80. </el-button>
  81. </el-col>
  82. </el-row>
  83. <el-row>
  84. <el-col :span="6" style="width: 280px">
  85. <el-input
  86. clearable
  87. placeholder="反馈商品编号"
  88. v-model="parmValue.bidNo"
  89. maxlength="40"
  90. :size="searchSize"
  91. @blur="
  92. pageInfo.curr = 1;
  93. parmValue.page = 1;
  94. searchList();
  95. "
  96. >
  97. </el-input>
  98. </el-col>
  99. <el-col :span="6" style="width: 400px; padding: 0 0 0 10px">
  100. <el-input
  101. clearable
  102. placeholder="供应商名称"
  103. v-model="parmValue.supplierName"
  104. maxlength="40"
  105. :size="searchSize"
  106. @blur="
  107. pageInfo.curr = 1;
  108. parmValue.page = 1;
  109. searchList();
  110. "
  111. >
  112. </el-input>
  113. </el-col>
  114. <!-- <el-col :span="6" style="width: 150px; padding: 0 0 0 10px">
  115. <el-input
  116. clearable
  117. placeholder="采购员部门"
  118. v-model="parmValue.company_name"
  119. maxlength="40"
  120. :size="searchSize"
  121. @blur="
  122. pageInfo.curr = 1;
  123. parmValue.page = 1;
  124. searchList();
  125. "
  126. >
  127. </el-input>
  128. </el-col> -->
  129. <el-col :span="3" style="width: 66px; float: right">
  130. <el-button
  131. :size="searchSize"
  132. type="primary"
  133. style="float: right; margin-left: 5px"
  134. @click="searchList"
  135. >
  136. 刷新
  137. </el-button>
  138. </el-col>
  139. </el-row>
  140. </div>
  141. </template>
  142. <template #good_name="{ scope }">
  143. <!-- <img
  144. style="width: 20px; height: 20px"
  145. class="hover fl"
  146. v-viewer
  147. :src="scope.row.good_img"
  148. alt=""
  149. v-if="scope.row.good_img"
  150. /> -->
  151. <span>{{ scope.row.good_name }}</span>
  152. <span v-for="(si, i) in scope.row.specinfo" :key="si.spec_id + i">
  153. {{ i === 0 ? "__" : "--" }}{{ si.spec_name }}[{{ si.spec_value_name }}]
  154. </span>
  155. </template>
  156. <template #can="{ scope }">
  157. <span v-for="(si, i) in scope.row.can" :key="si.id + i">
  158. {{ i === 0 ? "" : "_" }}{{ si.name }}
  159. </span>
  160. </template>
  161. <template #operation="{ scope }">
  162. <el-tooltip effect="dark" content="详情" placement="top">
  163. <i
  164. class="el-icon-view tb-icon"
  165. @click="
  166. (modelId = scope.row.bidNo), (infoNo = scope.row.infoNo);
  167. showModel = true;
  168. "
  169. ></i>
  170. </el-tooltip>
  171. </template>
  172. </ex-table>
  173. <show-data
  174. :showModel="showModel"
  175. :infoNo="infoNo"
  176. :bidNo="modelId"
  177. @cancel="showModel = false"
  178. />
  179. </div>
  180. <div v-else>
  181. <no-auth></no-auth>
  182. </div>
  183. </div>
  184. </template>
  185. <script>
  186. import mixinPage from "@/mixins/elPaginationHandle";
  187. import resToken from "@/mixins/resToken";
  188. import asyncRequest from "@/apis/service/purchaseIn/recovery";
  189. import { columns } from "./columns";
  190. import { mapGetters } from "vuex";
  191. import showData from "./showData";
  192. export default {
  193. name: "recovery",
  194. mixins: [mixinPage, resToken],
  195. components: {
  196. showData,
  197. },
  198. computed: {
  199. ...mapGetters(["tablebtnSize", "searchSize", "size"]),
  200. powers() {
  201. const tran =
  202. this.$store.getters.btnList.find((item) => item.menu_route == "recovery") || {};
  203. const { action } = tran ?? {};
  204. return action ?? [];
  205. },
  206. },
  207. data() {
  208. return {
  209. // 状态
  210. loading: false,
  211. showModel: false,
  212. isDetail: false,
  213. modelId: 0,
  214. infoNo: 0,
  215. parmValue: {
  216. infoNo: "",
  217. bidNo: "",
  218. is_own: "1",
  219. company_name: "", //部门
  220. supplierName: "",
  221. good_name: "",
  222. page: 1, // 页码
  223. size: 15, // 每页显示条数
  224. },
  225. tableData: [],
  226. // 表格 - 数据
  227. tableData: [],
  228. // 表格 - 参数
  229. table: {
  230. stripe: true,
  231. border: true,
  232. _defaultHeader_: ["setcol"],
  233. },
  234. // 表格 - 分页
  235. pageInfo: {
  236. size: 15,
  237. curr: 1,
  238. total: 0,
  239. },
  240. // 表格 - 列参数
  241. columns: columns,
  242. };
  243. },
  244. mounted() {
  245. this.searchList();
  246. },
  247. methods: {
  248. restSearch() {
  249. this.parmValue = {
  250. infoNo: "",
  251. bidNo: "",
  252. is_own: "1",
  253. company_name: "", //部门
  254. supplierName: "",
  255. good_name: "",
  256. page: 1, // 页码
  257. size: 15, // 每页显示条数
  258. };
  259. // 表格 - 分页
  260. this.pageInfo = {
  261. size: 15,
  262. curr: 1,
  263. total: 0,
  264. };
  265. this.searchList();
  266. },
  267. async searchList() {
  268. this.loading = true;
  269. const res = await asyncRequest.list(this.parmValue);
  270. if (res && res.code === 0 && res.data) {
  271. this.tableData = res.data.list;
  272. this.pageInfo.total = Number(res.data.count);
  273. } else if (res && res.code >= 100 && res.code <= 104) {
  274. await this.logout();
  275. } else {
  276. this.tableData = [];
  277. this.pageInfo.total = 0;
  278. }
  279. this.loading = false;
  280. },
  281. },
  282. };
  283. </script>
  284. <style lang="scss" scoped>
  285. .recovery {
  286. // text-align: right;
  287. }
  288. </style>