Commit 86fb273c by chenwq

技师列表

1 parent 4dcd568f
const formRule = {
technicianName: [{ required: true, message: '客户名称不能为空' }]
technicianName: [{ required: true, message: '技师名称不能为空' }]
}
const formItems = [{
......
......@@ -60,6 +60,10 @@ Page({
})
},
handleCancel() {
this.editClear()
},
handleConfirm() {
let { formData, target, customerInfo, addOrEdit } = this.data
let apiName = {
......@@ -71,7 +75,16 @@ Page({
merchantId: customerInfo.merchantId,
merchantName: customerInfo.merchantName
}
let validObj = wx.$util.checkRule(formData, constantData.formRule)
if (validObj) {
wx.$api.showToast(validObj.message)
return
}
if (addOrEdit == 'edit') {
if (target.technicianName == formData.technicianName) {
this.editClear()
return true
}
params.id = target.id
}
wx.$api.showLoading('加载中...')
......
......@@ -45,7 +45,7 @@
<input type="text" placeholder="{{item.placeholder || '请输入' + item.label}}" maxlength="{{item.maxlength}}" class="input" value="{{formData[item.props]}}" type="{{item.inputType || 'text'}}" password="{{item.password}}" placeholder-class="input-placeholder" data-attr="{{item.props}}" bindinput="handleInput" />
</view>
<view class="dialog-btn">
<view class="cancel-btn" bindtap="handleDialogShow">取消</view>
<view class="cancel-btn" bindtap="handleCancel">取消</view>
<view class="default-btn" bindtap="handleConfirm">确定</view>
</view>
</view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!