|
@@ -47,7 +47,7 @@
|
|
|
|
|
|
<el-form-item>
|
|
|
<el-col :span="24" style="text-align: right; margin-top: 10px">
|
|
|
- <el-button type="primary" @click="save">保 存 </el-button>
|
|
|
+ <el-button type="primary" @click="submitForm">保 存 </el-button>
|
|
|
<el-button type="">关 闭 </el-button>
|
|
|
|
|
|
<!-- <el-button type="warning" @click="submitForm"
|
|
@@ -69,7 +69,7 @@ import statusList from "@/assets/js/statusList";
|
|
|
// import asyncRequest from "@/apis/service/stock/newApply";
|
|
|
import addEdit from "./addEdit-newApply";
|
|
|
import { mapGetters } from "vuex";
|
|
|
-
|
|
|
+// import from "@/utils/validate";
|
|
|
export default {
|
|
|
name: "allotFlow",
|
|
|
mixins: [mixinPage, resToken],
|
|
@@ -152,6 +152,42 @@ export default {
|
|
|
// }
|
|
|
// this.loading = false;
|
|
|
},
|
|
|
+
|
|
|
+ // 商品保存提交
|
|
|
+ async submitForm() {
|
|
|
+ await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.loading = true;
|
|
|
+ // const { stock_code, stock_in_code, supplier_code, supplier_in_code } =
|
|
|
+ // JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
+ console.log(this.ruleForm);
|
|
|
+ const model = {
|
|
|
+
|
|
|
+ };
|
|
|
+ let res = {};
|
|
|
+ // if (this.id === "add") {
|
|
|
+ // delete model["id"];
|
|
|
+ // res = await asyncRequest.add(model);
|
|
|
+ // } else {
|
|
|
+ // res = await asyncRequest.update(model);
|
|
|
+ // }
|
|
|
+ this.loading = false;
|
|
|
+ if (res && res.code === 0) {
|
|
|
+ //
|
|
|
+ this.showModelThis = false;
|
|
|
+ // 刷新
|
|
|
+ this.$emit("refresh");
|
|
|
+ } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
+ await this.logout();
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.message);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log("error submit!!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|