Commit 3f73768d authored by 仇晓婷's avatar 仇晓婷

保存重复提交bug修改

parent 1680c461
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
...@@ -36,7 +36,7 @@ export default { ...@@ -36,7 +36,7 @@ export default {
name: "Edit", name: "Edit",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
orderCatList: [], orderCatList: [],
rules: { rules: {
...@@ -60,7 +60,7 @@ export default { ...@@ -60,7 +60,7 @@ export default {
handleSubmit() { handleSubmit() {
this.$refs.form.validate(v => { this.$refs.form.validate(v => {
if (v) { if (v) {
this.disabled = true;
let parmsUp = { let parmsUp = {
run_time: this.entity.run_time, run_time: this.entity.run_time,
first_equip: this.entity.eQUIPID, first_equip: this.entity.eQUIPID,
...@@ -83,7 +83,7 @@ export default { ...@@ -83,7 +83,7 @@ export default {
}; };
Api.apsupdate(parms) Api.apsupdate(parms)
.then(r => { .then(r => {
this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success("保存成功"); this.$Message.success("保存成功");
this.$emit("on-option-ok"); this.$emit("on-option-ok");
...@@ -92,7 +92,7 @@ export default { ...@@ -92,7 +92,7 @@ export default {
} }
}) })
.catch(err => { .catch(err => {
this.disabled = false;
this.$Message.error("保存失败"); this.$Message.error("保存失败");
console.warn(err); console.warn(err);
}); });
...@@ -102,7 +102,7 @@ export default { ...@@ -102,7 +102,7 @@ export default {
} }
}) })
.catch(err => { .catch(err => {
this.disabled = false;
this.$Message.error("保存失败"); this.$Message.error("保存失败");
console.warn(err); console.warn(err);
}); });
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
...@@ -36,7 +36,7 @@ export default { ...@@ -36,7 +36,7 @@ export default {
name: "Edit", name: "Edit",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
orderCatList: [], orderCatList: [],
rules: { rules: {
...@@ -60,7 +60,7 @@ export default { ...@@ -60,7 +60,7 @@ export default {
handleSubmit() { handleSubmit() {
this.$refs.form.validate(v => { this.$refs.form.validate(v => {
if (v) { if (v) {
this.disabled = true;
let parmsUp = { let parmsUp = {
run_time: this.entity.run_time, run_time: this.entity.run_time,
first_equip: this.entity.eQUIPID, first_equip: this.entity.eQUIPID,
...@@ -83,7 +83,7 @@ export default { ...@@ -83,7 +83,7 @@ export default {
}; };
Api.apsupdate(parms) Api.apsupdate(parms)
.then(r => { .then(r => {
this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success("保存成功"); this.$Message.success("保存成功");
this.$emit("on-option-ok"); this.$emit("on-option-ok");
...@@ -92,7 +92,7 @@ export default { ...@@ -92,7 +92,7 @@ export default {
} }
}) })
.catch(err => { .catch(err => {
this.disabled = false;
this.$Message.error("保存失败"); this.$Message.error("保存失败");
console.warn(err); console.warn(err);
}); });
...@@ -102,7 +102,7 @@ export default { ...@@ -102,7 +102,7 @@ export default {
} }
}) })
.catch(err => { .catch(err => {
this.disabled = false;
this.$Message.error("保存失败"); this.$Message.error("保存失败");
console.warn(err); console.warn(err);
}); });
......
...@@ -413,62 +413,58 @@ ...@@ -413,62 +413,58 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Add', name: "Add",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }] name: [{ required: true, message: "必填", trigger: "blur" }],
} },
} };
}, },
props: { props: {
v: Object v: Object,
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true
Api.create(this.entity) Api.create(this.entity)
.then((r) => { .then((r) => {
this.disabled = false
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('保存失败') this.$Message.error("保存失败");
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false this.$Message.error("保存失败");
this.$Message.error('保存失败') console.warn(err);
console.warn(err) });
})
} }
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'mes_order' + '.' + key key = "mes_order" + "." + key;
return this.$t(key) return this.$t(key);
} },
}, },
watch: { watch: {
v() { v() {
this.entity = this.$u.clone(this.v) this.entity = this.$u.clone(this.v);
} },
} },
} };
</script> </script>
This diff is collapsed.
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
easySearch: { easySearch: {
supportItemId: { op: "In", value: "" }, supportItemId: { op: "In", value: "" },
}, },
disabled: false,
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
...@@ -290,10 +290,10 @@ export default { ...@@ -290,10 +290,10 @@ export default {
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true;
Api.update(this.entity) Api.update(this.entity)
.then((r) => { .then((r) => {
this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success("保存成功"); this.$Message.success("保存成功");
this.$emit("on-ok"); this.$emit("on-ok");
...@@ -302,7 +302,7 @@ export default { ...@@ -302,7 +302,7 @@ export default {
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false;
this.$Message.error("保存失败"); this.$Message.error("保存失败");
console.warn(err); console.warn(err);
}); });
......
...@@ -18,32 +18,30 @@ ...@@ -18,32 +18,30 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Add', name: "Add",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
rules: { rules: {
title: [{ required: true, message: '请填写班次名称', trigger: 'blur' }] title: [{ required: true, message: "请填写班次名称", trigger: "blur" }],
} },
} };
}, },
props: { props: {
v: Object v: Object,
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true
// let parmes = { // let parmes = {
// pageIndex: 1, // pageIndex: 1,
// pageSize: 20, // pageSize: 20,
...@@ -55,52 +53,51 @@ export default { ...@@ -55,52 +53,51 @@ export default {
// } // }
// ], // ],
// total: 4 // total: 4
// } // }
// Api.paged(parmes).then((r) => { // Api.paged(parmes).then((r) => {
// console.log(r.success) // console.log(r.success)
// if(r.success){ // if(r.success){
// this.$Message.error("该班次名称已存在!") // this.$Message.error("该班次名称已存在!")
// this.disabled = true
// return // return
// }else{ // }else{
let pames = { let pames = {
title: this.entity.title, title: this.entity.title,
startendTime: this.entity.startendTime.join('-') startendTime: this.entity.startendTime.join("-"),
} };
Api.create(pames) Api.create(pames)
.then((r) => { .then((r) => {
if (r.success) { if (r.success) {
// this.disabled = false this.$Message.success("保存成功");
this.$Message.success('保存成功') this.entity = {};
this.entity = {} this.$emit("on-ok");
this.$emit('on-ok') } else {
} else { this.$Message.error("保存失败");
this.$Message.error('保存失败') }
} })
}) .catch((err) => {
.catch((err) => { this.$Message.error("保存失败");
this.$Message.error('保存失败') console.warn(err);
console.warn(err) });
}) }
} });
}) // }
// } // })
// })
}, },
handleClose() { handleClose() {
this.entity = {} this.entity = {};
this.disabled = true
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'calendar_class' + '.' + key key = "calendar_class" + "." + key;
return this.$t(key) return this.$t(key);
} },
}, },
watch: { watch: {
v() { v() {
this.entity = this.$u.clone(this.v) this.entity = this.$u.clone(this.v);
} },
} },
} };
</script> </script>
\ No newline at end of file
...@@ -6,88 +6,90 @@ ...@@ -6,88 +6,90 @@
<Input v-model="entity.title"></Input> <Input v-model="entity.title"></Input>
</FormItem> </FormItem>
</Col> </Col>
<Col span="24"> <Col span="24">
<!-- prop="startendTime" --> <!-- prop="startendTime" -->
<FormItem :label="l('startendTime')"> <FormItem :label="l('startendTime')">
<TimePicker type="timerange" format="HH:mm" v-model="entity.startendTime" placeholder="请选择时间段"></TimePicker> <TimePicker
type="timerange"
format="HH:mm"
v-model="entity.startendTime"
placeholder="请选择时间段"
></TimePicker>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Edit', name: "Edit",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
rules: { rules: {
title: [{ required: true, message: '请填写班次名称', trigger: 'blur' }], title: [{ required: true, message: "请填写班次名称", trigger: "blur" }],
// startendTime: [{ required: true, message: '请选择时间段', trigger: 'blur' }], // startendTime: [{ required: true, message: '请选择时间段', trigger: 'blur' }],
} },
} };
}, },
props: { props: {
eid: Number eid: Number,
}, },
methods: { methods: {
load(v) { load(v) {
Api.get({ id: v }).then((r) => { Api.get({ id: v }).then((r) => {
r.result.startendTime=r.result.startendTime.split('-') r.result.startendTime = r.result.startendTime.split("-");
this.entity = r.result this.entity = r.result;
this.$emit('on-load') this.$emit("on-load");
}) });
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
let startendTime = this.entity.startendTime let startendTime = this.entity.startendTime;
let pames={ let pames = {
title: this.entity.title, title: this.entity.title,
startendTime: startendTime.join('-'), startendTime: startendTime.join("-"),
workHours: this.entity.workHours, workHours: this.entity.workHours,
creationTime: this.entity.creationTime, creationTime: this.entity.creationTime,
creatorUserId: this.entity.creatorUserId, creatorUserId: this.entity.creatorUserId,
id: this.entity.id, id: this.entity.id,
} };
Api.update(pames) Api.update(pames)
.then((r) => { .then((r) => {
this.disabled = false
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('保存失败') this.$Message.error("保存失败");
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false this.$Message.error("保存失败");
this.$Message.error('保存失败') console.warn(err);
console.warn(err) });
})
} }
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'calendar_class' + '.' + key key = "calendar_class" + "." + key;
return this.$t(key) return this.$t(key);
} },
}, },
watch: { watch: {
eid(v) { eid(v) {
if (v != 0) { if (v != 0) {
this.load(v) this.load(v);
} }
} },
} },
} };
</script> </script>
\ No newline at end of file
...@@ -18,62 +18,58 @@ ...@@ -18,62 +18,58 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Add', name: "Add",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }] name: [{ required: true, message: "必填", trigger: "blur" }],
} },
} };
}, },
props: { props: {
v: Object v: Object,
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true
Api.create(this.entity) Api.create(this.entity)
.then((r) => { .then((r) => {
this.disabled = false
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('保存失败') this.$Message.error("保存失败");
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false this.$Message.error("保存失败");
this.$Message.error('保存失败') console.warn(err);
console.warn(err) });
})
} }
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'calendar_holiday' + '.' + key key = "calendar_holiday" + "." + key;
return this.$t(key) return this.$t(key);
} },
}, },
watch: { watch: {
v() { v() {
this.entity = this.$u.clone(this.v) this.entity = this.$u.clone(this.v);
} },
} },
} };
</script> </script>
\ No newline at end of file
...@@ -18,70 +18,66 @@ ...@@ -18,70 +18,66 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Edit', name: "Edit",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }] name: [{ required: true, message: "必填", trigger: "blur" }],
} },
} };
}, },
props: { props: {
eid: Number eid: Number,
}, },
methods: { methods: {
load(v) { load(v) {
Api.get({ id: v }).then((r) => { Api.get({ id: v }).then((r) => {
this.entity = r.result this.entity = r.result;
this.$emit('on-load') this.$emit("on-load");
}) });
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true
Api.update(this.entity) Api.update(this.entity)
.then((r) => { .then((r) => {
this.disabled = false
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('保存失败') this.$Message.error("保存失败");
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false this.$Message.error("保存失败");
this.$Message.error('保存失败') console.warn(err);
console.warn(err) });
})
} }
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'calendar_holiday' + '.' + key key = "calendar_holiday" + "." + key;
return this.$t(key) return this.$t(key);
} },
}, },
watch: { watch: {
eid(v) { eid(v) {
if (v != 0) { if (v != 0) {
this.load(v) this.load(v);
} }
} },
} },
} };
</script> </script>
\ No newline at end of file
...@@ -20,104 +20,108 @@ ...@@ -20,104 +20,108 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Add', name: "Add",
data() { data() {
return { return {
disabled: false,
entity: { entity: {
id:[], id: [],
title:"", title: "",
holidayId:[], holidayId: [],
holidayTitle:"", holidayTitle: "",
selectItems:[],//选中的加班日历 selectItems: [], //选中的加班日历
}, },
orderCatList: [], orderCatList: [],
rules: { rules: {
title: [{ required: true, message: '请填写日历名称', trigger: 'blur' }], title: [{ required: true, message: "请填写日历名称", trigger: "blur" }],
holidayId: [ holidayId: [
{ required: true, type: 'array', min: 1, message: '请选择关联假日', trigger: 'change' }, {
] required: true,
} type: "array",
} min: 1,
message: "请选择关联假日",
trigger: "change",
},
],
},
};
}, },
props: { props: {
v: Object v: Object,
}, },
created() { created() {
this.selectAry() this.selectAry();
}, },
methods: { methods: {
selectAry() { selectAry() {
Api.getlist().then((res) => { Api.getlist().then((res) => {
this.orderCatList = res.result this.orderCatList = res.result;
}) });
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true let titles = [];
let titles=[]; this.selectItems.map((u) => {
this.selectItems.map(u=>{ titles.push(u.title + "(" + u.startendTime + ")");
titles.push(u.title+"("+u.startendTime+")") });
})
let parme = { let parme = {
title:this.entity.title, title: this.entity.title,
holidayTitle:titles.join(), holidayTitle: titles.join(),
holidayId:this.entity.holidayId.join(), holidayId: this.entity.holidayId.join(),
} };
Api.create(parme) Api.create(parme)
.then((r) => { .then((r) => {
this.disabled = false
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.entity.holidayId=[]; this.entity.holidayId = [];
this.$refs.form.resetFields(); this.$refs.form.resetFields();
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('保存失败') this.$Message.error("保存失败");
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false this.$Message.error("保存失败");
this.$Message.error('保存失败') console.warn(err);
console.warn(err) });
})
} }
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
getItems(v){ //获取所有选中项; getItems(v) {
var items=this.orderCatList.filter(u=>{ //获取所有选中项;
return v.indexOf(u.id)>-1 var items = this.orderCatList.filter((u) => {
}) return v.indexOf(u.id) > -1;
this.selectItems=items; });
this.selectItems = items;
}, },
getHours(){ //获取工时 getHours() {
let sum=0; //获取工时
this.selectItems.map(u=>{ let sum = 0;
sum+=u.workHours; this.selectItems.map((u) => {
sum += u.workHours;
}); });
return sum; return sum;
}, },
l(key) { l(key) {
key = 'calendar_overtime' + '.' + key key = "calendar_overtime" + "." + key;
return this.$t(key) return this.$t(key);
} },
}, },
watch: { watch: {
v() { v() {
this.entity = this.$u.clone(this.v) this.entity = this.$u.clone(this.v);
} },
} },
} };
</script> </script>
\ No newline at end of file
...@@ -20,108 +20,110 @@ ...@@ -20,108 +20,110 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Edit', name: "Edit",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
selectItems: [], //选中的加班日历 selectItems: [], //选中的加班日历
orderCatList: [], orderCatList: [],
rules: { rules: {
title: [{ required: true, message: '请填写日历名称', trigger: 'blur' }], title: [{ required: true, message: "请填写日历名称", trigger: "blur" }],
classId: [ classId: [
{ required: true, type: 'array', min: 1, message: '请选择关联节日', trigger: 'change' }, {
] required: true,
} type: "array",
} min: 1,
message: "请选择关联节日",
trigger: "change",
},
],
},
};
}, },
props: { props: {
eid: Number eid: Number,
}, },
created() { created() {
this.selectAry() this.selectAry();
}, },
methods: { methods: {
selectAry() { selectAry() {
Api.getlist().then((res) => { Api.getlist().then((res) => {
this.orderCatList = res.result this.orderCatList = res.result;
}) });
}, },
load(v) { load(v) {
Api.get({ id: v }).then((r) => { Api.get({ id: v }).then((r) => {
let dataForm = r.result let dataForm = r.result;
if (dataForm.holidayId) { if (dataForm.holidayId) {
let ids = dataForm.holidayId.split(',') let ids = dataForm.holidayId.split(",");
var uids = [] var uids = [];
ids.map((u) => { ids.map((u) => {
uids.push(parseInt(u)) uids.push(parseInt(u));
}) });
this.getItems(uids) this.getItems(uids);
dataForm.classId = uids dataForm.classId = uids;
} else { } else {
dataForm.classId = [] dataForm.classId = [];
} }
this.entity = dataForm this.entity = dataForm;
this.$emit('on-load') this.$emit("on-load");
}) });
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true let titles = [];
let titles = []
this.selectItems.map((u) => { this.selectItems.map((u) => {
titles.push(u.title + '(' + u.startendTime + ')') titles.push(u.title + "(" + u.startendTime + ")");
}) });
this.entity.holidayTitle = titles.join() this.entity.holidayTitle = titles.join();
var data = this.$u.clone(this.entity) var data = this.$u.clone(this.entity);
data.holidayId = this.entity.classId.join() data.holidayId = this.entity.classId.join();
Api.update(data) Api.update(data)
.then((r) => { .then((r) => {
this.disabled = false
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('保存失败') this.$Message.error("保存失败");
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false this.$Message.error("保存失败");
this.$Message.error('保存失败') console.warn(err);
console.warn(err) });
})
} }
}) });
}, },
getItems(v) { getItems(v) {
var items = this.orderCatList.filter((u) => { var items = this.orderCatList.filter((u) => {
return v.indexOf(u.id) > -1 return v.indexOf(u.id) > -1;
}) });
this.selectItems = items this.selectItems = items;
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'calendar_overtime' + '.' + key key = "calendar_overtime" + "." + key;
return this.$t(key) return this.$t(key);
} },
}, },
watch: { watch: {
eid(v) { eid(v) {
if (v != 0) { if (v != 0) {
this.load(v) this.load(v);
} }
} },
} },
} };
</script> </script>
\ No newline at end of file
...@@ -20,119 +20,123 @@ ...@@ -20,119 +20,123 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Add', name: "Add",
data() { data() {
return { return {
disabled: false,
orderCatList: [], orderCatList: [],
multipleFlag: false, multipleFlag: false,
vlableLis : [], vlableLis: [],
sum: 0, sum: 0,
idList : [], idList: [],
titleClass:'', titleClass: "",
titleClass02:'', titleClass02: "",
entity: { entity: {
id:[], id: [],
title:"", title: "",
calendarClassId:[], calendarClassId: [],
calendarClassTitle:"", calendarClassTitle: "",
workHours:0 workHours: 0,
}, },
selectItems:[],//选中的加班日历 selectItems: [], //选中的加班日历
rules: { rules: {
title: [{ required: true, message: '请填写日历名称', trigger: 'blur' }], title: [{ required: true, message: "请填写日历名称", trigger: "blur" }],
calendarClassId: [ calendarClassId: [
{ required: true, type: 'array', min: 1, message: '请选择关联班次', trigger: 'change' }, {
] required: true,
} type: "array",
} min: 1,
message: "请选择关联班次",
trigger: "change",
},
],
},
};
}, },
props: { props: {
v: Object v: Object,
}, },
created() { created() {
this.selectAry() this.selectAry();
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true let titles = [];
let titles=[]; this.selectItems.map((u) => {
this.selectItems.map(u=>{ titles.push(u.title + "(" + u.startendTime + ")");
titles.push(u.title+"("+u.startendTime+")") });
})
let parme = { let parme = {
title:this.entity.title, title: this.entity.title,
calendarClassTitle:titles.join(), calendarClassTitle: titles.join(),
calendarClassId:this.entity.calendarClassId.join(), calendarClassId: this.entity.calendarClassId.join(),
workHours:this.getHours() workHours: this.getHours(),
} };
Api.create(parme) Api.create(parme)
.then((r) => { .then((r) => {
this.disabled = false
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.entity.calendarClassId=[]; this.entity.calendarClassId = [];
this.$refs.form.resetFields(); this.$refs.form.resetFields();
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('保存失败') this.$Message.error("保存失败");
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false this.$Message.error("保存失败");
this.$Message.error('保存失败') console.warn(err);
console.warn(err) });
})
} }
}) });
}, },
handleClose() { handleClose() {
this.orderCatList = [] this.orderCatList = [];
this.$emit('on-close') this.$emit("on-close");
}, },
selectAry() { selectAry() {
let parmse = { let parmse = {
pageIndex: 0, pageIndex: 0,
cont: 0, cont: 0,
conditions: [], conditions: [],
pageSize: 0 pageSize: 0,
} };
Api.getlist().then((res) => { Api.getlist().then((res) => {
this.orderCatList = res.result this.orderCatList = res.result;
}) });
}, },
getItems(v){ //获取所有选中项; getItems(v) {
var items=this.orderCatList.filter(u=>{ //获取所有选中项;
return v.indexOf(u.id)>-1 var items = this.orderCatList.filter((u) => {
}) return v.indexOf(u.id) > -1;
this.selectItems=items; });
this.selectItems = items;
}, },
getHours(){ //获取工时 getHours() {
let sum=0; //获取工时
this.selectItems.map(u=>{ let sum = 0;
sum+=u.workHours; this.selectItems.map((u) => {
sum += u.workHours;
}); });
return sum; return sum;
}, },
l(key) { l(key) {
key = 'calendar_work' + '.' + key key = "calendar_work" + "." + key;
return this.$t(key) return this.$t(key);
} },
}, },
watch: { watch: {
v() { v() {
this.entity = this.$u.clone(this.v) this.entity = this.$u.clone(this.v);
} },
} },
} };
</script> </script>
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</FormItem> </FormItem>
</Col> </Col>
<Col span="24"> <Col span="24">
<FormItem :label="l('calendarClassTitle')"prop="classId" > <FormItem :label="l('calendarClassTitle')" prop="classId">
<Select v-model="entity.classId" multiple @on-change="getItems"> <Select v-model="entity.classId" multiple @on-change="getItems">
<Option <Option
v-for="item in orderCatList" v-for="item in orderCatList"
...@@ -20,117 +20,119 @@ ...@@ -20,117 +20,119 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Edit', name: "Edit",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
orderCatList: [], orderCatList: [],
selectItems: [], //选中的加班日历 selectItems: [], //选中的加班日历
rules: { rules: {
title: [{ required: true, message: '请填写日历名称', trigger: 'blur' }], title: [{ required: true, message: "请填写日历名称", trigger: "blur" }],
classId: [ classId: [
{ required: true, type: 'array', min: 1, message: '请选择关联班次', trigger: 'change' }, {
] required: true,
} type: "array",
} min: 1,
message: "请选择关联班次",
trigger: "change",
},
],
},
};
}, },
props: { props: {
eid: Number eid: Number,
}, },
created() { created() {
this.selectList() this.selectList();
}, },
methods: { methods: {
load(v) { load(v) {
Api.get({ id: v }).then((r) => { Api.get({ id: v }).then((r) => {
let dataForm = r.result let dataForm = r.result;
if(dataForm.calendarClassId){ if (dataForm.calendarClassId) {
let ids = dataForm.calendarClassId.split(',') let ids = dataForm.calendarClassId.split(",");
var uids=[]; var uids = [];
ids.map(u=>{ ids.map((u) => {
uids.push(parseInt(u)) uids.push(parseInt(u));
}) });
this.getItems(uids); this.getItems(uids);
dataForm.classId=uids; dataForm.classId = uids;
}else{ } else {
dataForm.classId=[]; dataForm.classId = [];
} }
this.entity = dataForm this.entity = dataForm;
this.$emit('on-load') this.$emit("on-load");
}) });
}, },
selectList() { selectList() {
Api.getlist().then((res) => { Api.getlist().then((res) => {
this.orderCatList = res.result this.orderCatList = res.result;
}) });
}, },
getItems(v) { getItems(v) {
//获取所有选中项; //获取所有选中项;
var items = this.orderCatList.filter((u) => { var items = this.orderCatList.filter((u) => {
return v.indexOf(u.id) > -1 return v.indexOf(u.id) > -1;
}) });
this.selectItems = items this.selectItems = items;
}, },
getHours() { getHours() {
let sum = 0 let sum = 0;
this.selectItems.map((u) => { this.selectItems.map((u) => {
sum += u.workHours sum += u.workHours;
}) });
return sum return sum;
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true let titles = [];
let titles=[]; this.selectItems.map((u) => {
this.selectItems.map(u=>{ titles.push(u.title + "(" + u.startendTime + ")");
titles.push(u.title+"("+u.startendTime+")") });
}) this.entity.calendarClassTitle = titles.join();
this.entity.calendarClassTitle=titles.join(); var data = this.$u.clone(this.entity);
var data=this.$u.clone(this.entity); data.calendarClassId = this.entity.classId.join();
data.calendarClassId=this.entity.classId.join(); data.workHours = this.getHours();
data.workHours=this.getHours();
Api.update(data) Api.update(data)
.then((r) => { .then((r) => {
this.disabled = false
if (r.success) { if (r.success) {
this.$Message.success('保存成功'); this.$Message.success("保存成功");
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('保存失败') this.$Message.error("保存失败");
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false this.$Message.error("保存失败");
this.$Message.error('保存失败') console.warn(err);
console.warn(err) });
})
} }
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'calendar_work' + '.' + key key = "calendar_work" + "." + key;
return this.$t(key) return this.$t(key);
} },
}, },
watch: { watch: {
eid(v) { eid(v) {
if (v != 0) { if (v != 0) {
this.load(v) this.load(v);
} }
} },
} },
} };
</script> </script>
\ No newline at end of file
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<Dictionary code="crm.contract.status" v-model="entity.status"></Dictionary> <Dictionary code="crm.contract.status" v-model="entity.status"></Dictionary>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
<FormItem :label="l('accessory')" prop="accessory"> <FormItem :label="l('accessory')" prop="accessory">
<files ref="refFile" :parms="parms" files /> <files ref="refFile" :parms="parms" files />
</FormItem> </FormItem>
...@@ -38,103 +38,103 @@ ...@@ -38,103 +38,103 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Add', name: "Add",
data() { data() {
return { return {
disabled: false,
entity: { entity: {
projectId:1 projectId: 1,
}, },
rules: { rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }] name: [{ required: true, message: "必填", trigger: "blur" }],
}, },
parms: { parms: {
app: 'contract', app: "contract",
eid: null, eid: null,
name: '', name: "",
field: '' field: "",
} },
} };
}, },
props: { props: {
v: Object v: Object,
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
// alert(this.parms.eid) // alert(this.parms.eid)
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.entity.accessory = '' this.entity.accessory = "";
if (this.$refs.refFile.nameList.length > 0) { if (this.$refs.refFile.nameList.length > 0) {
let nameList=this.$refs.refFile.nameList let nameList = this.$refs.refFile.nameList;
let names=[] let names = [];
nameList.forEach(e => { nameList.forEach((e) => {
names.push(e.fileName) names.push(e.fileName);
}); });
this.entity.accessory = JSON.stringify(names).replace('[','').replace(']','').replace(/\"/g,'')//附件本地库暂存文件名称 this.entity.accessory = JSON.stringify(names)
.replace("[", "")
.replace("]", "")
.replace(/\"/g, ""); //附件本地库暂存文件名称
} }
this.disabled = true
Api.create(this.entity) Api.create(this.entity)
.then((r) => { .then((r) => {
this.disabled = false
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.$emit('on-ok') this.$emit("on-ok");
let newId = r.result let newId = r.result;
this.updateEid(newId) //更新服务器上的id this.updateEid(newId); //更新服务器上的id
// this.parms.eid = this.$u.guid() ??????? // this.parms.eid = this.$u.guid() ???????
} else { } else {
this.$Message.error('保存失败') this.$Message.error("保存失败");
} }
this.$refs.refFile.intFiles() this.$refs.refFile.intFiles();
}) })
.catch((err) => { .catch((err) => {
this.disabled = false this.$Message.error("保存失败");
this.$Message.error('保存失败') console.warn(err);
console.warn(err) });
})
} }
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'Contract' + '.' + key key = "Contract" + "." + key;
return this.$t(key) return this.$t(key);
}, },
//新增时将uid转为eid //新增时将uid转为eid
updateEid(newId) { updateEid(newId) {
let parms = { let parms = {
eid: this.parms.eid, eid: this.parms.eid,
id: newId + '' id: newId + "",
} };
this.$http.sysUser.updateEid(parms).then((res) => { this.$http.sysUser.updateEid(parms).then((res) => {
if (res.status) { if (res.status) {
// this.$Message.success('修改成功!') // this.$Message.success('修改成功!')
} else { } else {
//this.$Message.error('修改失败!') //this.$Message.error('修改失败!')
} }
}) });
} },
}, },
mounted() { mounted() {
this.parms.eid = this.$u.guid() this.parms.eid = this.$u.guid();
this.$refs.refFile.intFiles() this.$refs.refFile.intFiles();
}, },
watch: { watch: {
v() { v() {
this.entity = this.$u.clone(this.v) this.entity = this.$u.clone(this.v);
} },
} },
} };
</script> </script>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<Dictionary code="crm.contract.status" v-model="entity.status"></Dictionary> <Dictionary code="crm.contract.status" v-model="entity.status"></Dictionary>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
<FormItem :label="l('accessory')" prop="accessory"> <FormItem :label="l('accessory')" prop="accessory">
<files ref="refFile" :parms="parms" files /> <files ref="refFile" :parms="parms" files />
</FormItem> </FormItem>
...@@ -38,90 +38,87 @@ ...@@ -38,90 +38,87 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Edit', name: "Edit",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }] name: [{ required: true, message: "必填", trigger: "blur" }],
}, },
parms: { parms: {
app: 'contract', app: "contract",
eid: null, eid: null,
name: '', name: "",
field: '' field: "",
} },
} };
}, },
props: { props: {
eid: Number eid: Number,
}, },
methods: { methods: {
load(v) { load(v) {
Api.get({ id: v }).then((r) => { Api.get({ id: v }).then((r) => {
this.entity = r.result this.entity = r.result;
this.parms.eid = r.result.id this.parms.eid = r.result.id;
this.$refs.refFile.intFiles() this.$refs.refFile.intFiles();
this.$emit('on-load') this.$emit("on-load");
}) });
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true
if (this.$refs.refFile.nameList.length > 0) { if (this.$refs.refFile.nameList.length > 0) {
let nameList=this.$refs.refFile.nameList let nameList = this.$refs.refFile.nameList;
let names=[] let names = [];
nameList.forEach(e => { nameList.forEach((e) => {
names.push(e.fileName) names.push(e.fileName);
}); });
this.entity.accessory = JSON.stringify(names).replace('[','').replace(']','').replace(/\"/g,'')//附件本地库暂存文件名称 this.entity.accessory = JSON.stringify(names)
} .replace("[", "")
else .replace("]", "")
{ .replace(/\"/g, ""); //附件本地库暂存文件名称
this.entity.accessory = '' } else {
this.entity.accessory = "";
} }
Api.update(this.entity) Api.update(this.entity)
.then((r) => { .then((r) => {
this.disabled = false
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('保存失败') this.$Message.error("保存失败");
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false this.$Message.error("保存失败");
this.$Message.error('保存失败') console.warn(err);
console.warn(err) });
})
} }
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'Contract' + '.' + key key = "Contract" + "." + key;
return this.$t(key) return this.$t(key);
} },
}, },
watch: { watch: {
eid(v) { eid(v) {
if (v != 0) { if (v != 0) {
this.load(v) this.load(v);
} }
} },
} },
} };
</script> </script>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('status')" prop="status"> <FormItem :label="l('status')" prop="status">
<Dictionary code="crm.customer.status" v-model="entity.status"></Dictionary> <Dictionary code="crm.customer.status" v-model="entity.status"></Dictionary>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
...@@ -68,62 +68,58 @@ ...@@ -68,62 +68,58 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Add', name: "Add",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }] name: [{ required: true, message: "必填", trigger: "blur" }],
} },
} };
}, },
props: { props: {
v: Object v: Object,
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true
Api.create(this.entity) Api.create(this.entity)
.then((r) => { .then((r) => {
this.disabled = false
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('保存失败') this.$Message.error("保存失败");
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false this.$Message.error("保存失败");
this.$Message.error('保存失败') console.warn(err);
console.warn(err) });
})
} }
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'Customer' + '.' + key key = "Customer" + "." + key;
return this.$t(key) return this.$t(key);
} },
}, },
watch: { watch: {
v() { v() {
this.entity = this.$u.clone(this.v) this.entity = this.$u.clone(this.v);
} },
} },
} };
</script> </script>
...@@ -6,10 +6,8 @@ ...@@ -6,10 +6,8 @@
<Input v-model="entity.name"></Input> <Input v-model="entity.name"></Input>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('shopName')" prop="shopName"> <FormItem :label="l('shopName')" prop="shopName">{{shopName}}</FormItem>
{{shopName}}
</FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('duties')" prop="duties"> <FormItem :label="l('duties')" prop="duties">
...@@ -28,7 +26,7 @@ ...@@ -28,7 +26,7 @@
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('status')" prop="status"> <FormItem :label="l('status')" prop="status">
<Dictionary code="crm.connector.status" v-model="entity.status"></Dictionary> <Dictionary code="crm.connector.status" v-model="entity.status"></Dictionary>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
...@@ -38,67 +36,63 @@ ...@@ -38,67 +36,63 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Add', name: "Add",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }] name: [{ required: true, message: "必填", trigger: "blur" }],
} },
} };
}, },
props: { props: {
v: Object, v: Object,
shopId:{type:Number,default:0}, shopId: { type: Number, default: 0 },
shopName:String, shopName: String,
customerId: Number, customerId: Number,
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
this.entity.shopId=this.shopId this.entity.shopId = this.shopId;
this.entity.customerId=this.customerId this.entity.customerId = this.customerId;
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true
Api.createConnector(this.entity) Api.createConnector(this.entity)
.then((r) => { .then((r) => {
this.disabled = false
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('保存失败') this.$Message.error("保存失败");
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false this.$Message.error("保存失败");
this.$Message.error('保存失败') console.warn(err);
console.warn(err) });
})
} }
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'Connector' + '.' + key key = "Connector" + "." + key;
return this.$t(key) return this.$t(key);
} },
}, },
watch: { watch: {
v() { v() {
this.entity = this.$u.clone(this.v) this.entity = this.$u.clone(this.v);
} },
} },
} };
</script> </script>
...@@ -43,27 +43,26 @@ ...@@ -43,27 +43,26 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'AddShop', name: "AddShop",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }] name: [{ required: true, message: "必填", trigger: "blur" }],
} },
} };
}, },
props: { props: {
v: Object, v: Object,
objInfo: Object objInfo: Object,
}, },
created() {}, created() {},
mounted() {}, mounted() {},
...@@ -72,48 +71,45 @@ export default { ...@@ -72,48 +71,45 @@ export default {
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true if (JSON.stringify(this.objInfo) != "{}") {
if (JSON.stringify(this.objInfo) != '{}') {
if (this.objInfo.upId == -100) { if (this.objInfo.upId == -100) {
this.entity.upId = 0 this.entity.upId = 0;
} else { } else {
this.entity.upId = this.objInfo.upId this.entity.upId = this.objInfo.upId;
} }
this.entity.customerId = this.objInfo.customerId this.entity.customerId = this.objInfo.customerId;
Api.createshoptree(this.entity) Api.createshoptree(this.entity)
.then((r) => { .then((r) => {
this.disabled = false
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('保存失败') this.$Message.error("保存失败");
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false this.$Message.error("保存失败");
this.$Message.error('保存失败') console.warn(err);
console.warn(err) });
})
} }
} }
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'Shop' + '.' + key key = "Shop" + "." + key;
return this.$t(key) return this.$t(key);
}, },
reset() { reset() {
this.entity = {} this.entity = {};
} },
}, },
computed: { computed: {
listenStore() { listenStore() {
return this.objInfo return this.objInfo;
} },
}, },
watch: { watch: {
// shopid(v) { // shopid(v) {
...@@ -121,6 +117,6 @@ export default { ...@@ -121,6 +117,6 @@ export default {
// // this.load(v) // // this.load(v)
// } // }
// } // }
} },
} };
</script> </script>
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
...@@ -79,7 +79,6 @@ export default { ...@@ -79,7 +79,6 @@ export default {
name: "Edit", name: "Edit",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
...@@ -97,12 +96,10 @@ export default { ...@@ -97,12 +96,10 @@ export default {
}); });
}, },
handleSubmit() { handleSubmit() {
this.disabled = true;
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
Api.update(this.entity) Api.update(this.entity)
.then((r) => { .then((r) => {
this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success("保存成功"); this.$Message.success("保存成功");
this.$emit("on-ok"); this.$emit("on-ok");
...@@ -111,12 +108,8 @@ export default { ...@@ -111,12 +108,8 @@ export default {
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false;
this.$Message.error("保存失败"); this.$Message.error("保存失败");
}); });
} else {
this.disabled = false;
} }
}); });
}, },
......
...@@ -7,9 +7,7 @@ ...@@ -7,9 +7,7 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('shopName')" prop="shopName"> <FormItem :label="l('shopName')" prop="shopName">{{shopName}}</FormItem>
{{shopName}}
</FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('duties')" prop="duties"> <FormItem :label="l('duties')" prop="duties">
...@@ -28,7 +26,7 @@ ...@@ -28,7 +26,7 @@
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('status')" prop="status"> <FormItem :label="l('status')" prop="status">
<Dictionary code="crm.connector.status" v-model="entity.status"></Dictionary> <Dictionary code="crm.connector.status" v-model="entity.status"></Dictionary>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
...@@ -38,71 +36,67 @@ ...@@ -38,71 +36,67 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Edit', name: "Edit",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }] name: [{ required: true, message: "必填", trigger: "blur" }],
} },
} };
}, },
props: { props: {
eid: Number, eid: Number,
shopName: String, shopName: String,
}, },
methods: { methods: {
load(v) { load(v) {
Api.getConnector({ id: v }).then((r) => { Api.getConnector({ id: v }).then((r) => {
this.entity = r.result this.entity = r.result;
this.$emit('on-load') this.$emit("on-load");
}) });
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true
Api.updateConnector(this.entity) Api.updateConnector(this.entity)
.then((r) => { .then((r) => {
this.disabled = false
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('保存失败') this.$Message.error("保存失败");
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false this.$Message.error("保存失败");
this.$Message.error('保存失败') console.warn(err);
console.warn(err) });
})
} }
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'Connector' + '.' + key key = "Connector" + "." + key;
return this.$t(key) return this.$t(key);
} },
}, },
watch: { watch: {
eid(v) { eid(v) {
if (v != 0) { if (v != 0) {
this.load(v) this.load(v);
} }
} },
} },
} };
</script> </script>
...@@ -28,85 +28,81 @@ ...@@ -28,85 +28,81 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'editShop', name: "editShop",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }] name: [{ required: true, message: "必填", trigger: "blur" }],
} },
} };
}, },
props: { props: {
eid: Number eid: Number,
}, },
created() {}, created() {},
mounted() { mounted() {
if (this.eid != 0) { if (this.eid != 0) {
this.load(this.eid) this.load(this.eid);
} }
}, },
methods: { methods: {
load(v) { load(v) {
Api.getshop({ id: v }).then((r) => { Api.getshop({ id: v }).then((r) => {
if (r.success) { if (r.success) {
this.entity = r.result this.entity = r.result;
} }
}) });
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true
Api.updateshoptree(this.entity) Api.updateshoptree(this.entity)
.then((r) => { .then((r) => {
this.disabled = false
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('保存失败') this.$Message.error("保存失败");
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false this.$Message.error("保存失败");
this.$Message.error('保存失败') console.warn(err);
console.warn(err) });
})
} }
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'Shop' + '.' + key key = "Shop" + "." + key;
return this.$t(key) return this.$t(key);
}, },
reset() { reset() {
this.entity = {} this.entity = {};
} },
}, },
computed: { computed: {
listenStore() { listenStore() {
return this.objInfo return this.objInfo;
} },
}, },
watch: { watch: {
eid(v) { eid(v) {
if (v != 0) { if (v != 0) {
this.load(v) this.load(v);
} }
} },
} },
} };
</script> </script>
...@@ -74,128 +74,124 @@ ...@@ -74,128 +74,124 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Add', name: "Add",
data() { data() {
return { return {
disabled: false,
entity: { entity: {
name: '', name: "",
customerId: 0, customerId: 0,
isInform: 0, isInform: 0,
status: 0, status: 0,
shopId: null shopId: null,
}, },
principalList: [], principalList: [],
rules: { rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }] name: [{ required: true, message: "必填", trigger: "blur" }],
}, },
list: [], list: [],
data1: [], data1: [],
treeData: [] treeData: [],
} };
}, },
props: { props: {
v: Object, v: Object,
customerId: Number customerId: Number,
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true
Api.create(this.entity) Api.create(this.entity)
.then((r) => { .then((r) => {
this.disabled = false
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('保存失败') this.$Message.error("保存失败");
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false this.$Message.error("保存失败");
this.$Message.error('保存失败') console.warn(err);
console.warn(err) });
})
} }
}) });
}, },
initTree(v) { initTree(v) {
var sumData = [] var sumData = [];
Api.getshoptree({ id: v }) Api.getshoptree({ id: v })
.then((r) => { .then((r) => {
console.log(r) console.log(r);
if (r.result) { if (r.result) {
this.data1 = r.result this.data1 = r.result;
} else { } else {
this.$Message.error('加载部门失败!') this.$Message.error("加载部门失败!");
} }
}) })
.catch((err) => {}) .catch((err) => {});
}, },
renderContent(h, { root, node, data }) { renderContent(h, { root, node, data }) {
//渲染树的样式 //渲染树的样式
return h( return h(
'span', "span",
{ {
style: { style: {
cursor: 'pointer' cursor: "pointer",
}, },
on: { on: {
click: () => { click: () => {
this.handleSelect(data) //手动选择树节点 this.handleSelect(data); //手动选择树节点
} },
} },
}, },
data.title data.title
) );
}, },
handleSelect(data) { handleSelect(data) {
let obj = { let obj = {
label: data.title, label: data.title,
value: data.value value: data.value,
} };
this.list = [] this.list = [];
this.list.push(obj) this.list.push(obj);
this.entity.shopId = this.list[0].value this.entity.shopId = this.list[0].value;
}, },
principals(id) { principals(id) {
//根据主管部选择负责人 //根据主管部选择负责人
Api.customerconnectors({ id: id }).then((r) => { Api.customerconnectors({ id: id }).then((r) => {
this.principalList = r.result this.principalList = r.result;
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'Project' + '.' + key key = "Project" + "." + key;
return this.$t(key) return this.$t(key);
} },
}, },
watch: { watch: {
customerId(v) { customerId(v) {
if (v > 0) { if (v > 0) {
this.entity.name = '' this.entity.name = "";
this.entity.stage = '' this.entity.stage = "";
this.entity.notes = '' this.entity.notes = "";
this.entity.budget = '' this.entity.budget = "";
this.entity.customerId = v this.entity.customerId = v;
this.initTree(v) this.initTree(v);
this.principals(v) this.principals(v);
} }
} },
} },
} };
</script> </script>
\ No newline at end of file
...@@ -66,70 +66,66 @@ ...@@ -66,70 +66,66 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Edit', name: "Edit",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }] name: [{ required: true, message: "必填", trigger: "blur" }],
} },
} };
}, },
props: { props: {
eid: Number eid: Number,
}, },
methods: { methods: {
load(v) { load(v) {
Api.get({ id: v }).then((r) => { Api.get({ id: v }).then((r) => {
this.entity = r.result this.entity = r.result;
this.$emit('on-load') this.$emit("on-load");
}) });
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true
Api.update(this.entity) Api.update(this.entity)
.then((r) => { .then((r) => {
this.disabled = false
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('保存失败') this.$Message.error("保存失败");
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false this.$Message.error("保存失败");
this.$Message.error('保存失败') console.warn(err);
console.warn(err) });
})
} }
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'Project' + '.' + key key = "Project" + "." + key;
return this.$t(key) return this.$t(key);
} },
}, },
watch: { watch: {
eid(v) { eid(v) {
if (v != 0) { if (v != 0) {
this.load(v) this.load(v);
} }
} },
} },
} };
</script> </script>
\ No newline at end of file
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
...@@ -84,24 +84,23 @@ export default { ...@@ -84,24 +84,23 @@ export default {
name: "Add", name: "Add",
data() { data() {
return { return {
disabled: false,
entity: { entity: {
userId: 1, //销售人员id默认为1 userId: 1, //销售人员id默认为1
projectId: 0, projectId: 0,
customerId: 0, customerId: 0,
status: 1, status: 1,
principal: 0, principal: 0,
stage: 1 stage: 1,
}, },
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }] name: [{ required: true, message: "必填", trigger: "blur" }],
}, },
parms: { parms: {
app: "Follow", app: "Follow",
eid: null, eid: null,
name: "", name: "",
field: "" field: "",
} },
}; };
}, },
props: { props: {
...@@ -109,8 +108,8 @@ export default { ...@@ -109,8 +108,8 @@ export default {
addId: { addId: {
projectId: Number, projectId: Number,
customerId: Number, customerId: Number,
principal: String principal: String,
} },
}, },
mounted() { mounted() {
this.parms.eid = this.$u.guid(); this.parms.eid = this.$u.guid();
...@@ -118,13 +117,13 @@ export default { ...@@ -118,13 +117,13 @@ export default {
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs.form.validate(v => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.entity.accessory = ""; this.entity.accessory = "";
if (this.$refs.refFile.nameList.length > 0) { if (this.$refs.refFile.nameList.length > 0) {
let nameList = this.$refs.refFile.nameList; let nameList = this.$refs.refFile.nameList;
let names = []; let names = [];
nameList.forEach(e => { nameList.forEach((e) => {
names.push(e.fileName); names.push(e.fileName);
}); });
this.entity.accessory = JSON.stringify(names) this.entity.accessory = JSON.stringify(names)
...@@ -132,10 +131,9 @@ export default { ...@@ -132,10 +131,9 @@ export default {
.replace("]", "") .replace("]", "")
.replace(/\"/g, ""); //附件本地库暂存文件名称 .replace(/\"/g, ""); //附件本地库暂存文件名称
} }
this.disabled = true;
Api.create(this.entity) Api.create(this.entity)
.then(r => { .then((r) => {
this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success("保存成功"); this.$Message.success("保存成功");
this.$emit("on-ok"); this.$emit("on-ok");
...@@ -144,8 +142,7 @@ export default { ...@@ -144,8 +142,7 @@ export default {
} }
this.$refs.refFile.intFiles(); this.$refs.refFile.intFiles();
}) })
.catch(err => { .catch((err) => {
this.disabled = false;
this.$Message.error("保存失败"); this.$Message.error("保存失败");
console.warn(err); console.warn(err);
}); });
...@@ -158,7 +155,7 @@ export default { ...@@ -158,7 +155,7 @@ export default {
l(key) { l(key) {
key = "Follow" + "." + key; key = "Follow" + "." + key;
return this.$t(key); return this.$t(key);
} },
}, },
watch: { watch: {
"addId.projectId"(v) { "addId.projectId"(v) {
...@@ -173,7 +170,7 @@ export default { ...@@ -173,7 +170,7 @@ export default {
}, },
"addId.principal"(v) { "addId.principal"(v) {
this.entity.principal = v; this.entity.principal = v;
} },
} },
}; };
</script> </script>
\ No newline at end of file
...@@ -66,70 +66,66 @@ ...@@ -66,70 +66,66 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Edit', name: "Edit",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }] name: [{ required: true, message: "必填", trigger: "blur" }],
} },
} };
}, },
props: { props: {
eid: Number eid: Number,
}, },
methods: { methods: {
load(v) { load(v) {
Api.get({ id: v }).then((r) => { Api.get({ id: v }).then((r) => {
this.entity = r.result this.entity = r.result;
this.$emit('on-load') this.$emit("on-load");
}) });
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true
Api.update(this.entity) Api.update(this.entity)
.then((r) => { .then((r) => {
this.disabled = false
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('保存失败') this.$Message.error("保存失败");
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false this.$Message.error("保存失败");
this.$Message.error('保存失败') console.warn(err);
console.warn(err) });
})
} }
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'Follow' + '.' + key key = "Follow" + "." + key;
return this.$t(key) return this.$t(key);
} },
}, },
watch: { watch: {
eid(v) { eid(v) {
if (v != 0) { if (v != 0) {
this.load(v) this.load(v);
} }
} },
} },
} };
</script> </script>
\ No newline at end of file
...@@ -25,10 +25,10 @@ ...@@ -25,10 +25,10 @@
</Radio> </Radio>
</RadioGroup> </RadioGroup>
<ColorPicker v-model="color" recommend /> <ColorPicker v-model="color" recommend />
<Button @click="addLine" type="primary">划线</Button> <Button @click="addLine" type="primary" v-noClick>划线</Button>
<Button @click="clear" type="warning">清空</Button> <Button @click="clear" type="warning" v-noClick>清空</Button>
<Button @click="save" type="success">保存</Button> <Button @click="save" type="success" v-noClick>保存</Button>
<Button @click="draw" type="success">重绘</Button> <Button @click="draw" type="success" v-noClick>重绘</Button>
</div> </div>
<baidu-map <baidu-map
class="map" class="map"
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
</Col> </Col>
<Col span="5"> <Col span="5">
<FormItem label> <FormItem label>
<Button class="mr10" @click="saveCase">保存方案</Button> <Button class="mr10" @click="saveCase" v-noClick>保存方案</Button>
<Button type="primary" :disabled="disableFlag" @click="setPaiCase">确认派工</Button> <Button type="primary" :disabled="disableFlag" @click="setPaiCase" v-noClick>确认派工</Button>
</FormItem> </FormItem>
</Col> </Col>
<Col span="3"> <Col span="3">
......
...@@ -2,64 +2,64 @@ ...@@ -2,64 +2,64 @@
<Form ref="form" :model="entity" :rules="rules" :label-width="140"> <Form ref="form" :model="entity" :rules="rules" :label-width="140">
<Row> <Row>
<Col :span="12"> <Col :span="12">
<FormItem label="物料编码:" prop=""> <FormItem label="物料编码:" prop>
<Input placeholder="请输入物料编码" v-model="entity.projectNo" /> <Input placeholder="请输入物料编码" v-model="entity.projectNo" />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="零件图号:" prop=""> <FormItem label="零件图号:" prop>
<Input placeholder="请输入零件图号" v-model="entity.lingNo" /> <Input placeholder="请输入零件图号" v-model="entity.lingNo" />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="零件名称:" prop=""> <FormItem label="零件名称:" prop>
<Input placeholder="请输入零件名称" v-model="entity.lingName" /> <Input placeholder="请输入零件名称" v-model="entity.lingName" />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="工艺规程/工序号:" prop=""> <FormItem label="工艺规程/工序号:" prop>
<Input placeholder="请输入工艺规程/工序号" v-model="entity.produCode" /> <Input placeholder="请输入工艺规程/工序号" v-model="entity.produCode" />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="工序名称:" prop=""> <FormItem label="工序名称:" prop>
<Input placeholder="请输入工序名称" v-model="entity.produName" /> <Input placeholder="请输入工序名称" v-model="entity.produName" />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="程序名称:" prop=""> <FormItem label="程序名称:" prop>
<Input placeholder="请输入程序名称" v-model="entity.projecName" /> <Input placeholder="请输入程序名称" v-model="entity.projecName" />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="程序文件名称:" prop=""> <FormItem label="程序文件名称:" prop>
<Input placeholder="请输入程序文件名称" v-model="entity.fileName" /> <Input placeholder="请输入程序文件名称" v-model="entity.fileName" />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="版本号:" prop=""> <FormItem label="版本号:" prop>
<Input placeholder="请输入版本号" v-model="entity.tvb" /> <Input placeholder="请输入版本号" v-model="entity.tvb" />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="创建人:" prop=""> <FormItem label="创建人:" prop>
<Input placeholder="请输入创建人" v-model="entity.creatUser" /> <Input placeholder="请输入创建人" v-model="entity.creatUser" />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="状态:" prop=""> <FormItem label="状态:" prop>
{{entity.statue}} {{entity.statue}}
<!-- <Input v-model="entity.statue" /> --> <!-- <Input v-model="entity.statue" /> -->
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="备注:" prop=""> <FormItem label="备注:" prop>
<Input placeholder="请输入备注信息" v-model="entity.notse" /> <Input placeholder="请输入备注信息" v-model="entity.notse" />
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
...@@ -69,13 +69,12 @@ export default { ...@@ -69,13 +69,12 @@ export default {
name: "Edit", name: "Edit",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
orderCatList: [], orderCatList: [],
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }] name: [{ required: true, message: "必填", trigger: "blur" }],
}, },
single: false single: false,
}; };
}, },
props: { props: {
...@@ -83,15 +82,15 @@ export default { ...@@ -83,15 +82,15 @@ export default {
type: Object, type: Object,
default: () => { default: () => {
return null; return null;
} },
} },
}, },
methods: { methods: {
load(v) { load(v) {
this.entity = v; this.entity = v;
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate(v => { this.$refs.form.validate((v) => {
if (v) { if (v) {
} }
}); });
...@@ -102,15 +101,15 @@ export default { ...@@ -102,15 +101,15 @@ export default {
l(key) { l(key) {
key = "mes_op_task_execute" + "." + key; key = "mes_op_task_execute" + "." + key;
return this.$t(key); return this.$t(key);
} },
}, },
watch: { watch: {
// row(v) { // row(v) {
// if (v != {}) { // if (v != {}) {
//alert(JSON.stringify(v)) //alert(JSON.stringify(v))
// this.entity = v; // this.entity = v;
// } // }
// } // }
} },
}; };
</script> </script>
...@@ -2,64 +2,64 @@ ...@@ -2,64 +2,64 @@
<Form ref="form" :model="entity" :rules="rules" :label-width="140"> <Form ref="form" :model="entity" :rules="rules" :label-width="140">
<Row> <Row>
<Col :span="12"> <Col :span="12">
<FormItem label="物料编码:" prop=""> <FormItem label="物料编码:" prop>
<Input placeholder="请输入物料编码" v-model="entity.projectNo" /> <Input placeholder="请输入物料编码" v-model="entity.projectNo" />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="零件图号:" prop=""> <FormItem label="零件图号:" prop>
<Input placeholder="请输入零件图号" v-model="entity.lingNo" /> <Input placeholder="请输入零件图号" v-model="entity.lingNo" />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="零件名称:" prop=""> <FormItem label="零件名称:" prop>
<Input placeholder="请输入零件名称" v-model="entity.lingName" /> <Input placeholder="请输入零件名称" v-model="entity.lingName" />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="工艺规程/工序号:" prop=""> <FormItem label="工艺规程/工序号:" prop>
<Input placeholder="请输入工艺规程/工序号" v-model="entity.produCode" /> <Input placeholder="请输入工艺规程/工序号" v-model="entity.produCode" />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="工序名称:" prop=""> <FormItem label="工序名称:" prop>
<Input placeholder="请输入工序名称" v-model="entity.produName" /> <Input placeholder="请输入工序名称" v-model="entity.produName" />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="程序名称:" prop=""> <FormItem label="程序名称:" prop>
<Input placeholder="请输入程序名称" v-model="entity.projecName" /> <Input placeholder="请输入程序名称" v-model="entity.projecName" />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="程序文件名称:" prop=""> <FormItem label="程序文件名称:" prop>
<Input placeholder="请输入程序文件名称" v-model="entity.fileName" /> <Input placeholder="请输入程序文件名称" v-model="entity.fileName" />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="版本号:" prop=""> <FormItem label="版本号:" prop>
<Input placeholder="请输入版本号" v-model="entity.tvb" /> <Input placeholder="请输入版本号" v-model="entity.tvb" />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="创建人:" prop=""> <FormItem label="创建人:" prop>
<Input placeholder="请输入创建人" v-model="entity.creatUser" /> <Input placeholder="请输入创建人" v-model="entity.creatUser" />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="状态:" prop=""> <FormItem label="状态:" prop>
{{entity.statue}} {{entity.statue}}
<!-- <Input v-model="entity.statue" /> --> <!-- <Input v-model="entity.statue" /> -->
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="备注:" prop=""> <FormItem label="备注:" prop>
<Input placeholder="请输入备注信息" v-model="entity.notse" /> <Input placeholder="请输入备注信息" v-model="entity.notse" />
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
...@@ -69,13 +69,12 @@ export default { ...@@ -69,13 +69,12 @@ export default {
name: "Edit", name: "Edit",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
orderCatList: [], orderCatList: [],
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }] name: [{ required: true, message: "必填", trigger: "blur" }],
}, },
single: false single: false,
}; };
}, },
props: { props: {
...@@ -83,62 +82,61 @@ export default { ...@@ -83,62 +82,61 @@ export default {
type: Object, type: Object,
default: () => { default: () => {
return null; return null;
} },
} },
}, },
methods: { methods: {
load(v) { load(v) {
this.entity = v; this.entity = v;
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate(v => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true;
let parmsUp = { let parmsUp = {
run_time: this.entity.run_time, run_time: this.entity.run_time,
first_equip: this.entity.eQUIPID, first_equip: this.entity.eQUIPID,
id: this.entity.id id: this.entity.id,
}; };
// Api.updatesetuptimeandfirstequip(parmsUp) // Api.updatesetuptimeandfirstequip(parmsUp)
// .then(res => { // .then(res => {
// if (res.success) { // if (res.success) {
// if (!this.single) { // if (!this.single) {
// this.$Message.success("保存成功"); // this.$Message.success("保存成功");
// this.$emit("on-option-ok"); // this.$emit("on-option-ok");
// } else { // } else {
// let parms = { // let parms = {
// id: this.entity.routing_detail_id, //工序ID // id: this.entity.routing_detail_id, //工序ID
// name: this.entity.task_name, //工序名 // name: this.entity.task_name, //工序名
// task_seq: this.entity.task_seq, //工序号 // task_seq: this.entity.task_seq, //工序号
// resource_id: this.entity.eQUIPID, //设备id // resource_id: this.entity.eQUIPID, //设备id
// runtime: this.entity.run_time, //单件工时 // runtime: this.entity.run_time, //单件工时
// department_id: 0 //班组ID // department_id: 0 //班组ID
// }; // };
// Api.apsupdate(parms) // Api.apsupdate(parms)
// .then(r => { // .then(r => {
// this.disabled = false;
// if (r.success) { // if (r.success) {
// this.$Message.success("保存成功"); // this.$Message.success("保存成功");
// this.$emit("on-option-ok"); // this.$emit("on-option-ok");
// } else { // } else {
// this.$Message.error("保存失败"); // this.$Message.error("保存失败");
// } // }
// }) // })
// .catch(err => { // .catch(err => {
// this.disabled = false;
// this.$Message.error("保存失败"); // this.$Message.error("保存失败");
// console.warn(err); // console.warn(err);
// }); // });
// } // }
// } else { // } else {
// this.$Message.error("保存失败"); // this.$Message.error("保存失败");
// } // }
// }) // })
// .catch(err => { // .catch(err => {
// this.disabled = false;
// this.$Message.error("保存失败"); // this.$Message.error("保存失败");
// console.warn(err); // console.warn(err);
// }); // });
} }
}); });
}, },
...@@ -148,7 +146,7 @@ export default { ...@@ -148,7 +146,7 @@ export default {
l(key) { l(key) {
key = "mes_op_task_execute" + "." + key; key = "mes_op_task_execute" + "." + key;
return this.$t(key); return this.$t(key);
} },
}, },
watch: { watch: {
row(v) { row(v) {
...@@ -156,7 +154,7 @@ export default { ...@@ -156,7 +154,7 @@ export default {
// alert(JSON.stringify(v)) // alert(JSON.stringify(v))
this.entity = v; this.entity = v;
} }
} },
} },
}; };
</script> </script>
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
...@@ -82,7 +82,6 @@ export default { ...@@ -82,7 +82,6 @@ export default {
keys: { op: "title", value: null }, keys: { op: "title", value: null },
receiverId: { op: "Equal", value: this.$store.state.userInfo.userId }, receiverId: { op: "Equal", value: this.$store.state.userInfo.userId },
}, },
disabled: false,
entity: {}, entity: {},
modal1: false, modal1: false,
modal: false, modal: false,
...@@ -197,12 +196,10 @@ export default { ...@@ -197,12 +196,10 @@ export default {
add() { add() {
this.entity1 = {}; this.entity1 = {};
this.modal1 = true; this.modal1 = true;
this.disabled = false;
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true;
this.entity1.attachment = ""; this.entity1.attachment = "";
if (this.$refs.refFile.nameList.length > 0) { if (this.$refs.refFile.nameList.length > 0) {
let nameList = this.$refs.refFile.nameList; let nameList = this.$refs.refFile.nameList;
...@@ -225,12 +222,10 @@ export default { ...@@ -225,12 +222,10 @@ export default {
this.modal1 = false; this.modal1 = false;
} else { } else {
this.$Message.error("保存失败"); this.$Message.error("保存失败");
this.disabled = false;
} }
this.$refs.refFile.intFiles(); this.$refs.refFile.intFiles();
}) })
.catch((err) => { .catch((err) => {
this.disabled = false;
this.$Message.error("保存失败"); this.$Message.error("保存失败");
}); });
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<Button type="primary" @click="setImage" v-if="!imgSrc" class="camera-btn">拍照</Button> <Button type="primary" @click="setImage" v-if="!imgSrc" class="camera-btn">拍照</Button>
<Button type="primary" v-if="imgSrc" @click="setFileUpload" class="camera-btn">保存</Button> <Button type="primary" v-if="imgSrc" @click="setFileUpload" class="camera-btn" v-noClick>保存</Button>
</div> </div>
</template> </template>
<script> <script>
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<Row> <Row>
<Col> <Col>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
......
...@@ -21,13 +21,13 @@ ...@@ -21,13 +21,13 @@
<template slot-scope="{ row, index }" slot="action"> <template slot-scope="{ row, index }" slot="action">
<div v-if="editIndex === index"> <div v-if="editIndex === index">
<Button @click="handleSave(index)">保存</Button> <Button @click="handleSave(index)" v-noClick>保存</Button>
<Button @click="handlecancel(row, index)">取消</Button> <Button @click="handlecancel(row, index)">取消</Button>
</div> </div>
<div v-else> <div v-else>
<template v-if="isedit"> <template v-if="isedit">
<Button class="pl10" @click="handleEdit(row, index)">编辑</Button> <Button class="pl10" @click="handleEdit(row, index)" v-noClick>编辑</Button>
<Button @click="handledel(row, index)">删除</Button> <Button @click="handledel(row, index)" v-noClick>删除</Button>
</template> </template>
</div> </div>
</template> </template>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
>{{ item.productcodes }}</Option> >{{ item.productcodes }}</Option>
</Select> </Select>
<Button type="primary" @click="save()" class="title_btn ml10">汇报</Button> <Button type="primary" @click="save()" class="title_btn ml10" v-noClick>汇报</Button>
</div> </div>
<div class="table01"> <div class="table01">
<Table stripe ref="table" border :columns="moviecolumn" :height="taHeight" :data="data1" class="tableCommon"> <Table stripe ref="table" border :columns="moviecolumn" :height="taHeight" :data="data1" class="tableCommon">
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit">确定</Button> <Button type="primary" @click="handleSubmit" v-noClick>确定</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
......
...@@ -44,66 +44,63 @@ ...@@ -44,66 +44,63 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">确定</Button> <Button type="primary" @click="handleSubmit" v-noClick>确定</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import service from '@/plugins/request' import service from "@/plugins/request";
export default { export default {
name: 'usercard', name: "usercard",
components: {}, components: {},
data() { data() {
const validateCarNo = (rule, value, callback) => { const validateCarNo = (rule, value, callback) => {
if (!value) { if (!value) {
return callback(new Error('员工编号不能为空')) return callback(new Error("员工编号不能为空"));
} }
var params = { var params = {
conditions: [ conditions: [
{ {
fieldName: 'cardNo', fieldName: "cardNo",
fieldValue: value, fieldValue: value,
conditionalType: 'Equal' conditionalType: "Equal",
} },
], ],
pageSize: 3 pageSize: 3,
} };
service service.post(`${systemUrl}/user/list`, params).then((response) => {
.post(`${systemUrl}/user/list`, params) if (response.result.length > 0) {
.then((response) => { this.user.user_name = response.result[0].userName;
if (response.result.length > 0) { this.user.user_id = response.result[0].id;
this.user.user_name = response.result[0].userName callback();
this.user.user_id = response.result[0].id } else {
callback() this.user.cardno = "";
} else { return callback(new Error("员工编号不存在"));
this.user.cardno = '' }
return callback(new Error('员工编号不存在')) });
} };
})
}
return { return {
disabled: false,
productdisabled: false, productdisabled: false,
isCurrentUser: false, isCurrentUser: false,
isall: false, isall: false,
width1: '400', width1: "400",
user: { user: {
dispatch_id: 0, dispatch_id: 0,
execute_id: 0, execute_id: 0,
order_id: '', order_id: "",
routingHeaderId: 0, routingHeaderId: 0,
routingDetailId: 0, routingDetailId: 0,
product_code: [], product_code: [],
board_code: [], board_code: [],
cardno: '', cardno: "",
user_id: '', user_id: "",
user_name: '', user_name: "",
remarks: '', remarks: "",
fill_in_user_type: 0, fill_in_user_type: 0,
reportdate: null, reportdate: null,
isreplace: 0 isreplace: 0,
}, },
recordList: [], recordList: [],
isMain: 1, isMain: 1,
...@@ -114,124 +111,121 @@ export default { ...@@ -114,124 +111,121 @@ export default {
board_List: [], board_List: [],
rules: { rules: {
cardno: [ cardno: [
{ required: true, message: '必填', trigger: 'blur' }, { required: true, message: "必填", trigger: "blur" },
{ validator: validateCarNo, trigger: 'blur' } { validator: validateCarNo, trigger: "blur" },
] ],
} },
} };
}, },
mounted() {}, mounted() {},
watch: {}, watch: {},
methods: { methods: {
handleSubmit() { handleSubmit() {
let state = true let state = true;
if (this.product_ID.length == 0) { if (this.product_ID.length == 0) {
state = false state = false;
this.$Message.error('请选择要送检的产品') this.$Message.error("请选择要送检的产品");
return return;
} }
this.user.product_code = this.product_ID.join(',') this.user.product_code = this.product_ID.join(",");
this.user.board_code = this.board_ID.join(',') this.user.board_code = this.board_ID.join(",");
if (state) { if (state) {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
var url = `${PlanUrl}/orderexecutequalityrecord/qccardchecker` var url = `${PlanUrl}/orderexecutequalityrecord/qccardchecker`;
service service
.post( .post(`${url}`, {
`${url}`, user: this.user,
{ card: this.recordList,
user: this.user, })
card: this.recordList
}
)
.then((response) => { .then((response) => {
if (response.success) { if (response.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.$parent.$parent.loadproduct() this.$parent.$parent.loadproduct();
this.$parent.$parent.usercardModal = false this.$parent.$parent.usercardModal = false;
} }
}) })
.catch((error) => { .catch((error) => {
this.$Message.error('保存失败') this.$Message.error("保存失败");
}) });
} }
}) });
} }
}, },
handleClose() {}, handleClose() {},
loadentry(entryModel, fillModel, recordList) { loadentry(entryModel, fillModel, recordList) {
this.user.dispatch_id = entryModel.id this.user.dispatch_id = entryModel.id;
this.user.execute_id = entryModel.executeId this.user.execute_id = entryModel.executeId;
this.user.order_id = entryModel.order_id this.user.order_id = entryModel.order_id;
this.user.routingHeaderId = entryModel.routingHeaderId this.user.routingHeaderId = entryModel.routingHeaderId;
this.user.routingDetailId = entryModel.routingDetailId this.user.routingDetailId = entryModel.routingDetailId;
this.user.fill_in_user_type = fillModel.fill_in_user_type this.user.fill_in_user_type = fillModel.fill_in_user_type;
this.user.cardno = '' this.user.cardno = "";
this.user.user_id = '' this.user.user_id = "";
this.user.user_name = '' this.user.user_name = "";
this.product_code = '' this.product_code = "";
this.board_code = '' this.board_code = "";
this.isCurrentUser = false this.isCurrentUser = false;
this.isMain = entryModel.isMain this.isMain = entryModel.isMain;
this.product_ID = [] this.product_ID = [];
this.board_ID = [] this.board_ID = [];
this.productisabled = fillModel.productisabled this.productisabled = fillModel.productisabled;
if (this.isMain == 1) { if (this.isMain == 1) {
this.productdisabled = false this.productdisabled = false;
} else { } else {
this.productdisabled = true this.productdisabled = true;
} }
this.product_ID.push(fillModel.product_ID) this.product_ID.push(fillModel.product_ID);
this.board_ID.push(fillModel.board_ID) this.board_ID.push(fillModel.board_ID);
if ( if (
fillModel.fill_in_user_type == 1 || fillModel.fill_in_user_type == 1 ||
fillModel.fill_in_user_type == 3 fillModel.fill_in_user_type == 3
) { ) {
this.product_List = fillModel.product_List this.product_List = fillModel.product_List;
this.board_List = fillModel.board_List this.board_List = fillModel.board_List;
} else { } else {
this.board_List = [] this.board_List = [];
this.product_List = [] this.product_List = [];
for (let i = 0; i < fillModel.product_List.length; i++) { for (let i = 0; i < fillModel.product_List.length; i++) {
let obj = fillModel.product_List[i] let obj = fillModel.product_List[i];
if (obj.productstatus == 2 || obj.productstatus == 4) { if (obj.productstatus == 2 || obj.productstatus == 4) {
this.board_List.push(obj) this.board_List.push(obj);
this.product_List.push(obj) this.product_List.push(obj);
} }
} }
} }
this.recordList = recordList this.recordList = recordList;
}, },
peoductAllOnchange(e) { peoductAllOnchange(e) {
if (e) { if (e) {
if (!this.isMain) { if (!this.isMain) {
for (let i = 0; i < this.board_List.length; i++) { for (let i = 0; i < this.board_List.length; i++) {
let obj = this.board_List[i] let obj = this.board_List[i];
this.board_ID.push(obj.boardNumber) this.board_ID.push(obj.boardNumber);
} }
} }
for (let i = 0; i < this.product_List.length; i++) { for (let i = 0; i < this.product_List.length; i++) {
let obj = this.product_List[i] let obj = this.product_List[i];
this.product_ID.push(obj.productids) this.product_ID.push(obj.productids);
} }
} else { } else {
this.product_ID = [] this.product_ID = [];
this.board_ID = [] this.board_ID = [];
} }
}, },
productonchange(e) {}, productonchange(e) {},
boardonchange(e) { boardonchange(e) {
this.product_ID = [] this.product_ID = [];
for (let i = 0; i < this.board_List.length; i++) { for (let i = 0; i < this.board_List.length; i++) {
let obj = this.board_List[i] let obj = this.board_List[i];
for (let j = 0; j < e.length; j++) { for (let j = 0; j < e.length; j++) {
if (obj.boardNumber == e[j]) { if (obj.boardNumber == e[j]) {
this.product_ID.push(obj.productids) this.product_ID.push(obj.productids);
} }
} }
} }
...@@ -240,14 +234,14 @@ export default { ...@@ -240,14 +234,14 @@ export default {
if (e) { if (e) {
console.log(this.$store.state.admin.user.info); console.log(this.$store.state.admin.user.info);
let userInfo = this.$store.state.admin.user.info; let userInfo = this.$store.state.admin.user.info;
this.user.cardno = userInfo.cardNo this.user.cardno = userInfo.cardNo;
this.user.user_name = userInfo.name this.user.user_name = userInfo.name;
this.user.user_id = userInfo.id this.user.user_id = userInfo.id;
} else { } else {
this.user.cardno = '' this.user.cardno = "";
} }
} },
} },
} };
</script> </script>
\ No newline at end of file
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row> <Row>
<Col :span="12">
<Col :span="12">
<FormItem :label="l('name')" prop="name"> <FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input> <Input v-model="entity.name"></Input>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
<FormItem :label="l('file')" prop="file"> <FormItem :label="l('file')" prop="file">
<InputExcel v-model="imgName" :parms="parms" :showButton="false" /> <InputExcel v-model="imgName" :parms="parms" :showButton="false" />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
<FormItem :label="l('remark')" prop="remark"> <FormItem :label="l('remark')" prop="remark">
<Input v-model="entity.remark" type="textarea" :rows="5"></Input> <Input v-model="entity.remark" type="textarea" :rows="5"></Input>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import InputExcel from "@/components/page/inputExcel.vue"; import InputExcel from "@/components/page/inputExcel.vue";
export default { export default {
name: "Add", name: "Add",
components: { components: {
InputExcel InputExcel,
},
data() {
return {
parms: "app=import&eid=" + this.$u.guid() + "&name=excel",
imgName: "",
entity: {
name: "",
file: "",
path: "",
remark: "",
},
rules: {
name: [
{
required: true,
message: "必填",
trigger: "blur",
},
],
file: [
{
required: true,
message: "请上传文件",
trigger: "change",
},
],
},
};
},
props: {
v: Object,
eid: Number,
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
Api.create(this.entity)
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch((err) => {
this.$Message.error("保存失败");
console.warn(err);
});
}
});
}, },
data() { handleClose() {
return { this.$emit("on-close");
disabled: false,
parms: "app=import&eid=" + this.$u.guid() + "&name=excel",
imgName: "",
entity: {
name: "",
file: "",
path: "",
remark: "",
},
rules: {
name: [{
required: true,
message: "必填",
trigger: "blur"
}],
file: [{
required: true,
message: "请上传文件",
trigger: "change"
}]
},
};
}, },
props: { load(v) {
v: Object, Api.get({
eid: Number, id: v,
}).then((r) => {
this.entity = r.result;
this.entity.id = 0;
});
}, },
mounted() { getEid() {
if (this.eid > 0) { this.parms.eid = this.$u.guid();
this.load(this.eid); this.parms.app = "import";
} this.$refs.refFile.intFiles();
}, },
methods: { l(key) {
handleSubmit() { key = "import_center" + "." + key;
this.$refs.form.validate((v) => { return this.$t(key);
if (v) { },
this.disabled = true; },
Api.create(this.entity) watch: {
.then((r) => { imgName(newName, oldName) {
this.disabled = false; const imgPathsArr = JSON.parse(newName);
if (r.success) { this.entity.file = imgPathsArr[0].fileName;
this.$Message.success("保存成功"); this.entity.path = imgPathsArr[0].filePath;
this.$emit("on-ok"); },
} else { v() {
this.$Message.error("保存失败"); this.entity = this.$u.clone(this.v);
}
})
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
}
});
},
handleClose() {
this.$emit("on-close");
},
load(v) {
Api.get({
id: v
}).then((r) => {
this.entity = r.result;
this.entity.id = 0;
});
},
getEid() {
this.parms.eid = this.$u.guid()
this.parms.app = 'import'
this.$refs.refFile.intFiles()
},
l(key) {
key = "import_center" + "." + key;
return this.$t(key);
},
}, },
watch: { eid(v) {
imgName(newName, oldName) { if (v > 0) {
const imgPathsArr = JSON.parse(newName); this.load(v);
this.entity.file = imgPathsArr[0].fileName }
this.entity.path = imgPathsArr[0].filePath
},
v() {
this.entity = this.$u.clone(this.v);
},
eid(v) {
if (v > 0) {
this.load(v);
}
},
}, },
},
}; };
</script> </script>
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
...@@ -79,7 +79,6 @@ export default { ...@@ -79,7 +79,6 @@ export default {
name: "Edit", name: "Edit",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
...@@ -103,10 +102,8 @@ export default { ...@@ -103,10 +102,8 @@ export default {
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true;
Api.update(this.entity) Api.update(this.entity)
.then((r) => { .then((r) => {
this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success("保存成功"); this.$Message.success("保存成功");
this.$emit("on-ok"); this.$emit("on-ok");
...@@ -115,7 +112,6 @@ export default { ...@@ -115,7 +112,6 @@ export default {
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false;
this.$Message.error("保存失败"); this.$Message.error("保存失败");
console.warn(err); console.warn(err);
}); });
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
<Col span="5"> <Col span="5">
<FormItem label> <FormItem label>
<!-- :disabled="disableFlagbao" --> <!-- :disabled="disableFlagbao" -->
<Button class="mr10" @click="saveCase">保存方案</Button> <Button class="mr10" @click="saveCase" v-noClick>保存方案</Button>
<Button type="primary" :disabled="disableFlag" @click="setPaiCase">确认派工</Button> <Button type="primary" :disabled="disableFlag" @click="setPaiCase" v-noClick>确认派工</Button>
</FormItem> </FormItem>
</Col> </Col>
<Col span="3"> <Col span="3">
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
...@@ -88,7 +88,6 @@ export default { ...@@ -88,7 +88,6 @@ export default {
name: "add", name: "add",
data() { data() {
return { return {
disabled: false,
fileds: [], //扩展属性 fileds: [], //扩展属性
entity: { entity: {
name: "", name: "",
...@@ -142,12 +141,10 @@ export default { ...@@ -142,12 +141,10 @@ export default {
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true;
this.entity.storeId = this.eid; this.entity.storeId = this.eid;
this.entity.storeTitle = this.storeTitle; this.entity.storeTitle = this.storeTitle;
Api.create(this.entity) Api.create(this.entity)
.then((r) => { .then((r) => {
this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success("保存成功"); this.$Message.success("保存成功");
this.$emit("on-ok"); this.$emit("on-ok");
...@@ -156,7 +153,6 @@ export default { ...@@ -156,7 +153,6 @@ export default {
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false;
this.$Message.error("保存失败"); this.$Message.error("保存失败");
// console.warn(err); // console.warn(err);
}); });
......
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
...@@ -124,15 +124,14 @@ export default { ...@@ -124,15 +124,14 @@ export default {
name: "Edit", name: "Edit",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }] name: [{ required: true, message: "必填", trigger: "blur" }],
} },
}; };
}, },
props: { props: {
eid: Number eid: Number,
}, },
mounted() { mounted() {
if (this.eid > 0) { if (this.eid > 0) {
...@@ -141,17 +140,15 @@ export default { ...@@ -141,17 +140,15 @@ export default {
}, },
methods: { methods: {
load(v) { load(v) {
Api.get({ id: v }).then(r => { Api.get({ id: v }).then((r) => {
this.entity = r.result; this.entity = r.result;
}); });
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate(v => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true;
Api.update(this.entity) Api.update(this.entity)
.then(r => { .then((r) => {
this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success("保存成功"); this.$Message.success("保存成功");
this.$emit("on-ok"); this.$emit("on-ok");
...@@ -159,8 +156,7 @@ export default { ...@@ -159,8 +156,7 @@ export default {
this.$Message.error("保存失败"); this.$Message.error("保存失败");
} }
}) })
.catch(err => { .catch((err) => {
this.disabled = false;
this.$Message.error("保存失败"); this.$Message.error("保存失败");
console.warn(err); console.warn(err);
}); });
...@@ -173,15 +169,15 @@ export default { ...@@ -173,15 +169,15 @@ export default {
l(key) { l(key) {
key = "stock" + "." + key; key = "stock" + "." + key;
return this.$t(key); return this.$t(key);
} },
}, },
watch: { watch: {
eid(v) { eid(v) {
alert(v) alert(v);
if (v != 0) { if (v != 0) {
this.load(v); this.load(v);
} }
} },
} },
}; };
</script> </script>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</Col>--> </Col>-->
<!-- <Col :span="24" style="text-align: right;"> <!-- <Col :span="24" style="text-align: right;">
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Col>--> </Col>-->
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
...@@ -31,7 +31,6 @@ export default { ...@@ -31,7 +31,6 @@ export default {
name: "Add", name: "Add",
data() { data() {
return { return {
disabled: false,
entity: { entity: {
id: null, id: null,
name: "", name: "",
...@@ -63,10 +62,9 @@ export default { ...@@ -63,10 +62,9 @@ export default {
id: this.entity.id, id: this.entity.id,
minNum: this.entity.minNum, minNum: this.entity.minNum,
}; };
this.disabled = true;
Api.setminnum(params) Api.setminnum(params)
.then((r) => { .then((r) => {
this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success("设置成功"); this.$Message.success("设置成功");
this.$emit("on-ok"); this.$emit("on-ok");
...@@ -75,7 +73,6 @@ export default { ...@@ -75,7 +73,6 @@ export default {
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false;
this.$Message.error("保存失败"); this.$Message.error("保存失败");
console.warn(err); console.warn(err);
}); });
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
</Col> </Col>
<Col :span="24" class="tr mt10"> <Col :span="24" class="tr mt10">
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Col> </Col>
...@@ -112,7 +112,7 @@ export default { ...@@ -112,7 +112,7 @@ export default {
codeRuleId: this.nodeInfo.codeRuleId, codeRuleId: this.nodeInfo.codeRuleId,
codeRuleType: this.nodeInfo.codeRuleType, codeRuleType: this.nodeInfo.codeRuleType,
}, },
disabled: false,
codeList: [], codeList: [],
columns: [ columns: [
{ {
...@@ -270,7 +270,6 @@ export default { ...@@ -270,7 +270,6 @@ export default {
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false;
this.$Message.error(r.error.message); this.$Message.error(r.error.message);
}); });
} }
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
</Col> </Col>
<Col :span="24" class="tr mt10"> <Col :span="24" class="tr mt10">
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Col> </Col>
...@@ -111,7 +111,7 @@ export default { ...@@ -111,7 +111,7 @@ export default {
codeRuleType: this.nodeInfo.codeRuleType, codeRuleType: this.nodeInfo.codeRuleType,
}, },
arr: [], arr: [],
disabled: false,
columns: [ columns: [
{ {
title: "序号", title: "序号",
...@@ -267,7 +267,7 @@ export default { ...@@ -267,7 +267,7 @@ export default {
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false;
this.$Message.error(r.error.message); this.$Message.error(r.error.message);
}); });
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<FormItem label="编码" prop="code"> <FormItem label="编码" prop="code">
<Input v-model="entity.code" placeholder="请输入" disabled></Input> <Input v-model="entity.code" placeholder="请输入" disabled></Input>
</FormItem> </FormItem>
</Col> --> </Col>-->
<Col :span="12"> <Col :span="12">
<FormItem label="名称" prop="name"> <FormItem label="名称" prop="name">
<Input v-model="entity.name" placeholder="请输入"></Input> <Input v-model="entity.name" placeholder="请输入"></Input>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</Col> </Col>
<Col :span="24" style="text-align: right;"> <Col :span="24" style="text-align: right;">
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Col> </Col>
...@@ -52,14 +52,14 @@ export default { ...@@ -52,14 +52,14 @@ export default {
upId: this.nodeInfo.id, upId: this.nodeInfo.id,
code: 0, code: 0,
status: 0, status: 0,
codeRuleId:this.nodeInfo.codeRuleId, codeRuleId: this.nodeInfo.codeRuleId,
codeRuleType: this.nodeInfo.codeRuleType, codeRuleType: this.nodeInfo.codeRuleType,
}, },
upName: this.nodeInfo.title, upName: this.nodeInfo.title,
disabled: false,
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }] name: [{ required: true, message: "必填", trigger: "blur" }],
} },
}; };
}, },
props: ["nodeInfo"], props: ["nodeInfo"],
...@@ -69,10 +69,10 @@ export default { ...@@ -69,10 +69,10 @@ export default {
mounted() {}, mounted() {},
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs.form.validate(v => { this.$refs.form.validate((v) => {
if (v) { if (v) {
Api.create({ categoryDto: this.entity, pro: [] }) Api.create({ categoryDto: this.entity, pro: [] })
.then(r => { .then((r) => {
if (r.success) { if (r.success) {
this.$Message.success("保存成功"); this.$Message.success("保存成功");
this.$emit("on-ok"); this.$emit("on-ok");
...@@ -80,8 +80,7 @@ export default { ...@@ -80,8 +80,7 @@ export default {
this.$Message.error(r.error.message); this.$Message.error(r.error.message);
} }
}) })
.catch(err => { .catch((err) => {
this.disabled = false;
this.$Message.error(r.error.message); this.$Message.error(r.error.message);
}); });
} }
...@@ -89,7 +88,7 @@ export default { ...@@ -89,7 +88,7 @@ export default {
}, },
handleClose() { handleClose() {
this.$emit("on-close"); this.$emit("on-close");
} },
} },
}; };
</script> </script>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</Col> </Col>
<Col :span="24" style="text-align: right;"> <Col :span="24" style="text-align: right;">
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Col> </Col>
...@@ -55,7 +55,7 @@ export default { ...@@ -55,7 +55,7 @@ export default {
codeRuleType: this.nodeInfo.codeRuleType, codeRuleType: this.nodeInfo.codeRuleType,
}, },
upName: this.nodeInfo.title, upName: this.nodeInfo.title,
disabled: false,
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
}, },
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false;
this.$Message.error(r.error.message); this.$Message.error(r.error.message);
}); });
} }
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<Dictionary code="material.code.status" v-model="entity.status"></Dictionary> <Dictionary code="material.code.status" v-model="entity.status"></Dictionary>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('levelNum')" prop="levelNum"> <FormItem :label="l('levelNum')" prop="levelNum">
<InputNumber v-model="entity.levelNum" :max="10" :min="1"></InputNumber> <InputNumber v-model="entity.levelNum" :max="10" :min="1"></InputNumber>
...@@ -32,19 +32,19 @@ ...@@ -32,19 +32,19 @@
<InputNumber v-model="entity.codeLength" :max="5" :min="1"></InputNumber> <InputNumber v-model="entity.codeLength" :max="5" :min="1"></InputNumber>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('materialCodeLength')" prop="materialCodeLength"> <FormItem :label="l('materialCodeLength')" prop="materialCodeLength">
<InputNumber v-model="entity.materialCodeLength" :max="10" :min="1"></InputNumber> <InputNumber v-model="entity.materialCodeLength" :max="10" :min="1"></InputNumber>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
<FormItem :label="l('description')" prop="description"> <FormItem :label="l('description')" prop="description">
<Input v-model="entity.description" type="textarea" :rows="2"></Input> <Input v-model="entity.description" type="textarea" :rows="2"></Input>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
...@@ -55,7 +55,6 @@ export default { ...@@ -55,7 +55,6 @@ export default {
name: "Add", name: "Add",
data() { data() {
return { return {
disabled: false,
entity: { entity: {
creationTime: null, creationTime: null,
creatorUserId: null, creatorUserId: null,
...@@ -71,24 +70,24 @@ export default { ...@@ -71,24 +70,24 @@ export default {
description: "", description: "",
levelNum: null, levelNum: null,
codeLength: null, codeLength: null,
materialCodeLength:null materialCodeLength: null,
}, },
// formValidate:{ // formValidate:{
// name:'',type:'',status:'',levelNum:'',codeLength:'' // name:'',type:'',status:'',levelNum:'',codeLength:''
// }, // },
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
type: [{ required: true, message: "必填"}], type: [{ required: true, message: "必填" }],
status: [{ required: true, message: "必填"}], status: [{ required: true, message: "必填" }],
levelNum: [{ required: true, message: "必填"}], levelNum: [{ required: true, message: "必填" }],
codeLength: [{ required: true, message: "必填"}], codeLength: [{ required: true, message: "必填" }],
materialCodeLength: [{ required: true, message: "必填"}] materialCodeLength: [{ required: true, message: "必填" }],
} },
}; };
}, },
props: { props: {
v: Object, v: Object,
eid: Number eid: Number,
}, },
mounted() { mounted() {
if (this.eid > 0) { if (this.eid > 0) {
...@@ -97,12 +96,10 @@ export default { ...@@ -97,12 +96,10 @@ export default {
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs.form.validate(v => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true;
Api.create(this.entity) Api.create(this.entity)
.then(r => { .then((r) => {
this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success("保存成功"); this.$Message.success("保存成功");
this.$emit("on-ok"); this.$emit("on-ok");
...@@ -110,8 +107,7 @@ export default { ...@@ -110,8 +107,7 @@ export default {
this.$Message.error("保存失败"); this.$Message.error("保存失败");
} }
}) })
.catch(err => { .catch((err) => {
this.disabled = false;
this.$Message.error("保存失败"); this.$Message.error("保存失败");
console.warn(err); console.warn(err);
}); });
...@@ -122,7 +118,7 @@ export default { ...@@ -122,7 +118,7 @@ export default {
this.$emit("on-close"); this.$emit("on-close");
}, },
load(v) { load(v) {
Api.get({ id: v }).then(r => { Api.get({ id: v }).then((r) => {
this.entity = r.result; this.entity = r.result;
this.entity.id = 0; this.entity.id = 0;
}); });
...@@ -130,7 +126,7 @@ export default { ...@@ -130,7 +126,7 @@ export default {
l(key) { l(key) {
key = "coderule" + "." + key; key = "coderule" + "." + key;
return this.$t(key); return this.$t(key);
} },
}, },
watch: { watch: {
v() { v() {
...@@ -140,7 +136,7 @@ export default { ...@@ -140,7 +136,7 @@ export default {
if (v > 0) { if (v > 0) {
this.load(v); this.load(v);
} }
} },
} },
}; };
</script> </script>
\ No newline at end of file
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
...@@ -58,7 +58,6 @@ export default { ...@@ -58,7 +58,6 @@ export default {
name: "Edit", name: "Edit",
data() { data() {
return { return {
disabled: false,
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
...@@ -87,10 +86,8 @@ export default { ...@@ -87,10 +86,8 @@ export default {
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true;
Api.update(this.entity) Api.update(this.entity)
.then((r) => { .then((r) => {
this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success("保存成功"); this.$Message.success("保存成功");
this.$emit("on-ok"); this.$emit("on-ok");
...@@ -99,7 +96,6 @@ export default { ...@@ -99,7 +96,6 @@ export default {
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false;
this.$Message.error("保存失败"); this.$Message.error("保存失败");
console.warn(err); console.warn(err);
}); });
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</Col>--> </Col>-->
<Col :span="24" style="text-align: right;"> <Col :span="24" style="text-align: right;">
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Col> </Col>
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
rootCategoryId: this.nodeInfo.rootCategoryId, //左侧树点击的数据的最顶层id rootCategoryId: this.nodeInfo.rootCategoryId, //左侧树点击的数据的最顶层id
codeRuleType: this.nodeInfo.codeRuleType, codeRuleType: this.nodeInfo.codeRuleType,
}, },
disabled: false,
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
...@@ -172,7 +172,7 @@ export default { ...@@ -172,7 +172,7 @@ export default {
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false;
this.$Message.error(r.error.message); this.$Message.error(r.error.message);
}); });
} }
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</Col>--> </Col>-->
<Col :span="24" style="text-align: right;"> <Col :span="24" style="text-align: right;">
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Col> </Col>
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
}, },
fileds: [], fileds: [],
checkList: [], checkList: [],
disabled: false,
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
}, },
...@@ -211,7 +211,6 @@ export default { ...@@ -211,7 +211,6 @@ export default {
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false;
this.$Message.error(r.error.message); this.$Message.error(r.error.message);
}); });
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
<Col span="18">&nbsp;</Col> <Col span="18">&nbsp;</Col>
<Col span="6"> <Col span="6">
<Button @click="addInfoClose" class="ml20">取消</Button> <Button @click="addInfoClose" class="ml20">取消</Button>
<Button type="primary" @click="addInfo">保存</Button> <Button type="primary" @click="addInfo" v-noClick>保存</Button>
</Col> </Col>
</Row> </Row>
</Form> </Form>
......
This diff is collapsed.
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<Row> <Row>
<Col span="18">&nbsp;</Col> <Col span="18">&nbsp;</Col>
<Col span="6"> <Col span="6">
<Button type="primary" @click="handleSubmit">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</Col> </Col>
</Row> </Row>
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<Row> <Row>
<Col span="18">&nbsp;</Col> <Col span="18">&nbsp;</Col>
<Col span="6"> <Col span="6">
<Button type="primary" @click="handleSubmit">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</Col> </Col>
</Row> </Row>
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
<Col span="18">&nbsp;</Col> <Col span="18">&nbsp;</Col>
<Col span="6"> <Col span="6">
<Button @click="addInfoClose" class="ml20">取消</Button> <Button @click="addInfoClose" class="ml20">取消</Button>
<Button type="primary" @click="addInfo">保存</Button> <Button type="primary" @click="addInfo" v-noClick>保存</Button>
</Col> </Col>
</Row> </Row>
</Form> </Form>
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<Row> <Row>
<Col span="18">&nbsp;</Col> <Col span="18">&nbsp;</Col>
<Col span="6"> <Col span="6">
<Button type="primary" @click="handleSubmit">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</Col> </Col>
</Row> </Row>
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<Row> <Row>
<Col span="18">&nbsp;</Col> <Col span="18">&nbsp;</Col>
<Col span="6"> <Col span="6">
<Button type="primary" @click="handleSubmit">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</Col> </Col>
</Row> </Row>
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
<Col span="18">&nbsp;</Col> <Col span="18">&nbsp;</Col>
<Col span="6"> <Col span="6">
<Button @click="addInfoClose" class="ml20">取消</Button> <Button @click="addInfoClose" class="ml20">取消</Button>
<Button type="primary" @click="addInfo">保存</Button> <Button type="primary" @click="addInfo" v-noClick>保存</Button>
</Col> </Col>
</Row> </Row>
</Form> </Form>
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
></Col> ></Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<Row> <Row>
<Col span="18">&nbsp;</Col> <Col span="18">&nbsp;</Col>
<Col span="6"> <Col span="6">
<Button type="primary" @click="handleSubmit">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</Col> </Col>
</Row> </Row>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment