|
@@ -57,7 +57,6 @@ export default {
|
|
"params": {
|
|
"params": {
|
|
handler(nVal, oVal) {
|
|
handler(nVal, oVal) {
|
|
|
|
|
|
-
|
|
|
|
// 组织变化
|
|
// 组织变化
|
|
if (nVal.puOrg != oVal.puOrg) {
|
|
if (nVal.puOrg != oVal.puOrg) {
|
|
console.log(nVal.puOrg, 'nVal.puOrg', oVal.puOrg, 'oVal.puOrg');
|
|
console.log(nVal.puOrg, 'nVal.puOrg', oVal.puOrg, 'oVal.puOrg');
|
|
@@ -96,9 +95,12 @@ export default {
|
|
},
|
|
},
|
|
// 复制赋值
|
|
// 复制赋值
|
|
async setCopyParams(id) {
|
|
async setCopyParams(id) {
|
|
|
|
+ console.log(id, 'iid-----------------------');
|
|
try {
|
|
try {
|
|
const { code, msg, data } = await orderApi.details(id);
|
|
const { code, msg, data } = await orderApi.details(id);
|
|
|
|
+
|
|
if (code === 200) {
|
|
if (code === 200) {
|
|
|
|
+
|
|
this.params = {
|
|
this.params = {
|
|
...data,
|
|
...data,
|
|
id: '',
|
|
id: '',
|
|
@@ -106,6 +108,19 @@ export default {
|
|
status: '0',
|
|
status: '0',
|
|
source: '3',
|
|
source: '3',
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+ for (const key in this.params) {
|
|
|
|
+
|
|
|
|
+ if (Array.isArray(this.params[key])) {
|
|
|
|
+
|
|
|
|
+ this.params[key].forEach(v => {
|
|
|
|
+
|
|
|
|
+ v.id = '';
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
} catch (err) {
|
|
} catch (err) {
|
|
//
|
|
//
|
|
@@ -204,36 +219,36 @@ export default {
|
|
},
|
|
},
|
|
// 保存并新增
|
|
// 保存并新增
|
|
async handleSubmit() {
|
|
async handleSubmit() {
|
|
- // this.$refs["orderAddForm"].validate(async (valid) => {
|
|
|
|
- // if (valid) {
|
|
|
|
- try {
|
|
|
|
- const createById = this.params.buyer;
|
|
|
|
- const createByName = this.params.buyerName;
|
|
|
|
- const updateById = this.$store.state.user.id;
|
|
|
|
- const updateByName = this.$store.state.user.name;
|
|
|
|
- const { code, msg } = await orderApi.create({
|
|
|
|
- createById,
|
|
|
|
- createByName,
|
|
|
|
- updateById,
|
|
|
|
- updateByName,
|
|
|
|
- ...this.params,
|
|
|
|
- });
|
|
|
|
- if (code === 200) {
|
|
|
|
- this.$notify.success({ title: msg });
|
|
|
|
- this.setVisible(false);
|
|
|
|
|
|
+ this.$refs["orderAddForm"].validate(async (valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ try {
|
|
|
|
+ const createById = this.params.buyer;
|
|
|
|
+ const createByName = this.params.buyerName;
|
|
|
|
+ const updateById = this.$store.state.user.id;
|
|
|
|
+ const updateByName = this.$store.state.user.name;
|
|
|
|
+ const { code, msg } = await orderApi.create({
|
|
|
|
+ createById,
|
|
|
|
+ createByName,
|
|
|
|
+ updateById,
|
|
|
|
+ updateByName,
|
|
|
|
+ ...this.params,
|
|
|
|
+ });
|
|
|
|
+ if (code === 200) {
|
|
|
|
+ this.$notify.success({ title: msg });
|
|
|
|
+ this.setVisible(false);
|
|
|
|
+ } else {
|
|
|
|
+ this.$notify.warning({ title: msg });
|
|
|
|
+ }
|
|
|
|
+ } catch (err) {
|
|
|
|
+ this.$notify.error({ title: "error", message: err });
|
|
|
|
+ } finally {
|
|
|
|
+ // this.setVisible(false);
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
- this.$notify.warning({ title: msg });
|
|
|
|
|
|
+ console.log("error submit!!");
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
- } catch (err) {
|
|
|
|
- this.$notify.error({ title: "error", message: err });
|
|
|
|
- } finally {
|
|
|
|
- // this.setVisible(false);
|
|
|
|
- }
|
|
|
|
- // } else {
|
|
|
|
- // console.log("error submit!!");
|
|
|
|
- // return false;
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 子表参照改变之后
|
|
// 子表参照改变之后
|
|
handleReferChange(val, source, type) {
|
|
handleReferChange(val, source, type) {
|
|
@@ -297,9 +312,9 @@ export default {
|
|
<div style="text-align: right">
|
|
<div style="text-align: right">
|
|
<el-button size="mini" @click="handleCancel">取消</el-button>
|
|
<el-button size="mini" @click="handleCancel">取消</el-button>
|
|
<el-button size="mini" type="danger" @click="handleSava">保存</el-button>
|
|
<el-button size="mini" type="danger" @click="handleSava">保存</el-button>
|
|
- <el-button size="mini" type="info" @click="handleSubmit">
|
|
|
|
|
|
+ <!-- <el-button size="mini" type="info" @click="handleSubmit">
|
|
保存并新增
|
|
保存并新增
|
|
- </el-button>
|
|
|
|
|
|
+ </el-button> -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<el-row style="display:flex; flex-wrap: wrap;">
|
|
<el-row style="display:flex; flex-wrap: wrap;">
|