|
@@ -4,50 +4,42 @@ export default {
|
|
|
name: "DocumentsReturnDialog",
|
|
|
components: {},
|
|
|
data() {
|
|
|
- return {
|
|
|
- size: "mini",
|
|
|
- title: "退回需求",
|
|
|
- visible: false,
|
|
|
- loading: false,
|
|
|
- params: { baskCause: "", documentIds: [] },
|
|
|
- };
|
|
|
+ return {};
|
|
|
},
|
|
|
computed: {},
|
|
|
watch: {},
|
|
|
methods: {
|
|
|
//
|
|
|
open(prop) {
|
|
|
- this.visible = true;
|
|
|
- const documentIds = prop.map((item) => item.id);
|
|
|
- this.params.documentIds = documentIds;
|
|
|
- },
|
|
|
- //
|
|
|
- hide() {
|
|
|
- this.visible = false;
|
|
|
- this.params.baskCause = "";
|
|
|
- this.params.documentIds = [];
|
|
|
- },
|
|
|
- //
|
|
|
- async submit(prop) {
|
|
|
- try {
|
|
|
- // try
|
|
|
- this.loading = true;
|
|
|
- const { baskCause, documentIds } = prop;
|
|
|
- const { msg, code } = await DOCUMENTSRETURN({
|
|
|
- baskCause,
|
|
|
- documentIds,
|
|
|
- });
|
|
|
- if (code === 200) {
|
|
|
- this.hide();
|
|
|
- this.$emit("success");
|
|
|
- this.$notify.success({ title: msg });
|
|
|
- }
|
|
|
- } catch (err) {
|
|
|
- // catch
|
|
|
- } finally {
|
|
|
- // finally
|
|
|
- this.loading = false;
|
|
|
- }
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ this.$prompt("请填写退单原因", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "info",
|
|
|
+ })
|
|
|
+ .then(async ({ value: baskCause }) => {
|
|
|
+ try {
|
|
|
+ this.loading = true;
|
|
|
+ const documentIds = prop.map((item) => item.id);
|
|
|
+ const { msg, code } = await DOCUMENTSRETURN({
|
|
|
+ baskCause,
|
|
|
+ documentIds,
|
|
|
+ });
|
|
|
+ if (code === 200) {
|
|
|
+ resolve(true);
|
|
|
+ this.$emit("success");
|
|
|
+ this.$notify.success(msg);
|
|
|
+ }
|
|
|
+ } catch (err) {
|
|
|
+ // catch
|
|
|
+ reject(false);
|
|
|
+ console.error(err);
|
|
|
+ } finally {
|
|
|
+ // finally
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => reject(false));
|
|
|
+ });
|
|
|
},
|
|
|
},
|
|
|
created() {},
|
|
@@ -56,56 +48,6 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<template>
|
|
|
- <el-dialog
|
|
|
- width="25%"
|
|
|
- :show-close="false"
|
|
|
- :visible.sync="visible"
|
|
|
- @close="hide"
|
|
|
- >
|
|
|
- <div
|
|
|
- slot="title"
|
|
|
- style="display: flex; justify-content: space-between; align-items: center"
|
|
|
- >
|
|
|
- <span>{{ title }}</span>
|
|
|
- <span>
|
|
|
- <el-button
|
|
|
- :size="size"
|
|
|
- :disabled="loading"
|
|
|
- circle
|
|
|
- icon="el-icon-close"
|
|
|
- @click="visible = false"
|
|
|
- >
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- :size="size"
|
|
|
- :disabled="loading"
|
|
|
- circle
|
|
|
- icon="el-icon-check"
|
|
|
- @click="submit(params)"
|
|
|
- >
|
|
|
- </el-button>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- <el-alert
|
|
|
- title="请填写退单原因"
|
|
|
- type="info"
|
|
|
- show-icon
|
|
|
- :closable="false"
|
|
|
- style="margin-bottom: 10px"
|
|
|
- >
|
|
|
- </el-alert>
|
|
|
- <el-form
|
|
|
- :size="size"
|
|
|
- :model="params"
|
|
|
- label-width="0px"
|
|
|
- label-position="right"
|
|
|
- >
|
|
|
- <el-form-item prop="" label="">
|
|
|
- <el-input v-model="params.baskCause" :size="size"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </el-dialog>
|
|
|
-</template>
|
|
|
+<template></template>
|
|
|
|
|
|
<style scoped></style>
|