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

物料优化

parent 57c55ca1
<template>
<div>
<span v-if="type=='date'">
<span>
<Tooltip :content="value">
{{value.substr(0,10)}}
{{date}}
</Tooltip>
</span>
<span v-else>{{value.substr(0,19)}}</span>
</div>
</template>
<script>
export default {
name: 'dtSpan',
data() {
return {
date:""
}
},
props: {
......@@ -25,10 +24,22 @@ export default {
default: '2001-01-01 00:00:00'
},
},
created() {},
created() {
this.init()
},
methods: {
init(){
if(this.value&&this.value.length>=19){
this.date=this.value.substr(0,this.type=='date'?10:19)
}
return this.date;
}
},
computed: {},
watch: {}
watch: {
value(){
this.init()
}
}
}
</script>
\ No newline at end of file
......@@ -58,7 +58,7 @@
<!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> -->
<InputFile v-if="li.dataType==7" v-model="entity[li.field]"></InputFile>
<Input v-if="li.dataType==8" type="textarea" v-model="entity[li.field]"></Input>
<state v-if="li.unitName" :value="li.unitName" code="material.main.unitName" type="tag"></state>
<state v-if="li.unitName&&(li.dataType==1||li.dataType==2)" :value="li.unitName" code="material.main.unitName" type="tag"></state>
</FormItem>
</Col>
<!-- <Col :span="24">
......
......@@ -2,23 +2,18 @@
<div>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12">
<!-- <Col :span="12">
<FormItem label="编码" prop="code">
<Input v-model="entity.code" placeholder="请输入" disabled></Input>
</FormItem>
</Col>
</Col>-->
<Col :span="12">
<FormItem label="名称" prop="name">
<Input v-model="entity.name" placeholder="请输入"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem
label="状态"
prop="status"
placeholder="请选择"
v-if="entity.status==3||entity.status==4"
>
<!-- <Col :span="12">
<FormItem label="状态" prop="status" placeholder="请选择">
<Dictionary
code="material.main.status"
v-model="entity.status"
......@@ -27,7 +22,7 @@
:key="entity.status"
></Dictionary>
</FormItem>
</Col>
</Col>-->
<Col :span="12">
<FormItem label="版本" prop="version">
<Input v-model="entity.version" placeholder="请输入"></Input>
......@@ -52,9 +47,9 @@
class="w100"
></InputNumber>
<Dictionary v-if="li.dataType==3" v-model="entity[li.field]" :code="li.note"></Dictionary>
<Input v-if="li.dataType==4" v-model="entity[li.filed]"></Input>
<Input v-if="li.dataType==5" type="textarea" v-model="entity[li.filed]"></Input>
<DatePicker
v-if="li.dataType==5"
v-if="li.dataType==4"
v-model="entity[li.field]"
type="date"
:placeholder="'选择'+li.title"
......@@ -63,6 +58,7 @@
<!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> -->
<InputFile v-if="li.dataType==7" v-model="entity[li.field]"></InputFile>
<Input v-if="li.dataType==8" type="textarea" v-model="entity[li.field]"></Input>
<state v-if="li.unitName&&(li.dataType==1||li.dataType==2)" :value="li.unitName" code="material.main.unitName" type="tag"></state>
</FormItem>
</Col>
<!-- <Col :span="24">
......
......@@ -228,7 +228,7 @@ export default {
search() {
this.$refs.grid.reload(this.easySearch);
},
initCols() {
initCols(delay) {
let conditions = [
{
conditionalType: "Equal",
......@@ -252,6 +252,7 @@ export default {
});
this.cols = this.$u.clone(this.columns);
let extra = items.map(u => {
// console.log(u);
var col = {
key: u.field,
title: u.title
......@@ -259,7 +260,10 @@ export default {
if (u.dataType == 3) {
col.code = u.note;
}
if (u.unitName) {
if (u.dataType == 4) {
col.type = 'date';
}
if (u.unitName&&(u.dataType==1||u.dataType==2)) {
var units = this.$store.getters.dictionaryByKey(
"material.main.unitName"
);
......@@ -267,7 +271,7 @@ export default {
let item = units.filter(p => {
return p.code == u.unitName;
});
console.log(units, item);
// console.log(units, item);
col.title += "(" + item[0].name + ")";
}
return col;
......@@ -275,6 +279,10 @@ export default {
this.cols = this.cols.concat(extra);
var action = this.cols.splice(this.columns.length - 1, 1);
this.cols.push(this.columns[this.columns.length - 1]);
if(delay){
delay();
}
// console.log(this.cols)
}
});
},
......@@ -341,12 +349,14 @@ export default {
handler(newName, oldName) {
console.log("ovo", newName, oldName);
if (newName.rootCategoryId) {
this.initCols();
this.initCols(()=>{
if (newName.categoryId) {
this.easySearch.categoryId.value = newName.ids;
this.$refs.grid.reload(this.easySearch);
}
});
}
if (newName.categoryId) {
this.easySearch.categoryId.value = newName.ids;
this.$refs.grid.reload(this.easySearch);
} else {
if (!newName.categoryId) {
this.easySearch.categoryId.value = "-1";
}
},
......
......@@ -18,7 +18,8 @@
<div v-else-if="li.dataType==8">{{entity[li.field]}}</div>
<div v-else-if="li.dataType==5" v-html="entity[li.field]"></div>
<span v-else>{{entity[li.field]}}</span>
<span v-if="li.unitName" v-text="li.unitName" class="ml10"></span>
<State v-if="li.unitName" :code="li.note" :value="entity[li.field]" />
<!-- <span v-if="li.unitName" v-text="li.unitName" class="ml10"></span> -->
</Filed>
</Row>
</div>
......@@ -257,8 +258,7 @@ export default {
if (this.entity.code) {
codeList.push(this.entity.code);
} else {
codeList.push(this.eid);
codeList.push(this.eid);
}
idList.push(this.eid);
} else {
......@@ -267,8 +267,7 @@ export default {
if (e.code) {
codeList.push(e.code);
} else {
codeList.push(e.id);
codeList.push(e.id);
}
});
}
......
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