Commit 2aea26f5 by yangchen

创建单据增加默认值

parent daf1dbd8
...@@ -89,7 +89,12 @@ export default { ...@@ -89,7 +89,12 @@ export default {
}, 0); }, 0);
return return
} }
const workflowState = bill.getMasterData().getValue('billState') // 给bill设置默认值
let defaultValueList = this.defaultValueList
for(let item of defaultValueList){
bill.getMasterData().setValue(item.field,item.defaultValue)
}
const workflowState = bill.getMasterData().getValue('billState') // setV
let readArr = this.templateName.endsWith('_A')?[92]:[90,92];//如果是审批界面话,90能编辑 let readArr = this.templateName.endsWith('_A')?[92]:[90,92];//如果是审批界面话,90能编辑
if (this.state != 'readOnly' && readArr.includes(workflowState)) { if (this.state != 'readOnly' && readArr.includes(workflowState)) {
this.state = 'readOnly'; this.state = 'readOnly';
...@@ -102,7 +107,7 @@ export default { ...@@ -102,7 +107,7 @@ export default {
setTimeout(() => { setTimeout(() => {
that.billClass = bill; that.billClass = bill;
GMS.oldBillData = bill.getBuillData(); GMS.oldBillData = bill.getBuillData();
that.oldBillData = bill.getBuillData(); that.oldBillData = bill.getBuillData(); // 单据整体对象
}, 100); }, 100);
}, },
handleCancel() { handleCancel() {
......
...@@ -29,11 +29,7 @@ ...@@ -29,11 +29,7 @@
</template> </template>
<script> <script>
import introduce from "./util/introduce.js";
import bc_input from "./util/bc_input.js"; import bc_input from "./util/bc_input.js";
import stateFormulaMixins from "./util/control-state-formula.js";
import util from "./util/util";
function validateNull(val) { function validateNull(val) {
if (val instanceof Array) { if (val instanceof Array) {
if (val.length === 0) { if (val.length === 0) {
...@@ -205,4 +201,7 @@ export default { ...@@ -205,4 +201,7 @@ export default {
/deep/ .ivu-input-suffix{ /deep/ .ivu-input-suffix{
cursor: pointer; cursor: pointer;
} }
/deep/ .ivu-input{
background:#f3f3f3!important;
}
</style> </style>
\ No newline at end of file
...@@ -11,6 +11,8 @@ export default { ...@@ -11,6 +11,8 @@ export default {
} else { } else {
templateName = param.viewName; templateName = param.viewName;
} }
let defaultValueList = param.defaultValueList
if ( if (
window.osConfig.appOpenMode && window.osConfig.appOpenMode &&
window.osConfig.appOpenMode == "apploader" window.osConfig.appOpenMode == "apploader"
...@@ -23,6 +25,7 @@ export default { ...@@ -23,6 +25,7 @@ export default {
templateName: templateName, templateName: templateName,
init: true, init: true,
state: '', state: '',
defaultValueList,
}, },
{ {
openWay: "FUNCTAB", openWay: "FUNCTAB",
...@@ -35,6 +38,7 @@ export default { ...@@ -35,6 +38,7 @@ export default {
c.init = true; c.init = true;
c.modal_visible = true; c.modal_visible = true;
c.state = '' c.state = ''
c.defaultValueList = defaultValueList
}) })
} }
}, },
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
:state="state" :state="state"
:params="params" :params="params"
:hideButtonGroup="hideButtonGroup" :hideButtonGroup="hideButtonGroup"
:defaultValueList="defaultValueList"
@loadFinish="loadFinishFun" @loadFinish="loadFinishFun"
></gms-bill-form> ></gms-bill-form>
</div> </div>
...@@ -43,6 +44,7 @@ export default { ...@@ -43,6 +44,7 @@ export default {
}; };
}, },
created() { created() {
this.defaultValueList = this.config.defaultValueList || []
this.type = this.config.id ? "load" : "init"; this.type = this.config.id ? "load" : "init";
this.billId = this.config.id; this.billId = this.config.id;
this.state = this.config.state || ''; this.state = this.config.state || '';
...@@ -124,6 +126,11 @@ export default { ...@@ -124,6 +126,11 @@ export default {
}, 0); }, 0);
return return
} }
// 给bill设置默认值
let defaultValueList = this.defaultValueList
for(let item of defaultValueList){
bill.getMasterData().setValue(item.field,item.defaultValue)
}
this.curBill = bill; this.curBill = bill;
const billState = bill.getMasterData().getValue('billState') const billState = bill.getMasterData().getValue('billState')
let readArr = this.templateName.endsWith('_A')?[92]:[90,92];//如果是审批界面话,90能编辑 let readArr = this.templateName.endsWith('_A')?[92]:[90,92];//如果是审批界面话,90能编辑
......
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