|
|
@@ -16,6 +16,9 @@ Page({
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
+ // 查询条件
|
|
|
+ searchContent: [],
|
|
|
+ checked:true, //启用标识
|
|
|
tagList: [{
|
|
|
title: mixins.$t("all") //全部
|
|
|
}, {
|
|
|
@@ -24,10 +27,10 @@ Page({
|
|
|
title: mixins.$t("serviceProvider") // 服务供应商
|
|
|
}], // 假数据
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
contentObj: {
|
|
|
- [mixins.$t("procurementSupplier")]: [{
|
|
|
+ [mixins.$t("procurementSupplier")]: [{
|
|
|
name: 'contactName',
|
|
|
title: mixins.$t("contactName") //联系人
|
|
|
}, {
|
|
|
@@ -35,17 +38,17 @@ Page({
|
|
|
title: mixins.$t("contactPhone") //联系电话
|
|
|
}, {
|
|
|
name: 'brandName',
|
|
|
- title: mixins.$t("brandId") //供货品牌
|
|
|
+ title: mixins.$t("brandId") //供货品牌
|
|
|
}],
|
|
|
[mixins.$t("serviceProvider")]: [{
|
|
|
name: 'contactName',
|
|
|
- title: mixins.$t("contactName") //联系人
|
|
|
+ title: mixins.$t("contactName") //联系人
|
|
|
}, {
|
|
|
name: 'contactPhone',
|
|
|
title: mixins.$t("contactPhone") //联系电话
|
|
|
}, {
|
|
|
name: 'serviceCategories',
|
|
|
- title: mixins.$t("serviceCategories") //服务类别
|
|
|
+ title: mixins.$t("serviceCategories") //服务类别
|
|
|
}]
|
|
|
},
|
|
|
|
|
|
@@ -56,7 +59,7 @@ Page({
|
|
|
// 路由
|
|
|
routeObjName: 'supplier',
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* @desc : 切换 全部 采购供应商 服务供应商
|
|
|
* @date : 2024/2/1 15:49
|
|
|
@@ -69,20 +72,20 @@ Page({
|
|
|
})
|
|
|
this.searchData()
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* @desc : 左滑 停用回调
|
|
|
* @date : 2024/2/1 15:49
|
|
|
* @author : 王英杰
|
|
|
*/
|
|
|
- swipe(e) {
|
|
|
+ swipe(e) {
|
|
|
let param = {
|
|
|
- supId:e.detail.item.supId
|
|
|
+ supId: e.detail.item.supId
|
|
|
}
|
|
|
api.request(Constants.BASIC_SUPLIER_API + 'deactivate_data', 'POST', param).then(res => {
|
|
|
|
|
|
if (res.data.code === 200) {
|
|
|
- this.searchData()
|
|
|
+ this.searchData()
|
|
|
}
|
|
|
})
|
|
|
|
|
|
@@ -98,10 +101,15 @@ Page({
|
|
|
params.supType = ""
|
|
|
}
|
|
|
if (active == 1) { //采购供应商
|
|
|
- params.supType = mixins.$t("procurementSupplier") //采购供应商
|
|
|
+ params.supType = mixins.$t("procurementSupplier") //采购供应商
|
|
|
}
|
|
|
if (active == 2) { //服务供应商
|
|
|
- params.supType = mixins.$t("serviceProvider") //采购供应商
|
|
|
+ params.supType = mixins.$t("serviceProvider") //采购供应商
|
|
|
+ }
|
|
|
+ if(this.data.checked){ //启用标识开启
|
|
|
+ params.flgValid = true
|
|
|
+ }else{
|
|
|
+ params.flgValid = false
|
|
|
}
|
|
|
return params
|
|
|
},
|
|
|
@@ -121,7 +129,7 @@ Page({
|
|
|
handleSearchData(data) {
|
|
|
data.forEach(element => {
|
|
|
element.collectStatus = element.flgValid ? 'enable' : "disable"
|
|
|
- element.collectName = "应付"
|
|
|
+ element.collectName = mixins.$t("meet") //应付
|
|
|
element.collectCol = "0"
|
|
|
});
|
|
|
this.setData({
|
|
|
@@ -142,25 +150,40 @@ Page({
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- /**
|
|
|
- * @desc : 详细页面 (编辑)
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 王英杰
|
|
|
- */
|
|
|
- toDetail(e) {
|
|
|
- let supId = e.detail.item.supId
|
|
|
- wx.navigateTo({
|
|
|
- url: this.data.route.add.url,
|
|
|
- events: {
|
|
|
- // 回调后,在这里给页面赋值
|
|
|
- bandData: function (e) {
|
|
|
- console.log("toDetail", e);
|
|
|
+ /**
|
|
|
+ * @desc : 详细页面 (编辑)
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 王英杰
|
|
|
+ */
|
|
|
+ toDetail(e) {
|
|
|
+ let supId = e.detail.item.supId
|
|
|
+ wx.navigateTo({
|
|
|
+ url: this.data.route.add.url,
|
|
|
+ events: {
|
|
|
+ // 回调后,在这里给页面赋值
|
|
|
+ bandData: function (e) {
|
|
|
+ console.log("toDetail", e);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ success: function (res) {
|
|
|
+ // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
|
|
|
+ res.eventChannel.emit('params', {
|
|
|
+ id: supId,
|
|
|
+ formMode: Constants.formMode.edit
|
|
|
+ })
|
|
|
}
|
|
|
- },
|
|
|
- success: function (res) {
|
|
|
- // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
|
|
|
- res.eventChannel.emit('params', { id: supId, formMode: Constants.formMode.edit })
|
|
|
- }
|
|
|
- })
|
|
|
-},
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 底部 新建按钮旁 启用回调事件
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 王英杰
|
|
|
+ */
|
|
|
+ onCheckboxChange(e) {
|
|
|
+ console.log("tt", e);
|
|
|
+ this.setData({
|
|
|
+ checked:e.detail.checked
|
|
|
+ })
|
|
|
+ this.searchData()
|
|
|
+ },
|
|
|
})
|