优化采购

This commit is contained in:
java110 2021-04-29 19:40:49 +08:00
parent 7cb6267c36
commit a38bbbcca1
4 changed files with 88 additions and 7 deletions

View File

@ -106,7 +106,6 @@
</div>
</div>
</div>
<vc:create path="admin/addContract" callBackListener="" callBackFunction=""></vc:create>
<vc:create path="admin/stopContract"></vc:create>
</div>

View File

@ -60,7 +60,8 @@
);
},
_openAddContractModel: function (_contract) {
vc.emit('addContract', 'openAddContractModal', _contract);
//vc.emit('addContract', 'openAddContractModal', _contract);
vc.jumpToPage('/admin.html#/pages/admin/addContract?contractId='+_contract.contractId)
},
_stopContractModel: function (_contract) {

View File

@ -5,6 +5,9 @@
<div class="ibox-title">
<h5>调拨物品</h5>
<div class="ibox-tools" style="top:10px;">
<button type="button" class="btn btn-primary btn-sm"
v-on:click="_goBack()">返回
</button>
<button type="button" class="btn btn-primary btn-sm"
v-on:click="_openAllocationStorehouseModel()">
<i class="fa fa-plus"></i>选择物品
@ -41,8 +44,8 @@
</select>
</td>
<td class="text-center">
<input v-model="resourceStore.curStock" type="text"
placeholder="必填,请填写库存" class="form-control">
<input v-model="resourceStore.curStock" type="text" placeholder="必填,请填写库存"
class="form-control">
</td>
<td class="text-center">
<div class="btn-group">
@ -65,6 +68,35 @@
</div>
</div>
</div>
<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 ">
<textarea v-model="allocationStorehouseManageInfo.remark" placeholder="必填,请填写申请说明"
class="form-control"></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-10"></div>
<div class="col-md-2 " style="margin-bottom:10px; text-align:right">
<button type="button" class="btn btn-primary" style="margin-left:10px;"
v-on:click="_submitApply()">提交
</button>
</div>
</div>
<vc:create path="common/chooseResourceStore" emitChooseResourceStore="allocationStorehouseApply"
emitLoadData="allocationStorehouseApply"></vc:create>

View File

@ -12,7 +12,8 @@
records: 1,
moreCondition: false,
resName: '',
storehouses: []
storehouses: [],
remark: ''
}
},
_initMethod: function () {
@ -28,8 +29,8 @@
return;
}
});
if(!_addFlag){
return ;
if (!_addFlag) {
return;
}
_param.shaName = _param.shName;
_param.shzId = '';
@ -78,6 +79,54 @@
}
);
},
_goBack: function () {
vc.goBack();
},
_submitApply: function () {
//校验数据
if ($that.allocationStorehouseManageInfo.remark == '') {
vc.toast('申请说明不能为空');
return;
}
let _saveFlag = true;
if ($that.allocationStorehouseManageInfo.resourceStores.length < 1) {
vc.toast('请选择物品');
return;
}
$that.allocationStorehouseManageInfo.resourceStores.forEach(item => {
if (parseInt(item.curStock) > parseInt(item.stock)) {
vc.toast(item.name + "库存不足");
_saveFlag = false;
return;
}
});
if (!_saveFlag) {
return;
}
vc.http.apiPost(
'resourceStore.saveAllocationStorehouse',
JSON.stringify($that.allocationStorehouseManageInfo),
{
emulateJSON: true
},
function (json, res) {
if (res.status == 200) {
//关闭model
vc.goBack();
return;
}
vc.toast(json);
},
function (errInfo, error) {
console.log('请求失败处理');
vc.toast(errInfo);
});
}
}
});
})(window.vc);