优化采购申请页面

This commit is contained in:
java110 2020-05-08 10:29:57 +08:00
parent bf5d90b954
commit 70e5b80d8e
4 changed files with 127 additions and 10 deletions

View File

@ -0,0 +1,38 @@
<div class="row">
<div class="col-lg-12">
<div class="ibox">
<div class="ibox-title">
<h5>审批人信息</h5>
<div class="ibox-tools" style="top:10px;">
</div>
</div>
<div class="ibox-content">
<div class="form-group row">
<label class="col-sm-2 col-form-label">所属公司</label>
<div class="col-sm-10">
<vc:create path="frame/orgSelect2" parentModal="purchaseApprovers"
callBackListener="purchaseApprovers" callBackFunction="notify"
namespace="purchaseApprovers"></vc:create>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">所属部门</label>
<div class="col-sm-10">
<vc:create path="frame/departmentSelect2" parentModal="purchaseApprovers"
callBackListener="purchaseApprovers" callBackFunction="notify"
namespace="purchaseApprovers"></vc:create>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">员工</label>
<div class="col-sm-10">
<vc:create path="frame/staffSelect2" parentModal="purchaseApprovers"
callBackListener="purchaseApprovers" callBackFunction="notify"
namespace="purchaseApprovers"></vc:create>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,70 @@
(function (vc) {
vc.extends({
propTypes: {
callBackListener: vc.propTypes.string, //父组件名称
callBackFunction: vc.propTypes.string //父组件监听方法
},
data: {
purchaseApproversInfo: {
flowComponent: 'purchaseApprovers',
staffId: '',
staffName: '',
}
},
watch: {
purchaseApproversInfo: {
deep: true,
handler: function () {
vc.component.savePurchaseApprovers();
}
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on("purchaseApprovers", "notify", function (_param) {
if (_param.hasOwnProperty("staffId")) {
vc.component.purchaseApproversInfo.staffId = _param.staffId;
vc.component.purchaseApproversInfo.staffName = _param.staffName;
}
});
},
methods: {
purchaseApproversValidate: function () {
return vc.validate.validate({
purchaseApproversInfo: vc.component.purchaseApproversInfo
}, {
'purchaseApproversInfo.staffId': [
{
limit: "required",
param: "",
errInfo: "员工不能为空"
},
{
limit: "num",
param: "",
errInfo: "员工信息不正确"
},
],
'purchaseApproversInfo.staffName': [
{
limit: "required",
param: "",
errInfo: "员工名称不能为空"
}
]
});
},
savePurchaseApprovers: function () {
if (vc.component.purchaseApproversValidate()) {
//侦听回传
vc.emit($props.callBackListener, $props.callBackFunction, vc.component.purchaseApproversInfo);
return;
}
}
}
});
})(window.vc);

View File

@ -19,10 +19,10 @@
></vc:create>
</div>
<!-- 联系人 -->
<div v-if="addPurchaseApplyStepInfo.index == 2">
<vc:create path="common/addPurchaseApplyView"
<div v-show="addPurchaseApplyStepInfo.index == 2">
<vc:create path="property/purchaseApprovers"
callBackListener="addPurchaseApplyStep"
callBackFunction="notify2"
callBackFunction="notify3"
></vc:create>
</div>

View File

@ -14,7 +14,9 @@
endUserName:'',
endUserTel:'',
file:'',
resOrderType:''
resOrderType:'',
staffId:'',
staffName:''
}
}
},
@ -27,12 +29,19 @@
_initEvent: function () {
vc.on("addPurchaseApplyStep", "notify", function (viewResourceStoreInfo2) {
vc.component.addPurchaseApplyStepInfo.purchaseApply.resourceStores = viewResourceStoreInfo2.resourceStores;
vc.component.addPurchaseApplyStepInfo.infos[0] = viewResourceStoreInfo2.resourceStores;
});
vc.on("addPurchaseApplyStep", "notify2", function (info) {
vc.component.addPurchaseApplyStepInfo.purchaseApply.description = info.description;
vc.component.addPurchaseApplyStepInfo.purchaseApply.endUserName = info.endUserName;
vc.component.addPurchaseApplyStepInfo.purchaseApply.endUserTel = info.endUserTel;
vc.component.addPurchaseApplyStepInfo.infos[1] = info;
});
vc.on("addPurchaseApplyStep", "notify3", function (info) {
vc.component.addPurchaseApplyStepInfo.purchaseApply.staffId = info.staffId;
vc.component.addPurchaseApplyStepInfo.purchaseApply.staffName = info.staffName;
vc.component.addPurchaseApplyStepInfo.infos[2] = info;
});
},
@ -56,9 +65,9 @@
},
_nextStep: function () {
vc.emit('viewResourceStoreInfo2', 'getSelectResourceStores', null);
var _resourceStores = vc.component.addPurchaseApplyStepInfo.purchaseApply.resourceStores;
if (_resourceStores.length == 0) {
vc.toast("请完善物品信息");
var _currentData = vc.component.addPurchaseApplyStepInfo.infos[vc.component.addPurchaseApplyStepInfo.index];
if (_currentData == null || _currentData == undefined) {
vc.toast("请选择或填写必选信息");
return;
}
for( var i = 0; i < _resourceStores.length; i++){
@ -83,9 +92,9 @@
},
_finishStep: function () {
vc.emit('addPurchaseApplyViewInfo', 'setPurchaseApplyInfo', null);
var _description = vc.component.addPurchaseApplyStepInfo.purchaseApply.description;
if (_description == null || _description == '') {
vc.toast("请填写申请说明");
var _currentData = vc.component.addPurchaseApplyStepInfo.infos[vc.component.addPurchaseApplyStepInfo.index];
if (_currentData == null || _currentData == undefined) {
vc.toast("请选择或填写必选信息");
return;
}
vc.http.post(