优化 使用人 改成 申请人

This commit is contained in:
java110 2022-07-04 12:16:23 +08:00
parent df25598467
commit 27c9ec2ba1
2 changed files with 24 additions and 28 deletions

View File

@ -9,24 +9,21 @@
</div>
<div class="ibox-content">
<div class="form-group row">
<label class="col-sm-2 col-form-label"><span><vc:i18n name="使用人" namespace="addPurchaseApplyView"></vc:i18n></span></label>
<label class="col-sm-2 col-form-label"><span><vc:i18n name="联系人" namespace="addPurchaseApplyView"></vc:i18n></span></label>
<div class="col-sm-10">
<input :placeholder="vc.i18n('必填,请填写使用人','addPurchaseApplyView')" class="form-control"
v-model="addPurchaseApplyViewInfo.endUserName"/></div>
<input :placeholder="vc.i18n('必填,请填写联系人','addPurchaseApplyView')" class="form-control" v-model="addPurchaseApplyViewInfo.endUserName" /></div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label"><span><vc:i18n name="联系电话" namespace="addPurchaseApplyView"></vc:i18n></span></label>
<div class="col-sm-10">
<input :placeholder="vc.i18n('必填,请填写联系电话','addPurchaseApplyView')" class="form-control"
v-model="addPurchaseApplyViewInfo.endUserTel"/></div>
<input :placeholder="vc.i18n('必填,请填写联系电话','addPurchaseApplyView')" class="form-control" v-model="addPurchaseApplyViewInfo.endUserTel" /></div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label"><span><vc:i18n name="申请说明" namespace="addPurchaseApplyView"></vc:i18n></span></label>
<div class="col-sm-10">
<textarea :placeholder="vc.i18n('必填,请填写申请说明','addPurchaseApplyView')" class="form-control"
v-model="addPurchaseApplyViewInfo.description"></textarea></div>
<textarea :placeholder="vc.i18n('必填,请填写申请说明','addPurchaseApplyView')" class="form-control" v-model="addPurchaseApplyViewInfo.description"></textarea></div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,4 +1,4 @@
(function (vc) {
(function(vc) {
vc.extends({
propTypes: {
@ -8,40 +8,41 @@
data: {
addPurchaseApplyViewInfo: {
flowComponent: 'addPurchaseApplyView',
description:'',
endUserName:'',
endUserTel:'',
description: '',
endUserName: '',
endUserTel: '',
}
},
watch: {
addPurchaseApplyViewInfo: {
deep: true,
handler: function () {
handler: function() {
vc.component.saveAddComplainInfo();
}
}
},
_initMethod: function () {
_initMethod: function() {
let userInfo = vc.getData('/nav/getUserInfo');
$that.addPurchaseApplyViewInfo.endUserName = userInfo.name;
$that.addPurchaseApplyViewInfo.endUserTel = userInfo.tel;
},
_initEvent: function () {
_initEvent: function() {
vc.on('addPurchaseApplyViewInfo', 'setPurchaseApplyInfo', function () {
vc.on('addPurchaseApplyViewInfo', 'setPurchaseApplyInfo', function() {
vc.emit($props.callBackListener, $props.callBackFunction, vc.component.addPurchaseApplyViewInfo);
});
vc.on('addPurchaseApplyViewInfo', 'onIndex', function (_index) {
vc.on('addPurchaseApplyViewInfo', 'onIndex', function(_index) {
vc.component.addPurchaseApplyViewInfo.index = _index;
});
},
methods: {
addComplainValidate: function () {
addComplainValidate: function() {
return vc.validate.validate({
addPurchaseApplyViewInfo: vc.component.addPurchaseApplyViewInfo
}, {
'addPurchaseApplyViewInfo.description': [
{
'addPurchaseApplyViewInfo.description': [{
limit: "required",
param: "",
errInfo: "申请说明不能为空"
@ -52,8 +53,7 @@
errInfo: "申请说明不能超过200位"
},
],
'addPurchaseApplyViewInfo.endUserName': [
{
'addPurchaseApplyViewInfo.endUserName': [{
limit: "required",
param: "",
errInfo: "联系人不能为空"
@ -64,8 +64,7 @@
errInfo: "联系人不能超过50位"
},
],
'addPurchaseApplyViewInfo.endUserTel': [
{
'addPurchaseApplyViewInfo.endUserTel': [{
limit: "required",
param: "",
errInfo: "联系电话不能为空"
@ -79,12 +78,12 @@
});
},
saveAddComplainInfo: function () {
saveAddComplainInfo: function() {
if (vc.component.addComplainValidate()) {
//侦听回传
vc.emit($props.callBackListener, $props.callBackFunction, vc.component.addPurchaseApplyViewInfo);
return;
}else{
} else {
vc.toast(vc.validate.errInfo);
vc.emit($props.callBackListener, $props.callBackFunction, null);
}
@ -92,4 +91,4 @@
}
});
})(window.vc);
})(window.vc);