|
@@ -26,7 +26,7 @@ Page({
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
-
|
|
|
+ wx.hideShareMenu();
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -199,9 +199,9 @@ Page({
|
|
|
staffName: resName,
|
|
|
staffMobile: resPhone,
|
|
|
});
|
|
|
- await that.cancel();
|
|
|
+ that.cancel();
|
|
|
wx.showToast({
|
|
|
- title: '新增店员信息已提交',
|
|
|
+ title: '新增店员已提交',
|
|
|
icon: 'none',
|
|
|
duration: 1500,
|
|
|
success: function(){
|
|
@@ -210,4 +210,52 @@ Page({
|
|
|
});
|
|
|
|
|
|
},
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * 删除人员信息
|
|
|
+ */
|
|
|
+ toDelete: function(e) {
|
|
|
+ let staffId = e.currentTarget.dataset.id;
|
|
|
+ console.log(staffId);
|
|
|
+ wx.showModal({
|
|
|
+ title: '删除员工',
|
|
|
+ content: '',
|
|
|
+ showCancel: true,//是否显示取消按钮
|
|
|
+ cancelText:"取消",//默认是“取消”
|
|
|
+ cancelColor:'#00000',//取消文字的颜色
|
|
|
+ confirmText:"确定",//默认是“确定”
|
|
|
+ confirmColor: '#00000',//确定文字的颜色
|
|
|
+ success: res => {if (res.cancel) {
|
|
|
+ //点击取消,默认隐藏弹框
|
|
|
+ } else {
|
|
|
+ //点击确定
|
|
|
+ WelfareMall.delStoreStaff({
|
|
|
+ mobile: getMobileCache(),
|
|
|
+ staffId: staffId,
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ that.cancel();
|
|
|
+ wx.showToast({
|
|
|
+ title: '员工已删除',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 1500,
|
|
|
+ success: function(){
|
|
|
+ that.onShow();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ that.data.lock = false
|
|
|
+ }).catch(_ => {
|
|
|
+ console.log(_)
|
|
|
+ that.data.lock = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: function (res) {
|
|
|
+ console.log(res)
|
|
|
+ },//接口调用失败的回调函数
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
})
|