goStock-audit.vue 11 KB

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