mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-25 14:17:54 +08:00
优化派单
This commit is contained in:
parent
323f0dcebf
commit
c48733f1af
4
app.js
4
app.js
@ -33,8 +33,8 @@ let opts = {
|
||||
|
||||
//app.use('/callComponent',proxy('https://app.demo.winqi.cn/',opts));
|
||||
//app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012/',opts));
|
||||
//app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts));
|
||||
app.use('/callComponent',proxy('http://192.168.1.16:8012',opts));
|
||||
app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts));
|
||||
//app.use('/callComponent',proxy('http://192.168.1.16:8012',opts));
|
||||
|
||||
|
||||
//app.listen(3000);
|
||||
|
||||
@ -0,0 +1,39 @@
|
||||
<div id="dispatchRepairModel" class="modal fade" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<h3 class="m-t-none m-b ">报修派单</h3>
|
||||
<div class="ibox-content">
|
||||
<div>
|
||||
<div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">报修师傅</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" v-model="dispatchRepairInfo.staffId">
|
||||
<option selected disabled value="">必填,请选择报修师傅</option>
|
||||
<option v-for="(item,index) in dispatchRepairInfo.repairTypeUsers"
|
||||
:value="item.staffId">{{item.staffName}}</option>
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">处理意见</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea placeholder="必填,请填写处理意见" cols="15" class="form-control"
|
||||
v-model="dispatchRepairInfo.context"></textarea></div>
|
||||
</div>
|
||||
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button"
|
||||
v-on:click="dispatchRepairInfo()"><i class="fa fa-check"></i> 提交
|
||||
</button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
|
||||
data-dismiss="modal">取消
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
137
public/components/property/dispatchRepair/dispatchRepair.js
Normal file
137
public/components/property/dispatchRepair/dispatchRepair.js
Normal file
@ -0,0 +1,137 @@
|
||||
(function (vc) {
|
||||
|
||||
vc.extends({
|
||||
data: {
|
||||
dispatchRepairInfo: {
|
||||
repairId: '',
|
||||
repairType: '',
|
||||
staffId: '',
|
||||
staffName: '',
|
||||
context: '',
|
||||
repairTypeUsers: []
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
//vc.component._initDispatchRepairInfo();
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('dispatchRepair', 'openDispatchRepairModal', function (_repair) {
|
||||
$that.dispatchRepairInfo.repairType = _repair.repairType;
|
||||
$that.dispatchRepairInfo.repairId = _repair.repairId;
|
||||
$that._listRepairTypeUsers()
|
||||
$('#dispatchRepairModel').modal('show');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
dispatchRepairValidate() {
|
||||
return vc.validate.validate({
|
||||
dispatchRepairInfo: vc.component.dispatchRepairInfo
|
||||
}, {
|
||||
'dispatchRepairInfo.repairId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "报修单不能为空"
|
||||
}
|
||||
],
|
||||
'dispatchRepairInfo.staffId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "报修师傅不能为空"
|
||||
}
|
||||
],
|
||||
'dispatchRepairInfo.staffName': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "报修师傅不能为空"
|
||||
}
|
||||
],
|
||||
'dispatchRepairInfo.context': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "处理意见不能为空"
|
||||
}
|
||||
]
|
||||
});
|
||||
},
|
||||
dispatchRepairInfo: function () {
|
||||
if (!vc.component.dispatchRepairValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
|
||||
return;
|
||||
}
|
||||
vc.component.dispatchRepairInfo.communityId = vc.getCurrentCommunity().communityId;
|
||||
|
||||
$that.dispatchRepairInfo.repairTypeUsers.forEach(item => {
|
||||
if(item.staffId == $that.dispatchRepairInfo.staffId){
|
||||
$that.dispatchRepairInfo.staffName = item.staffName;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
vc.http.apiPost(
|
||||
'ownerRepair.repairDispatch',
|
||||
JSON.stringify(vc.component.dispatchRepairInfo),
|
||||
{
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
if (res.status == 200) {
|
||||
//关闭model
|
||||
$('#dispatchRepairModel').modal('hide');
|
||||
vc.component.clearDispatchRepairInfo();
|
||||
vc.emit('repairPoolManage', 'listRepairPool', {});
|
||||
|
||||
return;
|
||||
}
|
||||
vc.toast(json);
|
||||
|
||||
},
|
||||
function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
|
||||
vc.toast(errInfo);
|
||||
|
||||
});
|
||||
},
|
||||
clearDispatchRepairInfo: function () {
|
||||
vc.component.dispatchRepairInfo = {
|
||||
repairId: '',
|
||||
repairType: '',
|
||||
staffId: '',
|
||||
staffName: '',
|
||||
context: '',
|
||||
repairTypeUsers: []
|
||||
};
|
||||
},
|
||||
_listRepairTypeUsers: function () {
|
||||
|
||||
var param = {
|
||||
params: {
|
||||
page: 1,
|
||||
row: 50,
|
||||
communityId: vc.getCurrentCommunity().communityId,
|
||||
repairType: $that.dispatchRepairInfo.repairType
|
||||
}
|
||||
};
|
||||
|
||||
//发送get请求
|
||||
vc.http.apiGet('repair.listRepairTypeUsers',
|
||||
param,
|
||||
function (json, res) {
|
||||
var _repairTypeUserManageInfo = JSON.parse(json);
|
||||
vc.component.dispatchRepairInfo.repairTypeUsers = _repairTypeUserManageInfo.data;
|
||||
|
||||
}, function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
})(window.vc);
|
||||
@ -92,9 +92,9 @@
|
||||
<td class="text-center">{{repairPool.appointmentTime}}</td>
|
||||
<td class="text-center">{{repairPool.stateName}}</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group" v-if="repairPool.repairWay == '100'">
|
||||
<div class="btn-group" v-if="repairPool.repairWay == '200'">
|
||||
<button class="btn-white btn btn-xs"
|
||||
v-on:click="_openEditRepairPoolModel(repairPool)">派单
|
||||
v-on:click="_openDispatchRepairModel(repairPool)">派单
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
@ -121,4 +121,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<vc:create path="property/dispatchRepair"></vc:create>
|
||||
|
||||
</div>
|
||||
@ -92,6 +92,9 @@
|
||||
vc.component.repairPoolManageInfo.moreCondition = true;
|
||||
}
|
||||
},
|
||||
_openDispatchRepairModel:function(_repair){
|
||||
vc.emit('dispatchRepair', 'openDispatchRepairModal',_repair);
|
||||
},
|
||||
_listRepairSettings: function (_page, _rows) {
|
||||
var param = {
|
||||
params: {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user