Commit bb5a45a2 authored by renjintao's avatar renjintao

Merge branch 'master' of git.mes123.com:zhouyx/mes-ui

parents 7cb58806 a0a11d46
...@@ -79,9 +79,9 @@ ...@@ -79,9 +79,9 @@
</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, disabled: false,
...@@ -94,15 +94,15 @@ export default { ...@@ -94,15 +94,15 @@ export default {
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: {
v: Object, v: Object,
...@@ -113,67 +113,67 @@ export default { ...@@ -113,67 +113,67 @@ export default {
} }
}, },
mounted() { mounted() {
this.parms.eid = this.$u.guid() this.parms.eid = this.$u.guid();
this.$refs.refFile.intFiles() this.$refs.refFile.intFiles();
}, },
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)
.replace('[', '') .replace("[", "")
.replace(']', '') .replace("]", "")
.replace(/\"/g, '') //附件本地库暂存文件名称 .replace(/\"/g, ""); //附件本地库暂存文件名称
} }
this.disabled = true this.disabled = true;
Api.create(this.entity) Api.create(this.entity)
.then((r) => { .then(r => {
this.disabled = false 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("保存失败");
} }
this.$refs.refFile.intFiles() this.$refs.refFile.intFiles();
})
.catch((err) => {
this.disabled = false
this.$Message.error('保存失败')
console.warn(err)
}) })
.catch(err => {
this.disabled = false;
this.$Message.error("保存失败");
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: {
'addId.projectId'(v) { "addId.projectId"(v) {
if (v > 0) { if (v > 0) {
this.entity.projectId = v this.entity.projectId = v;
} }
}, },
'addId.customerId'(v) { "addId.customerId"(v) {
if (v > 0) { if (v > 0) {
this.entity.customerId = v this.entity.customerId = v;
} }
}, },
'addId.principal'(v) { "addId.principal"(v) {
this.entity.principal = v this.entity.principal = v;
} }
} }
} };
</script> </script>
\ No newline at end of file
...@@ -290,6 +290,7 @@ export default { ...@@ -290,6 +290,7 @@ export default {
}, },
watch: { watch: {
stage(v) { stage(v) {
this.isactive = null;
this.getList(v); this.getList(v);
}, },
"easySearch.projectId.value"(v) { "easySearch.projectId.value"(v) {
......
...@@ -385,7 +385,7 @@ export default { ...@@ -385,7 +385,7 @@ export default {
params.row.status == 6 ? "Button" : "", //订单状态执行中,暂停 params.row.status == 6 ? "Button" : "", //订单状态执行中,暂停
{ {
props: { props: {
type: "default", type: "success",
size: "small", size: "small",
icon: "ios-pause", icon: "ios-pause",
ghost: true ghost: true
......
...@@ -4,125 +4,125 @@ ...@@ -4,125 +4,125 @@
</div> </div>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: '', name: "",
data() { data() {
return { return {
columns: [ columns: [
{ {
key: 'detailId', key: "detailId",
title: this.l('detailId'), title: this.l("detailId"),
align: 'left' align: "center"
}, },
{ {
key: 'taskSeq', key: "taskSeq",
title: this.l('taskSeq'), title: this.l("taskSeq"),
align: 'left' align: "center"
}, },
{ {
key: 'detailName', key: "detailName",
title: this.l('detailName'), title: this.l("detailName"),
align: 'left' align: "left"
}, },
{ {
key: 'routingCode', key: "routingCode",
title: this.l('routingCode'), title: this.l("routingCode"),
align: 'left' align: "center"
}, },
{ {
key: 'userNames', key: "userNames",
title: this.l('userNames'), title: this.l("userNames"),
align: 'left' align: "center"
}, },
{ {
key: 'demandStartDate', key: "demandStartDate",
title: this.l('demandStartDate'), title: this.l("demandStartDate"),
align: 'center', align: "center",
render: (h, params) => { render: (h, params) => {
return h( return h(
'span', "span",
this.sliceStr(params.row.demandStartDate + ' ', 0, 10), this.sliceStr(params.row.demandStartDate + " ", 0, 10),
params.row.demandStartDate params.row.demandStartDate
) );
} }
}, },
{ {
key: 'demandFinishDate', key: "demandFinishDate",
title: this.l('demandFinishDate'), title: this.l("demandFinishDate"),
align: 'center', align: "center",
render: (h, params) => { render: (h, params) => {
return h( return h(
'span', "span",
this.sliceStr(params.row.demandFinishDate + ' ', 0, 10), this.sliceStr(params.row.demandFinishDate + " ", 0, 10),
params.row.demandFinishDate params.row.demandFinishDate
) );
} }
}, },
{ {
key: 'actualStartDate', key: "actualStartDate",
title: this.l('actualStartDate'), title: this.l("actualStartDate"),
align: 'center', align: "center",
render: (h, params) => { render: (h, params) => {
return h( return h(
'span', "span",
// this.sliceStr(params.row.actualStartDate + ' ', 0, 10), // this.sliceStr(params.row.actualStartDate + ' ', 0, 10),
params.row.actualStartDate == '0001-01-01 00:00:00' params.row.actualStartDate == "0001-01-01 00:00:00"
? '' ? ""
: params.row.actualStartDate : params.row.actualStartDate
) );
} }
}, },
{ {
key: 'actualFinishDate', key: "actualFinishDate",
title: this.l('actualFinishDate'), title: this.l("actualFinishDate"),
align: 'center', align: "center",
render: (h, params) => { render: (h, params) => {
return h( return h(
'span', "span",
// this.sliceStr(params.row.actualFinishDate + ' ', 0, 10), // this.sliceStr(params.row.actualFinishDate + ' ', 0, 10),
params.row.actualFinishDate == '0001-01-01 00:00:00' params.row.actualFinishDate == "0001-01-01 00:00:00"
? '' ? ""
: params.row.actualFinishDate : params.row.actualFinishDate
) );
} }
}, },
{ {
key: 'status', key: "status",
type: 'user', type: "user",
title: this.l('status'), title: this.l("status"),
code: 'plan.order.status', code: "plan.order.status",
align: 'left' align: "center"
} }
] ]
} };
}, },
props: { props: {
result: Array result: Array
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
created() {}, created() {},
methods: { methods: {
//截取字符串 //截取字符串
sliceStr(str, lenS, lenE) { sliceStr(str, lenS, lenE) {
return str.slice(lenS, lenE) return str.slice(lenS, lenE);
}, },
l(key) { l(key) {
let vkey = 'mes_order_watch' + '.' + key let vkey = "mes_order_watch" + "." + 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
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