inStock-audit.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  1. <template>
  2. <div class="newApply pagePadding">
  3. 入库方审核
  4. {{ myType }}
  5. <div
  6. v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
  7. >
  8. <el-form
  9. :disabled="myType !== 2"
  10. :model="ruleForm"
  11. :rules="rules"
  12. ref="ruleForm"
  13. label-width="165px"
  14. >
  15. <el-form-item label="入库方审核状态" prop="stock_go_rule">
  16. <!-- <el-cascader
  17. placeholder="请选择出库仓库"
  18. filterable
  19. clearable
  20. :size="searchSize"
  21. v-model="selectStock_go"
  22. :options="options"
  23. style="width: 30%"
  24. @change="
  25. pageInfo.curr = 1;
  26. parmValue.page = 1;
  27. stockName();
  28. "
  29. ></el-cascader> -->
  30. <el-select
  31. v-model="value"
  32. placeholder="入库方审核"
  33. :size="searchSize"
  34. >
  35. <el-option
  36. v-for="item in options"
  37. :key="item.value"
  38. :label="item.label"
  39. :value="item.value"
  40. >
  41. </el-option>
  42. </el-select>
  43. </el-form-item>
  44. <!-- 入库方审核备注 -->
  45. <el-form-item label="入库方审核备注" prop="stock_remark">
  46. <el-input
  47. type="textarea"
  48. :rows="2"
  49. style="width: 30%"
  50. placeholder="请输入审核备注"
  51. :size="searchSize"
  52. v-model="remark"
  53. clearable
  54. >
  55. </el-input>
  56. </el-form-item>
  57. <el-form-item>
  58. <el-col :span="24" style="text-align: right; margin-top: 10px">
  59. <el-button type="primary" @click="save" v-show="myType === 2"
  60. >保 存
  61. </el-button>
  62. <!-- <el-button type="warning" @click="submitForm"
  63. >保 存 并 发 起 流 程
  64. </el-button> -->
  65. </el-col>
  66. </el-form-item>
  67. <!-- <el-form-item label="审核备注" prop="stock_remark">
  68. </el-form-item> -->
  69. <!-- <el-form-item label="入库仓库" prop="stock_in_rule">
  70. <el-cascader
  71. placeholder="请选择入库仓库"
  72. filterable
  73. clearable
  74. :size="searchSize"
  75. v-model="selectStock_in"
  76. :options="options"
  77. style="width: 30%"
  78. @change="
  79. pageInfo.curr = 1;
  80. parmValue.page = 1;
  81. stockName();
  82. "
  83. ></el-cascader>
  84. </el-form-item>
  85. <el-form-item label="出库商品" prop="stock_go_product">
  86. <ex-table
  87. v-loading="false"
  88. :table="table"
  89. :data="tableData"
  90. :columns="columns"
  91. :page="pageInfo"
  92. :size="size"
  93. @page-curr-change="handlePageChange"
  94. @page-size-change="handleSizeChange"
  95. @screen-reset="
  96. pageInfo.curr = 1;
  97. parmValue.page = 1;
  98. searchList();
  99. "
  100. @screen-submit="
  101. pageInfo.curr = 1;
  102. parmValue.page = 1;
  103. searchList();
  104. "
  105. >
  106. <template #table-header="{}">
  107. <div style="width: 100%; height: 40px"></div>
  108. </template>
  109. <template #operation="{ scope }">
  110. <el-tooltip
  111. v-if="powers.some((item) => item == '002')"
  112. effect="dark"
  113. content="重置密码"
  114. placement="top"
  115. >
  116. <i
  117. class="el-icon-refresh-left tb-icon"
  118. @click="openPasswordModal(scope.row.id, false)"
  119. ></i>
  120. </el-tooltip>
  121. <el-tooltip
  122. v-if="powers.some((item) => item == '007')"
  123. effect="dark"
  124. content="详情"
  125. placement="top"
  126. >
  127. <i
  128. class="el-icon-view tb-icon"
  129. @click="openModal(scope.row.id, true, scope.row)"
  130. ></i>
  131. </el-tooltip>
  132. <el-tooltip
  133. v-if="powers.some((item) => item == '005')"
  134. effect="dark"
  135. content="修改"
  136. placement="top"
  137. >
  138. <i
  139. class="el-icon-edit tb-icon"
  140. @click="openModal(scope.row.id, false, scope.row)"
  141. ></i>
  142. </el-tooltip>
  143. <el-tooltip
  144. v-if="
  145. powers.some((item) => item == '004') &&
  146. scope.row.status === '1'
  147. "
  148. effect="dark"
  149. content="禁用"
  150. placement="top"
  151. >
  152. <i
  153. class="el-icon-video-pause tb-icon"
  154. @click="statusConfirm(scope.row.id, scope.row.status)"
  155. ></i>
  156. </el-tooltip>
  157. <el-tooltip
  158. v-if="
  159. powers.some((item) => item == '004') &&
  160. scope.row.status === '0'
  161. "
  162. effect="dark"
  163. content="启用"
  164. placement="top"
  165. >
  166. <i
  167. class="el-icon-video-play tb-icon"
  168. @click="statusConfirm(scope.row.id, scope.row.status)"
  169. ></i>
  170. </el-tooltip>
  171. </template>
  172. </ex-table>
  173. </el-form-item> -->
  174. </el-form>
  175. <add-edit
  176. :id="modelId"
  177. :sitem="sitem"
  178. :show-model="showModel"
  179. :is-detail="isDetail"
  180. @refresh="searchList"
  181. @cancel="showModel = false"
  182. />
  183. </div>
  184. <div v-else>
  185. <no-auth></no-auth>
  186. </div>
  187. </div>
  188. </template>
  189. <script>
  190. import mixinPage from "@/mixins/elPaginationHandle";
  191. import resToken from "@/mixins/resToken";
  192. import ExTable from "@/components/ExTableNew.vue";
  193. import statusList from "@/assets/js/statusList";
  194. // import asyncRequest from "@/apis/service/stock/newApply";
  195. import asyncRequest from "@/mock/service/stock/newApply";
  196. import addEdit from "./addEdit-newApply";
  197. import { mapGetters } from "vuex";
  198. export default {
  199. name: "allotFlow",
  200. mixins: [mixinPage, resToken],
  201. props: ["myType"],
  202. components: {
  203. addEdit,
  204. ExTable,
  205. },
  206. computed: {
  207. ...mapGetters(["tablebtnSize", "searchSize", "size"]),
  208. powers() {
  209. let tran =
  210. this.$store.getters.btnList.find(
  211. (item) => item.menu_route == "allotFlow"
  212. ) || {};
  213. if (tran && tran.action && tran.action.length > 0) {
  214. return tran.action;
  215. } else {
  216. return [];
  217. }
  218. },
  219. },
  220. data() {
  221. return {
  222. options: [
  223. {
  224. value: "选项1",
  225. label: "请选择入库方审核状态",
  226. },
  227. {
  228. value: "选项2",
  229. label: "通过",
  230. },
  231. {
  232. value: "选项3",
  233. label: "驳回",
  234. },
  235. ],
  236. value: "",
  237. // selectStock_in: "", //选择的入库仓库名称
  238. // selectStock_go: "", //选择的出库仓库名称
  239. // stock_go: "", //出库仓库name
  240. // stock_in: "", //入库仓库name
  241. // options: [], //用于渲染二级仓库名
  242. ruleForm: {},
  243. rules: {
  244. //出入库规则
  245. stock_go_rule: [
  246. {
  247. required: true,
  248. message: "请选择审核状态",
  249. trigger: "blur",
  250. },
  251. ],
  252. stock_remark: [
  253. {
  254. required: true,
  255. message: "请输入审核备注",
  256. trigger: "change",
  257. },
  258. ],
  259. },
  260. remark: "a",
  261. loading: true,
  262. showModel: false,
  263. isDetail: false,
  264. modelId: 0,
  265. tableData: [], //渲染表格
  266. //
  267. // 表格 - 数据
  268. tableData: [],
  269. // 表格 - 参数
  270. table: {
  271. stripe: true,
  272. border: true,
  273. // _defaultHeader_: ["setcol"],
  274. },
  275. // 表格 - 分页
  276. pageInfo: {
  277. size: 15,
  278. curr: 1,
  279. total: 0,
  280. },
  281. // 表格 - 列参数
  282. columns: [
  283. {
  284. prop: "nickname",
  285. label: "商品编号",
  286. },
  287. {
  288. prop: "role_name",
  289. label: "商品名称",
  290. },
  291. {
  292. prop: "mobile",
  293. label: "数量",
  294. },
  295. {
  296. prop: "",
  297. label: "操作",
  298. fixed: "right",
  299. _noset_: true,
  300. _slot_: "operation",
  301. },
  302. ],
  303. // sitem: null,
  304. // // 状态
  305. // statusOptions: [
  306. // { id: "0", label: "禁用" },
  307. // { id: "1", label: "启用" },
  308. // ],
  309. parmValue: {
  310. //入参
  311. // name: "", // 业务员名字
  312. // username: "", // 账号
  313. // status: "", //
  314. // page: 1, // 页码
  315. // size: 15, // 每页显示条数
  316. },
  317. // passwordModel: false,
  318. // passwordModelId: 0,
  319. // isPasswordDetail: false,
  320. // statusList: statusList,
  321. };
  322. },
  323. mounted() {
  324. this.searchList();
  325. // this.stockName(); //假数据,获取二级仓库名
  326. },
  327. methods: {
  328. restSearch() {
  329. //重置入参
  330. this.parmValue = {
  331. // name: "", // 业务员名字
  332. // username: "", // 账号
  333. // status: "", //
  334. // page: 1, // 页码
  335. // size: 10, // 每页显示条数
  336. };
  337. this.searchList();
  338. },
  339. openModal(id, isDetail, sitem) {
  340. this.showModel = true;
  341. this.modelId = id;
  342. this.isDetail = isDetail;
  343. this.sitem = sitem;
  344. },
  345. async deleteById(id, status) {
  346. // await this.$confirm("确定要删除?", {
  347. // confirmButtonText: "确定",
  348. // cancelButtonText: "取消",
  349. // type: "warning",
  350. // })
  351. // .then(async () => {
  352. // const model = {
  353. // id: id,
  354. // status: status === "1" ? "0" : "1",
  355. // };
  356. // const res = await asyncRequest.status(model);
  357. // if (res && res.code === 0) {
  358. // this.$notify.success({
  359. // title: "删除成功",
  360. // message: "",
  361. // });
  362. // this.searchList();
  363. // } else if (res && res.code >= 100 && res.code <= 104) {
  364. // await this.logout();
  365. // } else {
  366. // this.$message.warning(res.message);
  367. // }
  368. // })
  369. // .catch(() => {
  370. // console.log("取消");
  371. // });
  372. },
  373. async searchList() {
  374. // this.loading = true;
  375. // const res = await asyncRequest.list(this.parmValue);
  376. // if (res && res.code === 0 && res.data) {
  377. // this.tableData = res.data.list;
  378. // this.pageInfo.total = Number(res.data.count);
  379. // } else if (res && res.code >= 100 && res.code <= 104) {
  380. // await this.logout();
  381. // } else {
  382. // this.tableData = [];
  383. // this.pageInfo.total = 0;
  384. // }
  385. // this.loading = false;
  386. },
  387. async statusConfirm(id, status) {
  388. // let str = status === "1" ? "禁用" : "启用";
  389. // await this.$confirm("确定要改为" + str + "?", {
  390. // confirmButtonText: "确定",
  391. // cancelButtonText: "取消",
  392. // type: "warning",
  393. // })
  394. // .then(async () => {
  395. // this.loading = true;
  396. // const model = {
  397. // id: id,
  398. // status: status === "1" ? "0" : "1",
  399. // };
  400. // const res = await asyncRequest.status(model);
  401. // if (res && res.code === 0) {
  402. // this.loading = false;
  403. // this.$notify.success({
  404. // title: "状态修改成功!",
  405. // message: "",
  406. // });
  407. // await this.searchList();
  408. // } else if (res && res.code >= 100 && res.code <= 104) {
  409. // await this.logout();
  410. // } else {
  411. // this.$message.warning(res.message);
  412. // }
  413. // })
  414. // .catch(() => {
  415. // console.log("取消");
  416. // });
  417. },
  418. // async stockName() {
  419. // //获取多级仓库名称的方法
  420. // const res = await asyncRequest.listAll(this.parmValue);
  421. // // console.log(res.data);
  422. // // this.openModal("005", true);
  423. // // console.log(this.selectStock_go);
  424. // // console.log(this.selectStock_in);
  425. // // this.options = res.data;
  426. // // console.log(this.options);
  427. // let arr = res.data;
  428. // // console.log(arr);
  429. // arr.forEach((ele) => {
  430. // //重新封装后台传递来的数据,转换格式
  431. // let item = {
  432. // value: ele.id,
  433. // label: ele.name,
  434. // children: [],
  435. // };
  436. // ele.child.forEach((elem) => {
  437. // let model = {
  438. // value: elem.id,
  439. // label: elem.name,
  440. // };
  441. // item.children.push(model);
  442. // });
  443. // this.options.push(item);
  444. // });
  445. // this.options.forEach((ele) => {
  446. // //从数据表中筛选出我们要用的数据
  447. // if (ele.value === this.selectStock_go[0]) {
  448. // ele.children.forEach((elem) => {
  449. // if (elem.value === this.selectStock_go[1]) {
  450. // this.stock_go = ele.label + "/" + elem.label;
  451. // }
  452. // });
  453. // }
  454. // if (ele.value === this.selectStock_in[0]) {
  455. // ele.children.forEach((elem) => {
  456. // if (elem.value === this.selectStock_in[1]) {
  457. // this.stock_in = ele.label + "/" + elem.label;
  458. // }
  459. // });
  460. // }
  461. // });
  462. // if (this.selectStock_in != "" || this.selectStock_go != "") {
  463. // console.log("选择了一个项目");
  464. // this.openModal("005", true);
  465. // }
  466. // // console.log(this.stock_go);
  467. // // console.log(this.stock_in);
  468. // // console.log(this.pageInfo.total);
  469. // this.compareStock(); //比较出库仓库和入库仓库是否相同
  470. // },
  471. compareStock() {
  472. //比较出库仓库和入库仓库是否相同
  473. if (
  474. this.stock_go === this.stock_in &&
  475. this.stock_go !== "" &&
  476. this.stock_go != ""
  477. ) {
  478. console.log("出库仓库和入库仓库相同");
  479. this.$message({
  480. message: "出库仓库不能和入库仓库相同",
  481. type: "error",
  482. });
  483. }
  484. },
  485. },
  486. };
  487. </script>
  488. <style lang="scss" >
  489. .newApply {
  490. }
  491. .el-form-item__content {
  492. margin: 0 !important;
  493. }
  494. .setcol-table-lie {
  495. // margin: 0 !important;
  496. }
  497. </style>