Commit 13456309 authored by 仇晓婷's avatar 仇晓婷

Merge branch 'product' of http://git.mes123.com/zhouyx/mes-ui into product

parents 05529d0c 3b409d56
<style lang="less">
.timer {
.ivu-input-number {
width: 60px;
}
> span {
line-height: 30px;
}
}
</style>
<template>
<div class="flex timer">
<div class="fg1">
<InputNumber v-model="hour" :formatter="value => `${value}`" :min="0" :max="100" />
</div>
<span>小时</span>
<div class="fg1">
<InputNumber v-model="minute" :formatter="value => `${value}`" :min="-1" :max="60" />
</div>
<span>分钟</span>
<div class="fg1">
<InputNumber v-model="second" :formatter="value => `${value}`" :min="0" :max="60" />
</div>
<span></span>
</div>
</template>
<script>
export default {
data() {
return {
hour: 0,
minute: 0,
second: 0
};
},
model: {
prop: "value",
event: "on-change",
},
props: {
value: [Number],
},
mounted(){
this.setTime(this.value)
},
methods: {
setTime(v) {
let h = parseInt(v / ( 60 * 60));
this.hour = h;
this.minute = parseInt((v - h * 60 * 60) / 60);
this.second = parseInt(v - h * 60 * 60 - this.minute * 60);
},
change(){
let result=0
result+=this.hour*60*60;
result+=this.minute*60;
result+=this.second;
this.$emit("on-change",result);
}
},
watch: {
value(v){
this.setTime(v);
},
second(v){
if(v>=60){
this.second=0
this.minute+=1;
}
this.change();
},
minute(v){
if(v>=60){
this.minute=0;
this.hour+=1;
}else if(v<0){
this.hour-=1;
this.minute=59;
}
this.change();
},
hour(v){
this.change();
}
}
};
</script>
\ No newline at end of file
...@@ -15362,8 +15362,7 @@ ...@@ -15362,8 +15362,7 @@
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
...@@ -15523,7 +15522,6 @@ ...@@ -15523,7 +15522,6 @@
"version": "2.9.0", "version": "2.9.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
...@@ -15542,7 +15540,6 @@ ...@@ -15542,7 +15540,6 @@
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
...@@ -15645,7 +15642,6 @@ ...@@ -15645,7 +15642,6 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
...@@ -15731,8 +15727,7 @@ ...@@ -15731,8 +15727,7 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
...@@ -15768,7 +15763,6 @@ ...@@ -15768,7 +15763,6 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
...@@ -15832,14 +15826,12 @@ ...@@ -15832,14 +15826,12 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.1.1", "version": "3.1.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
} }
} }
}, },
...@@ -18617,6 +18609,7 @@ ...@@ -18617,6 +18609,7 @@
"minimatch": { "minimatch": {
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
...@@ -19485,7 +19478,6 @@ ...@@ -19485,7 +19478,6 @@
"version": "2.9.0", "version": "2.9.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
...@@ -19504,7 +19496,6 @@ ...@@ -19504,7 +19496,6 @@
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
...@@ -19607,7 +19598,6 @@ ...@@ -19607,7 +19598,6 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
...@@ -19693,8 +19683,7 @@ ...@@ -19693,8 +19683,7 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
...@@ -19794,14 +19783,12 @@ ...@@ -19794,14 +19783,12 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.1.1", "version": "3.1.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
} }
} }
}, },
......
<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"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="date" v-model="entity.creationTime"></DatePicker> <Col :span="12">
</FormItem></Col> <FormItem :label="l('routingHeaderId')" prop="routingHeaderId">
<Col :span="12"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <InputNumber v-model="entity.creatorUserId"></InputNumber> <InputNumber style="width:200px" v-model="entity.routingHeaderId"></InputNumber>
</FormItem></Col> </FormItem>
<Col :span="12"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker> </Col>
</FormItem></Col> <Col :span="12">
<Col :span="12"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <InputNumber v-model="entity.lastModifierUserId"></InputNumber> <FormItem :label="l('routingDetailId')" prop="routingDetailId">
</FormItem></Col> <InputNumber style="width:200px" v-model="entity.routingDetailId"></InputNumber>
<Col :span="12"><FormItem :label="l('isDeleted')" prop="isDeleted"> <Input v-model="entity.isDeleted"> </Input> </FormItem>
</FormItem></Col> </Col>
<Col :span="12"><FormItem :label="l('deleterUserId')" prop="deleterUserId"> <InputNumber v-model="entity.deleterUserId"></InputNumber> <Col :span="12">
</FormItem></Col> <FormItem :label="l('stepSeq')" prop="stepSeq">
<Col :span="12"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="date" v-model="entity.deletionTime"></DatePicker> <!-- <InputNumber v-model="entity.stepSeq"></InputNumber> -->
</FormItem></Col> <Input style="width:300px" v-model="entity.stepSeq"></Input>
<Col :span="12"><FormItem :label="l('routingHeaderId')" prop="routingHeaderId"> <InputNumber v-model="entity.routingHeaderId"></InputNumber> </FormItem>
</FormItem></Col> </Col>
<Col :span="12"><FormItem :label="l('routingDetailId')" prop="routingDetailId"> <InputNumber v-model="entity.routingDetailId"></InputNumber> <Col :span="12">
</FormItem></Col> <FormItem :label="l('name')" prop="name">
<Col :span="12"><FormItem :label="l('classId')" prop="classId"> <InputNumber v-model="entity.classId"></InputNumber> <Input style="width:350px" v-model="entity.name"></Input>
</FormItem></Col> </FormItem>
<Col :span="12"><FormItem :label="l('stepSeq')" prop="stepSeq"> <InputNumber v-model="entity.stepSeq"></InputNumber> </Col>
</FormItem></Col> <Col :span="24">
<Col :span="12"><FormItem :label="l('name')" prop="name"> <Input v-model="entity.name"> </Input> <FormItem :label="l('stepContent')" prop="stepContent">
</FormItem></Col> <i-quill
<Col :span="24"><FormItem :label="l('description')" prop="description"> <Input v-model="entity.description" type="textarea" :rows="5"></Input> v-model="entity.stepContent"
</FormItem></Col> :height="260"
<Col :span="12"><FormItem :label="l('status')" prop="status"> <Dictionary code="Process.Status" v-model="entity.status"></Dictionary> v-paste="handleImg"
</FormItem></Col> />
<Col :span="24"><FormItem :label="l('remark')" prop="remark"> <Input v-model="entity.remark" type="textarea" :rows="5"></Input> <!-- <Input v-model="entity.stepContent" type="textarea" :rows="5"></Input> -->
</FormItem></Col> <!-- <Input v-model="entity.stepContent" type="textarea" :minRows="3", :maxRows="7" ></Input> -->
<Col :span="24"><FormItem :label="l('stepContent')" prop="stepContent"> <Input v-model="entity.stepContent" type="textarea" :rows="5"></Input> </FormItem>
</FormItem></Col> </Col>
<Col :span="12"><FormItem :label="l('extend')" prop="extend"> <Input v-model="entity.extend"> </Input> <Col :span="12">
</FormItem></Col> <FormItem :label="l('status')" prop="status">
</Row> <RadioGroup v-model="entity.status">
<FormItem> <Radio :label="1"></Radio>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Radio :label="0"></Radio>
<Button @click="handleClose" class="ml20">取消</Button> </RadioGroup>
</FormItem> <!-- <Dictionary style="width:100px" code="Process.Status" v-model="entity.status"></Dictionary> -->
</Form> </FormItem>
</template> </Col>
<!--<Col :span="24">
<FormItem :label="l('description')" prop="description">
<Input v-model="entity.description" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('creatorUserId')" prop="creatorUserId">
<InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModificationTime')" prop="lastModificationTime">
<DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isDeleted')" prop="isDeleted">
<Input v-model="entity.isDeleted"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deleterUserId')" prop="deleterUserId">
<InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('classId')" prop="classId">
<InputNumber v-model="entity.classId"></InputNumber>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('remark')" prop="remark">
<Input v-model="entity.remark" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('extend')" prop="extend">
<Input v-model="entity.extend"></Input>
</FormItem>
</Col> -->
</Row>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script> <script>
import Api from './api' import Api from "./api";
export default { import iQuill from '@/components/quill'
name: 'Add', export default {
data() { name: "Add",
return { components: { iQuill },
disabled: false, data() {
entity: {creationTime: null, return {
creatorUserId: null, disabled: false,
lastModificationTime: null, entity: {
lastModifierUserId: null, creationTime: null,
isDeleted: null, creatorUserId: null,
deleterUserId: null, lastModificationTime: null,
deletionTime: null, lastModifierUserId: null,
routingHeaderId: null, isDeleted: null,
routingDetailId: null, deleterUserId: null,
classId: null, deletionTime: null,
stepSeq: null, routingHeaderId: null,
name: "", routingDetailId: null,
description: "", classId: null,
status: null, stepSeq: null,
remark: "", name: "",
stepContent: "", description: "",
extend: ""}, status: null,
rules: { remark: "",
name: [{ required: true, message: '必填', trigger: 'blur' }] stepContent: "",
} extend: ""
} },
}, rules: {
props: { name: [{ required: true, message: "必填", trigger: "blur" }]
v: Object,
eid: Number
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.create(this.entity).then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
}).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;
});
},
l(key) {
key = "routing_step" + "." + key;
return this.$t(key)
} }
}, };
watch: { },
v() { props: {
this.entity = this.$u.clone(this.v) v: Object,
}, eid: Number
eid(v) { },
if (v > 0) { mounted() {
this.load(v); if (this.eid > 0) {
} this.load(this.eid);
} }
},
methods: {
handleSubmit() {
this.$refs.form.validate(v => {
if (v) {
this.disabled = true;
Api.create(this.entity)
.then(r => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch(err => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
} }
});
},
handleImg(e) {
console.warn(e)
// let file = null
// if (
// e.clipboardData &&
// e.clipboardData.items[0] &&
// e.clipboardData.items[0].type &&
// e.clipboardData.items[0].type.indexOf('image') > -1
// ) {
// //这里就是判断是否有粘贴进来的文件且文件为图片格式
// file = e.clipboardData.items[0].getAsFile()
// let reader = new FileReader()
// reader.readAsDataURL(file)
// setTimeout(() => {
// var img = '<img src="' + reader.result + '" alt=""/>'
// this.bugForm.content += img
// }, 1000)
// // new R
// }
},
handleClose() {
this.$emit("on-close");
},
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
this.entity.id = 0;
});
},
l(key) {
key = "routing_step" + "." + key;
return this.$t(key);
}
},
watch: {
v() {
this.entity = this.$u.clone(this.v);
},
eid(v) {
if (v > 0) {
this.load(v);
}
} }
</script> }
\ No newline at end of file };
</script>
\ No newline at end of file
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
return Api.post(`${technologyUrl}routingstep/create`,params); return Api.post(`${technologyUrl}routingstep/create`,params);
}, },
update(params){ update(params){
return Api.post(`${technologyUrl}routingstep/update`,params); return Api.put(`${technologyUrl}routingstep/update`,params);
}, },
delete(id) { delete(id) {
return Api.delete(`${technologyUrl}routingstep/delete`,{params:{id:id}}); return Api.delete(`${technologyUrl}routingstep/delete`,{params:{id:id}});
......
<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"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="date" v-model="entity.creationTime"></DatePicker> <Col :span="12">
</FormItem></Col> <FormItem :label="l('stepSeq')" prop="stepSeq">
<Col :span="12"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <InputNumber v-model="entity.creatorUserId"></InputNumber> <!-- <InputNumber v-model="entity.stepSeq"></InputNumber> -->
</FormItem></Col> <Input style="width:300px" v-model="entity.stepSeq"></Input>
<Col :span="12"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker> </FormItem>
</FormItem></Col> </Col>
<Col :span="12"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <InputNumber v-model="entity.lastModifierUserId"></InputNumber> <Col :span="12">
</FormItem></Col> <FormItem :label="l('name')" prop="name">
<Col :span="12"><FormItem :label="l('isDeleted')" prop="isDeleted"> <Input v-model="entity.isDeleted"> </Input> <Input style="width:350px" v-model="entity.name"></Input>
</FormItem></Col> </FormItem>
<Col :span="12"><FormItem :label="l('deleterUserId')" prop="deleterUserId"> <InputNumber v-model="entity.deleterUserId"></InputNumber> </Col>
</FormItem></Col> <Col :span="24">
<Col :span="12"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="date" v-model="entity.deletionTime"></DatePicker> <FormItem :label="l('stepContent')" prop="stepContent">
</FormItem></Col> <i-quill
<Col :span="12"><FormItem :label="l('routingHeaderId')" prop="routingHeaderId"> <InputNumber v-model="entity.routingHeaderId"></InputNumber> v-model="entity.stepContent"
</FormItem></Col> :height="260"
<Col :span="12"><FormItem :label="l('routingDetailId')" prop="routingDetailId"> <InputNumber v-model="entity.routingDetailId"></InputNumber> v-paste="handleImg"
</FormItem></Col> />
<Col :span="12"><FormItem :label="l('classId')" prop="classId"> <InputNumber v-model="entity.classId"></InputNumber> <!-- <Input v-model="entity.stepContent" type="textarea" :rows="5"></Input> -->
</FormItem></Col> <!-- <Input v-model="entity.stepContent" type="textarea" :minRows="3", :maxRows="7" ></Input> -->
<Col :span="12"><FormItem :label="l('stepSeq')" prop="stepSeq"> <InputNumber v-model="entity.stepSeq"></InputNumber> </FormItem>
</FormItem></Col> </Col>
<Col :span="12"><FormItem :label="l('name')" prop="name"> <Input v-model="entity.name"> </Input> <Col :span="12">
</FormItem></Col> <FormItem :label="l('status')" prop="status">
<Col :span="24"><FormItem :label="l('description')" prop="description"> <Input v-model="entity.description" type="textarea" :rows="5"></Input> <RadioGroup v-model="entity.status">
</FormItem></Col> <Radio :label="1"></Radio>
<Col :span="12"><FormItem :label="l('status')" prop="status"> <Dictionary code="Process.Status" v-model="entity.status"></Dictionary> <Radio :label="0"></Radio>
</FormItem></Col> </RadioGroup>
<Col :span="24"><FormItem :label="l('remark')" prop="remark"> <Input v-model="entity.remark" type="textarea" :rows="5"></Input> <!-- <Dictionary style="width:100px" code="Process.Status" v-model="entity.status"></Dictionary> -->
</FormItem></Col> </FormItem>
<Col :span="24"><FormItem :label="l('stepContent')" prop="stepContent"> <Input v-model="entity.stepContent" type="textarea" :rows="5"></Input> </Col>
</FormItem></Col> <!--<Col :span="24">
<Col :span="12"><FormItem :label="l('extend')" prop="extend"> <Input v-model="entity.extend"> </Input> <FormItem :label="l('description')" prop="description">
</FormItem></Col> <Input v-model="entity.description" type="textarea" :rows="5"></Input>
</Row> </FormItem>
<FormItem> </Col>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Col :span="12">
<Button @click="handleClose" class="ml20">取消</Button> <FormItem :label="l('creationTime')" prop="creationTime">
</FormItem> <DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</Form> </FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('routingHeaderId')" prop="routingHeaderId">
<InputNumber v-model="entity.routingHeaderId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('routingDetailId')" prop="routingDetailId">
<InputNumber v-model="entity.routingDetailId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('creatorUserId')" prop="creatorUserId">
<InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModificationTime')" prop="lastModificationTime">
<DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isDeleted')" prop="isDeleted">
<Input v-model="entity.isDeleted"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deleterUserId')" prop="deleterUserId">
<InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('classId')" prop="classId">
<InputNumber v-model="entity.classId"></InputNumber>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('remark')" prop="remark">
<Input v-model="entity.remark" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('extend')" prop="extend">
<Input v-model="entity.extend"></Input>
</FormItem>
</Col> -->
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { import iQuill from '@/components/quill'
name: 'Edit', export default {
data() { name: "Edit",
return { components: { iQuill },
disabled: false, data() {
entity: { return {
}, disabled: false,
rules: { entity: {},
name: [{ required: true, message: '必填', trigger: 'blur' }] rules: {
} name: [{ required: true, message: "必填", trigger: "blur" }]
}
},
props: {
eid: Number
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
})
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.update(this.entity).then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
}).catch(err => {
this.disabled = false;
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "routing_step" + "." + key;
return this.$t(key)
} }
}, };
watch: { },
eid(v) { props: {
if (v != 0) { eid: Number
this.load(v); },
} mounted() {
} if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
console.log(r)
this.entity = r.result;
// this.entity.status.toString
});
},
handleSubmit() {
this.$refs.form.validate(v => {
if (v) {
this.disabled = true;
Api.update(this.entity)
.then(r => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch(err => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
} }
});
},
handleImg(e) {
console.warn(e)
// let file = null
// if (
// e.clipboardData &&
// e.clipboardData.items[0] &&
// e.clipboardData.items[0].type &&
// e.clipboardData.items[0].type.indexOf('image') > -1
// ) {
// //这里就是判断是否有粘贴进来的文件且文件为图片格式
// file = e.clipboardData.items[0].getAsFile()
// let reader = new FileReader()
// reader.readAsDataURL(file)
// setTimeout(() => {
// var img = '<img src="' + reader.result + '" alt=""/>'
// this.bugForm.content += img
// }, 1000)
// // new R
// }
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "routing_step" + "." + key;
return this.$t(key);
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
} }
}
};
</script> </script>
\ No newline at end of file
<template> <template>
<div> <div>
<DataGrid :columns="columns" ref="grid" :action="action"><template slot="easySearch"><Form ref="formInline" :model="easySearch" inline><FormItem prop="keys"><Input placeholder="请输入关键字工步名称/描述/备注/工步内容" v-model="easySearch.keys.value" /> </FormItem> <DataGrid :columns="columns" ref="grid" :action="action">
<FormItem><Button type="primary" @click="search">查询</Button></FormItem> <template slot="easySearch">
</Form></template> <Form ref="formInline" :model="easySearch" inline>
<template slot="searchForm"> <!-- <Poptip trigger="focus" title="Title" content="请输入关键字工步名称/描述/备注/工步内容"> -->
<Search /> <FormItem prop="keys">
</template> <Input placeholder="请输入关键字工步名称/描述/备注/工步内容" v-model="easySearch.keys.value" />
<template slot="buttons"> </FormItem>
<Button type="primary" @click="add">新增</Button> <!-- <Poptip/> -->
</template> <FormItem>
</DataGrid> <Button type="primary" @click="search">查询</Button>
<Modal v-model="modal" :title="title" width="1200" footer-hide> </FormItem>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" /> </Form>
</Modal> </template>
</div> <template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="add">新增</Button>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
</div>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
import Search from './search' import Search from "./search";
export default { export default {
name: 'list', name: "list",
components:{ components: {
Search Search
}, },
head: { head: {
title: "工步", title: "工步",
author: "henq", author: "henq",
description: "routing_step 4/28/2020 4:23:17 PM", description: "routing_step 4/28/2020 4:23:17 PM"
}, },
data() { data() {
return { return {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys:{op:"name,description,remark,stepContent",value:null} keys: { op: "name,description,remark,stepContent", value: null }
}, },
modal: false, modal: false,
title:"新增", title: "新增",
detail:null, detail: null,
curId: 0, curId: 0,
columns: [ columns: [
{ key:"id",title:this.l("id") ,hide:true ,align:"left" }, { key: "id", title: this.l("id"), hide: true, align: "left" },
{ key:"creationTime",title:this.l("creationTime") ,hide:true ,align:"left" ,high:true }, {
{ key:"creatorUserId",title:this.l("creatorUserId") ,hide:true ,align:"left" ,high:true }, key: "creationTime",
{ key:"lastModificationTime",title:this.l("lastModificationTime") ,hide:true ,align:"left" ,high:true }, title: this.l("creationTime"),
{ key:"lastModifierUserId",title:this.l("lastModifierUserId") ,hide:true ,align:"left" ,high:true }, hide: true,
{ key:"routingHeaderId",title:this.l("routingHeaderId") ,hide:true ,align:"left" }, align: "left",
{ key:"routingDetailId",title:this.l("routingDetailId") ,hide:true ,align:"left" }, high: true
{ key:"classId",title:this.l("classId") ,hide:true ,align:"left" }, },
{ key:"stepSeq",title:this.l("stepSeq") ,align:"left" ,high:true }, {
{ key:"name",title:this.l("name") ,align:"left" ,easy:true ,high:true }, key: "creatorUserId",
{ key:"description",title:this.l("description") ,align:"left" ,easy:true ,high:true }, title: this.l("creatorUserId"),
{ key:"status",title:this.l("status") ,align:"left" ,high:true ,code:'Process.Status' }, hide: true,
{ align: "left",
title: '操作', high: true
key: 'action', },
width: 140, {
align: 'center', key: "lastModificationTime",
render: (h, params) => { title: this.l("lastModificationTime"),
return h('div', { class: "action" }, [ hide: true,
h('op', { attrs: { oprate: 'detail' }, on: { click: () => this.view(params.row.id) } }, '查看'), align: "left",
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'), high: true
h('op', { attrs: { oprate: 'edit'}, on: { click: () => this.edit(params.row.id) } }, '编辑'), },
h('op', { attrs: { oprate: 'delete' }, on: { click: () => this.remove(params.row.id) } }, '删除') {
]) key: "lastModifierUserId",
} title: this.l("lastModifierUserId"),
}, hide: true,
align: "left",
high: true
},
{
key: "routingHeaderId",
title: this.l("routingHeaderId"),
high: true,
align: "left"
},
{
key: "routingDetailId",
title: this.l("routingDetailId"),
high: true,
align: "left"
},
{ key: "classId", title: this.l("classId"), hide: true, align: "left" },
{ key: "stepSeq", title: this.l("stepSeq"), align: "left", high: true },
{
key: "name",
title: this.l("name"),
align: "left",
easy: true,
high: true
},
{
key: "description",
title: this.l("description"),
align: "left",
hide: true
},
{
key: "stepContent",
title: this.l("stepContent"),
align: "left",
hide: true
},
{
key: "status",
title: this.l("status"),
align: "left",
high: true,
code: "Process.Status"
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row.id) }
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h(
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) }
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) }
},
"删除"
)
]);
}
}
] ]
} };
}, },
mounted(){ mounted() {
console.log(this); console.log(this);
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods:{ methods: {
ok() { ok() {
this.$refs.grid.load() this.$refs.grid.load();
this.modal = false this.modal = false;
this.curId = 0; this.curId = 0;
}, },
search() { search() {
this.$refs.grid.reload(this.easySearch) this.$refs.grid.reload(this.easySearch);
}, },
add() { add() {
this.curId = 0; this.curId = 0;
this.title = "新增"; this.title = "新增";
this.detail =()=> import('./add') this.detail = () => import("./add");
this.modal = true; this.modal = true;
}, },
copy(id) { copy(id) {
this.curId = id; this.curId = id;
this.title = "克隆"; this.title = "克隆";
this.detail = () =>import('./add') this.detail = () => import("./add");
this.modal = true; this.modal = true;
}, },
view(id) { view(id) {
this.curId = id; this.curId = id;
this.title = "详情"; this.title = "详情";
this.detail = () =>import('./detail') this.detail = () => import("./detail");
this.modal = true; this.modal = true;
}, },
edit(id) { edit(id) {
this.curId = id; this.curId = id;
this.title = "编辑"; this.title = "编辑";
this.detail = () => import('./edit') this.detail = () => import("./edit");
this.modal = true; this.modal = true;
}, },
remove(id) { remove(id) {
Api.delete(id).then((r) => { Api.delete(id).then(r => {
if (r.success) { if (r.success) {
this.$refs.grid.load(); this.$refs.grid.load();
this.$Message.success('删除成功') this.$Message.success("删除成功");
} }
}) });
}, },
cancel() { cancel() {
this.curId = 0; this.curId = 0;
this.modal = false this.modal = false;
}, },
l(key) { l(key) {
/* /*
routing_step:{ routing_step:{
id:'', id:'',
creationTime:'创建时间', creationTime:'创建时间',
...@@ -142,11 +230,11 @@ keys:{op:"name,description,remark,stepContent",value:null} ...@@ -142,11 +230,11 @@ keys:{op:"name,description,remark,stepContent",value:null}
extend:'扩展字段', extend:'扩展字段',
} }
*/ */
let vkey = "routing_step" + "." + key; let vkey = "routing_step" + "." + key;
return this.$t(vkey)||key return this.$t(vkey) || key;
} }
} }
} };
</script> </script>
<style lang="less"> <style lang="less">
</style> </style>
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
right: 0; right: 0;
// bottom:100%; // bottom:100%;
// right: 100%; // right: 100%;
z-index: 990; z-index: 898;
background-color: white; background-color: white;
// background: red; // background: red;
.top { .top {
......
<template>
<div>
<div v-width="400">
<InputTime v-model="time"></InputTime>
</div>
{{time}}
</div>
</template>
<script>
export default {
layout: 'empty',
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
data() {
return {
time: 39470,
}
},
created() {
// this.setList();
// alert(1234321)
// var arrs = []
// for (let i = 0; i < 5; i++) {
// arrs.push(i)
// }
// this.list = arrs
},
mounted() {
},
methods: {
},
}
</script>
\ No newline at end of file
...@@ -44,6 +44,7 @@ import ProductNumberSelect from '@/components/page/productNumberSelect.vue' ...@@ -44,6 +44,7 @@ import ProductNumberSelect from '@/components/page/productNumberSelect.vue'
import ProductSelect from '@/components/page/productSelect.vue' import ProductSelect from '@/components/page/productSelect.vue'
import DTSpan from '@/components/page/dtSpan.vue' import DTSpan from '@/components/page/dtSpan.vue'
import DTSearch from '@/components/page/dtSearch.vue' import DTSearch from '@/components/page/dtSearch.vue'
import InputTime from '@/components/page/inputTime.vue'
// import FormMaking from 'form-making' // import FormMaking from 'form-making'
// import 'form-making/dist/FormMaking.css' // import 'form-making/dist/FormMaking.css'
...@@ -94,6 +95,7 @@ Vue.component("ProductNumberSelect", ProductNumberSelect) ...@@ -94,6 +95,7 @@ Vue.component("ProductNumberSelect", ProductNumberSelect)
Vue.component("ProductSelect", ProductSelect) Vue.component("ProductSelect", ProductSelect)
Vue.component("DTSpan", DTSpan) Vue.component("DTSpan", DTSpan)
Vue.component("DTSearch", DTSearch) Vue.component("DTSearch", DTSearch)
Vue.component("InputTime", InputTime)
//注入mock //注入mock
// require("../mock") // require("../mock")
......
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