inStock-check.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <div class="newApply pagePadding">
  3. <div
  4. v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
  5. >
  6. <el-form
  7. :disabled="myType !== 4"
  8. :model="ruleForm"
  9. :rules="rules"
  10. ref="ruleForm"
  11. label-width="120px"
  12. >
  13. <el-form-item label="验货详情" prop="check_detail">
  14. <ex-table
  15. v-loading="false"
  16. :table="table"
  17. :data="tableData"
  18. :columns="columns"
  19. :page="pageInfo"
  20. :size="size"
  21. @page-curr-change="handlePageChange"
  22. @page-size-change="handleSizeChange"
  23. @screen-reset="
  24. pageInfo.curr = 1;
  25. parmValue.page = 1;
  26. searchList();
  27. "
  28. @screen-submit="
  29. pageInfo.curr = 1;
  30. parmValue.page = 1;
  31. searchList();
  32. "
  33. >
  34. <template #table-header="{}">
  35. <div style="width: 100%; height: 40px"></div>
  36. </template>
  37. <template #operation="{ scope }">
  38. <el-tooltip
  39. v-if="powers.some((item) => item == '002')"
  40. effect="dark"
  41. content="重置密码"
  42. placement="top"
  43. >
  44. <i
  45. class="el-icon-refresh-left tb-icon"
  46. @click="openPasswordModal(scope.row.id, false)"
  47. ></i>
  48. </el-tooltip>
  49. <el-tooltip
  50. v-if="powers.some((item) => item == '007')"
  51. effect="dark"
  52. content="详情"
  53. placement="top"
  54. >
  55. <i
  56. class="el-icon-view tb-icon"
  57. @click="openModal(scope.row.id, true, scope.row)"
  58. ></i>
  59. </el-tooltip>
  60. <el-tooltip
  61. v-if="powers.some((item) => item == '005')"
  62. effect="dark"
  63. content="修改"
  64. placement="top"
  65. >
  66. <i
  67. class="el-icon-edit tb-icon"
  68. @click="openModal(scope.row.id, false, scope.row)"
  69. ></i>
  70. </el-tooltip>
  71. <el-tooltip
  72. v-if="
  73. powers.some((item) => item == '004') &&
  74. scope.row.status === '1'
  75. "
  76. effect="dark"
  77. content="禁用"
  78. placement="top"
  79. >
  80. <i
  81. class="el-icon-video-pause tb-icon"
  82. @click="statusConfirm(scope.row.id, scope.row.status)"
  83. ></i>
  84. </el-tooltip>
  85. <el-tooltip
  86. v-if="
  87. powers.some((item) => item == '004') &&
  88. scope.row.status === '0'
  89. "
  90. effect="dark"
  91. content="启用"
  92. placement="top"
  93. >
  94. <i
  95. class="el-icon-video-play tb-icon"
  96. @click="statusConfirm(scope.row.id, scope.row.status)"
  97. ></i>
  98. </el-tooltip>
  99. </template>
  100. </ex-table>
  101. </el-form-item>
  102. <el-form-item>
  103. <el-col :span="24" style="text-align: right; margin-top: 10px">
  104. <el-button type="primary" @click="save">保 存 </el-button>
  105. </el-col>
  106. </el-form-item>
  107. </el-form>
  108. </div>
  109. <div v-else>
  110. <no-auth></no-auth>
  111. </div>
  112. </div>
  113. </template>
  114. <script>
  115. import mixinPage from "@/mixins/elPaginationHandle";
  116. import resToken from "@/mixins/resToken";
  117. import asyncRequest from "@/apis/service/stock/newApply";
  118. // import asyncRequest from "@/mock/service/stock/newApply";
  119. import addEdit from "./addEdit-newApply";
  120. import { mapGetters } from "vuex";
  121. export default {
  122. name: "allotFlow",
  123. mixins: [mixinPage, resToken],
  124. props: ["myType"],
  125. components: {
  126. addEdit,
  127. },
  128. computed: {
  129. ...mapGetters(["tablebtnSize", "searchSize", "size"]),
  130. powers() {
  131. let tran =
  132. this.$store.getters.btnList.find(
  133. (item) => item.menu_route == "allotFlow"
  134. ) || {};
  135. if (tran && tran.action && tran.action.length > 0) {
  136. return tran.action;
  137. } else {
  138. return [];
  139. }
  140. },
  141. },
  142. data() {
  143. return {
  144. value: "",
  145. ruleForm: {},
  146. rules: {
  147. //出入库规则
  148. check_detail: [
  149. {
  150. required: true,
  151. message: "请选择发货公司",
  152. trigger: "blur",
  153. },
  154. ],
  155. },
  156. loading: true,
  157. showModel: false,
  158. isDetail: false,
  159. modelId: 0,
  160. tableData: [], //渲染表格
  161. //
  162. // 表格 - 数据
  163. tableData: [],
  164. // 表格 - 参数
  165. table: {
  166. stripe: true,
  167. border: true,
  168. // _defaultHeader_: ["setcol"],
  169. },
  170. // 表格 - 分页
  171. pageInfo: {
  172. size: 15,
  173. curr: 1,
  174. total: 0,
  175. },
  176. // 表格 - 列参数
  177. columns: [
  178. {
  179. prop: "nickname",
  180. label: "商品编号",
  181. },
  182. {
  183. prop: "role_name",
  184. label: "商品名称",
  185. },
  186. {
  187. prop: "mobile",
  188. label: "总数量",
  189. },
  190. {
  191. prop: "mobile",
  192. label: "异常数量",
  193. },
  194. {
  195. prop: "mobile",
  196. label: "异常备注",
  197. },
  198. {
  199. prop: "",
  200. label: "操作",
  201. fixed: "right",
  202. _noset_: true,
  203. _slot_: "operation",
  204. },
  205. ],
  206. //入参
  207. parmValue: {
  208. // page: 1, // 页码
  209. // size: 15, // 每页显示条数
  210. },
  211. };
  212. },
  213. mounted() {
  214. this.searchList();
  215. },
  216. methods: {
  217. restSearch() {
  218. //重置入参
  219. this.parmValue = {
  220. // page: 1, // 页码
  221. // size: 10, // 每页显示条数
  222. };
  223. this.searchList();
  224. },
  225. openModal(id, isDetail, sitem) {
  226. this.showModel = true;
  227. this.modelId = id;
  228. this.isDetail = isDetail;
  229. this.sitem = sitem;
  230. },
  231. async searchList() {
  232. // this.loading = true;
  233. // const res = await asyncRequest.list(this.parmValue);
  234. // if (res && res.code === 0 && res.data) {
  235. // this.tableData = res.data.list;
  236. // this.pageInfo.total = Number(res.data.count);
  237. // } else if (res && res.code >= 100 && res.code <= 104) {
  238. // await this.logout();
  239. // } else {
  240. // this.tableData = [];
  241. // this.pageInfo.total = 0;
  242. // }
  243. // this.loading = false;
  244. },
  245. },
  246. };
  247. </script>