|
@@ -7,6 +7,7 @@ import {
|
|
|
getChangeDetails,
|
|
|
editChangeList,
|
|
|
importInner,
|
|
|
+ saveAndSubmit,
|
|
|
} from "@/api/changeApply/basic";
|
|
|
|
|
|
export default {
|
|
@@ -203,7 +204,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
//
|
|
|
- async useSubmit(prop) {
|
|
|
+ async useSave(prop) {
|
|
|
let params = _.cloneDeep(this.params);
|
|
|
|
|
|
this.handleSubmitValidate(prop, async () => {
|
|
@@ -225,6 +226,72 @@ export default {
|
|
|
// await;
|
|
|
});
|
|
|
},
|
|
|
+ // 保存并提交
|
|
|
+ async useSubmit(prop) {
|
|
|
+ let params = _.cloneDeep(this.params);
|
|
|
+ console.log(params, "params");
|
|
|
+ this.handleSubmitValidate(prop, async () => {
|
|
|
+ try {
|
|
|
+ this.loading = true;
|
|
|
+ const { code, msg } = await saveAndSubmit({
|
|
|
+ ...params,
|
|
|
+ isInventory: "Y",
|
|
|
+ });
|
|
|
+
|
|
|
+ if (code == 200) {
|
|
|
+ this.hide();
|
|
|
+ this.$notify.success({
|
|
|
+ title: msg,
|
|
|
+ });
|
|
|
+ } else if (code == 10000) {
|
|
|
+ this.$alert(
|
|
|
+ "<div style='overflow: auto;overflow-x: hidden;max-height: 65vh;padding: 10px 20px 0;'>" +
|
|
|
+ msg +
|
|
|
+ "</div>",
|
|
|
+ "提示",
|
|
|
+ {
|
|
|
+ showCancelButton: true,
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ confirmButtonText: "确认",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ beforeClose: async (action, instance, done) => {
|
|
|
+ if (action === "confirm") {
|
|
|
+ instance.confirmButtonLoading = true;
|
|
|
+ instance.confirmButtonText = "执行中...";
|
|
|
+ try {
|
|
|
+ const { code, msg } = await saveAndSubmit({
|
|
|
+ ...params,
|
|
|
+ isInventory: "N",
|
|
|
+ });
|
|
|
+ if (code == 200) {
|
|
|
+ done();
|
|
|
+ this.hide();
|
|
|
+ this.$notify.success({
|
|
|
+ message: msg,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ instance.confirmButtonText = "确认";
|
|
|
+ } finally {
|
|
|
+ instance.confirmButtonLoading = false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ done();
|
|
|
+ this.$notify.warning({
|
|
|
+ message:
|
|
|
+ "不允许修改【批号及库存状态管理】或【是否序列号管理】",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ } finally {
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
async handelImport(fileList) {
|
|
|
try {
|
|
@@ -325,8 +392,15 @@ export default {
|
|
|
type="primary"
|
|
|
:size="$attrs.size"
|
|
|
:loading="loading"
|
|
|
+ @click="useSave('superForm')"
|
|
|
+ >保 存</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :size="$attrs.size"
|
|
|
+ :loading="loading"
|
|
|
@click="useSubmit('superForm')"
|
|
|
- >确 认</el-button
|
|
|
+ >保存并提交</el-button
|
|
|
>
|
|
|
<el-button :size="$attrs.size" :loading="loading" @click="hide"
|
|
|
>取 消</el-button
|