inStock-audit.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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-select
  17. v-model="value"
  18. placeholder="入库方审核"
  19. :size="searchSize"
  20. >
  21. <el-option
  22. v-for="item in options"
  23. :key="item.value"
  24. :label="item.label"
  25. :value="item.value"
  26. >
  27. </el-option>
  28. </el-select>
  29. </el-form-item>
  30. <!-- 入库方审核备注 -->
  31. <el-form-item label="入库方审核备注" prop="stock_remark">
  32. <el-input
  33. type="textarea"
  34. :rows="2"
  35. style="width: 30%"
  36. placeholder="请输入审核备注"
  37. :size="searchSize"
  38. v-model="remark"
  39. clearable
  40. >
  41. </el-input>
  42. </el-form-item>
  43. <el-form-item>
  44. <el-col :span="24" style="text-align: right; margin-top: 10px">
  45. <el-button type="primary" @click="save" v-show="myType === 2"
  46. >保 存
  47. </el-button>
  48. <!-- <el-button type="warning" @click="submitForm"
  49. >保 存 并 发 起 流 程
  50. </el-button> -->
  51. </el-col>
  52. </el-form-item>
  53. </el-form>
  54. <add-edit
  55. :id="modelId"
  56. :sitem="sitem"
  57. :show-model="showModel"
  58. :is-detail="isDetail"
  59. @refresh="searchList"
  60. @cancel="showModel = false"
  61. />
  62. </div>
  63. <div v-else>
  64. <no-auth></no-auth>
  65. </div>
  66. </div>
  67. </template>
  68. <script>
  69. import mixinPage from "@/mixins/elPaginationHandle";
  70. import resToken from "@/mixins/resToken";
  71. import ExTable from "@/components/ExTableNew.vue";
  72. import statusList from "@/assets/js/statusList";
  73. // import asyncRequest from "@/apis/service/stock/newApply";
  74. import asyncRequest from "@/mock/service/stock/newApply";
  75. import addEdit from "./addEdit-newApply";
  76. import { mapGetters } from "vuex";
  77. export default {
  78. name: "allotFlow",
  79. mixins: [mixinPage, resToken],
  80. props: ["myType"],
  81. components: {
  82. addEdit,
  83. ExTable,
  84. },
  85. computed: {
  86. ...mapGetters(["tablebtnSize", "searchSize", "size"]),
  87. powers() {
  88. let tran =
  89. this.$store.getters.btnList.find(
  90. (item) => item.menu_route == "allotFlow"
  91. ) || {};
  92. if (tran && tran.action && tran.action.length > 0) {
  93. return tran.action;
  94. } else {
  95. return [];
  96. }
  97. },
  98. },
  99. data() {
  100. return {
  101. options: [
  102. {
  103. value: "选项1",
  104. label: "请选择入库方审核状态",
  105. },
  106. {
  107. value: "选项2",
  108. label: "通过",
  109. },
  110. {
  111. value: "选项3",
  112. label: "驳回",
  113. },
  114. ],
  115. value: "",
  116. // selectStock_in: "", //选择的入库仓库名称
  117. // selectStock_go: "", //选择的出库仓库名称
  118. // stock_go: "", //出库仓库name
  119. // stock_in: "", //入库仓库name
  120. // options: [], //用于渲染二级仓库名
  121. ruleForm: {},
  122. rules: {
  123. //出入库规则
  124. stock_go_rule: [
  125. {
  126. required: true,
  127. message: "请选择审核状态",
  128. trigger: "blur",
  129. },
  130. ],
  131. stock_remark: [
  132. {
  133. required: true,
  134. message: "请输入审核备注",
  135. trigger: "change",
  136. },
  137. ],
  138. },
  139. remark: "a",
  140. loading: true,
  141. showModel: false,
  142. isDetail: false,
  143. modelId: 0,
  144. tableData: [], //渲染表格
  145. //
  146. // 表格 - 数据
  147. tableData: [],
  148. // 表格 - 参数
  149. table: {
  150. stripe: true,
  151. border: true,
  152. // _defaultHeader_: ["setcol"],
  153. },
  154. // 表格 - 分页
  155. pageInfo: {
  156. size: 15,
  157. curr: 1,
  158. total: 0,
  159. },
  160. // 表格 - 列参数
  161. columns: [
  162. {
  163. prop: "nickname",
  164. label: "商品编号",
  165. },
  166. {
  167. prop: "role_name",
  168. label: "商品名称",
  169. },
  170. {
  171. prop: "mobile",
  172. label: "数量",
  173. },
  174. {
  175. prop: "",
  176. label: "操作",
  177. fixed: "right",
  178. _noset_: true,
  179. _slot_: "operation",
  180. },
  181. ],
  182. // sitem: null,
  183. // // 状态
  184. // statusOptions: [
  185. // { id: "0", label: "禁用" },
  186. // { id: "1", label: "启用" },
  187. // ],
  188. parmValue: {
  189. //入参
  190. // name: "", // 业务员名字
  191. // username: "", // 账号
  192. // status: "", //
  193. // page: 1, // 页码
  194. // size: 15, // 每页显示条数
  195. },
  196. // passwordModel: false,
  197. // passwordModelId: 0,
  198. // isPasswordDetail: false,
  199. // statusList: statusList,
  200. };
  201. },
  202. mounted() {
  203. this.searchList();
  204. // this.stockName(); //假数据,获取二级仓库名
  205. },
  206. methods: {
  207. restSearch() {
  208. //重置入参
  209. this.parmValue = {};
  210. this.searchList();
  211. },
  212. openModal(id, isDetail, sitem) {
  213. this.showModel = true;
  214. this.modelId = id;
  215. this.isDetail = isDetail;
  216. this.sitem = sitem;
  217. },
  218. async deleteById(id, status) {
  219. // await this.$confirm("确定要删除?", {
  220. // confirmButtonText: "确定",
  221. // cancelButtonText: "取消",
  222. // type: "warning",
  223. // })
  224. // .then(async () => {
  225. // const model = {
  226. // id: id,
  227. // status: status === "1" ? "0" : "1",
  228. // };
  229. // const res = await asyncRequest.status(model);
  230. // if (res && res.code === 0) {
  231. // this.$notify.success({
  232. // title: "删除成功",
  233. // message: "",
  234. // });
  235. // this.searchList();
  236. // } else if (res && res.code >= 100 && res.code <= 104) {
  237. // await this.logout();
  238. // } else {
  239. // this.$message.warning(res.message);
  240. // }
  241. // })
  242. // .catch(() => {
  243. // console.log("取消");
  244. // });
  245. },
  246. async searchList() {
  247. // this.loading = true;
  248. // const res = await asyncRequest.list(this.parmValue);
  249. // if (res && res.code === 0 && res.data) {
  250. // this.tableData = res.data.list;
  251. // this.pageInfo.total = Number(res.data.count);
  252. // } else if (res && res.code >= 100 && res.code <= 104) {
  253. // await this.logout();
  254. // } else {
  255. // this.tableData = [];
  256. // this.pageInfo.total = 0;
  257. // }
  258. // this.loading = false;
  259. },
  260. async statusConfirm(id, status) {
  261. // let str = status === "1" ? "禁用" : "启用";
  262. // await this.$confirm("确定要改为" + str + "?", {
  263. // confirmButtonText: "确定",
  264. // cancelButtonText: "取消",
  265. // type: "warning",
  266. // })
  267. // .then(async () => {
  268. // this.loading = true;
  269. // const model = {
  270. // id: id,
  271. // status: status === "1" ? "0" : "1",
  272. // };
  273. // const res = await asyncRequest.status(model);
  274. // if (res && res.code === 0) {
  275. // this.loading = false;
  276. // this.$notify.success({
  277. // title: "状态修改成功!",
  278. // message: "",
  279. // });
  280. // await this.searchList();
  281. // } else if (res && res.code >= 100 && res.code <= 104) {
  282. // await this.logout();
  283. // } else {
  284. // this.$message.warning(res.message);
  285. // }
  286. // })
  287. // .catch(() => {
  288. // console.log("取消");
  289. // });
  290. },
  291. compareStock() {
  292. //比较出库仓库和入库仓库是否相同
  293. if (
  294. this.stock_go === this.stock_in &&
  295. this.stock_go !== "" &&
  296. this.stock_go != ""
  297. ) {
  298. console.log("出库仓库和入库仓库相同");
  299. this.$message({
  300. message: "出库仓库不能和入库仓库相同",
  301. type: "error",
  302. });
  303. }
  304. },
  305. },
  306. };
  307. </script>
  308. <style lang="scss" >
  309. .newApply {
  310. }
  311. .el-form-item__content {
  312. margin: 0 !important;
  313. }
  314. </style>