|
|
@@ -1,137 +1,129 @@
|
|
|
const _Http = getApp().globalData.http;
|
|
|
|
|
|
Component({
|
|
|
- properties: {
|
|
|
- disabled: {
|
|
|
- type: Boolean,
|
|
|
- value: true
|
|
|
- }
|
|
|
+ properties: {
|
|
|
+ disabled: {
|
|
|
+ type: Boolean,
|
|
|
+ value: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ options: {
|
|
|
+ addGlobalClass: true
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ sa_customersid: 0,
|
|
|
+ content: {
|
|
|
+ nocache: true,
|
|
|
+ pageNumber: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ pageTotal: 1,
|
|
|
+ total: null,
|
|
|
+ where: {
|
|
|
+ condition: ""
|
|
|
+ }
|
|
|
},
|
|
|
- options: {
|
|
|
- addGlobalClass: true
|
|
|
+ list: [],
|
|
|
+ showSearch: false,
|
|
|
+ focus: false,
|
|
|
+ condition: ""
|
|
|
+ },
|
|
|
+ lifetimes: {
|
|
|
+ attached: function () {
|
|
|
+ getApp().globalData.Language.getLanguagePackage(this)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getList(id, init = false) {
|
|
|
+ let content = {
|
|
|
+ ...this.data.content,
|
|
|
+ sa_customersid: id || this.data.sa_customersid
|
|
|
+ };
|
|
|
+ if (init) {
|
|
|
+ content.pageNumber = 1
|
|
|
+ content.pageTotal = 1
|
|
|
+ }
|
|
|
+ _Http.basic({
|
|
|
+ "id": 2025111315443902,
|
|
|
+ content
|
|
|
+ }).then(res => {
|
|
|
+ console.log("预估手术量", res)
|
|
|
+ if (res.code != '1') return wx.showToast({
|
|
|
+ title: res.data,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+
|
|
|
+ this.setData({
|
|
|
+ "content.pageNumber": res.pageNumber + 1,
|
|
|
+ "content.pageTotal": res.pageTotal,
|
|
|
+ "content.total": res.total,
|
|
|
+ list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
|
|
|
+ sa_customersid: content.sa_customersid
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
- data: {
|
|
|
- sa_customersid: 0,
|
|
|
- content: {
|
|
|
- nocache: true,
|
|
|
- pageNumber: 1,
|
|
|
- pageSize: 10,
|
|
|
- pageTotal: 1,
|
|
|
- total: null,
|
|
|
- where: {
|
|
|
- condition: ""
|
|
|
- }
|
|
|
- },
|
|
|
- list: [],
|
|
|
- showSearch: false,
|
|
|
- focus: false,
|
|
|
- condition: ""
|
|
|
+
|
|
|
+ toSearch() {
|
|
|
+ if (this.data.showSearch && this.data.content.where.condition) {
|
|
|
+ this.data.content.where.condition = '';
|
|
|
+ this.getList("", true);
|
|
|
+ } else if (this.data.condition) {
|
|
|
+ this.data.content.where.condition = this.data.condition;
|
|
|
+ this.setData({
|
|
|
+ condition: this.data.condition
|
|
|
+ })
|
|
|
+ this.getList("", true);
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ showSearch: !this.data.showSearch
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ this.setData({
|
|
|
+ focus: this.data.showSearch
|
|
|
+ })
|
|
|
+ }, 300)
|
|
|
},
|
|
|
- lifetimes: {
|
|
|
- attached: function () {
|
|
|
- getApp().globalData.Language.getLanguagePackage(this)
|
|
|
- }
|
|
|
+ onChange({
|
|
|
+ detail
|
|
|
+ }) {
|
|
|
+ this.data.condition = detail;
|
|
|
+ },
|
|
|
+ onSearch({
|
|
|
+ detail
|
|
|
+ }) {
|
|
|
+ this.data.content.where.condition = detail;
|
|
|
+ this.getList("", true)
|
|
|
},
|
|
|
- methods: {
|
|
|
- getList(id, init = false) {
|
|
|
- let content = {
|
|
|
- ...this.data.content,
|
|
|
- sa_customersid: id || this.data.sa_customersid
|
|
|
- };
|
|
|
- if (init) {
|
|
|
- content.pageNumber = 1
|
|
|
- content.pageTotal = 1
|
|
|
- }
|
|
|
- _Http.basic({
|
|
|
- "id": 2025102310134602,
|
|
|
- content
|
|
|
- }).then(res => {
|
|
|
- console.log("医生", res)
|
|
|
- if (res.code != '1') return wx.showToast({
|
|
|
- title: res.data,
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- res.data = res.data.map(v => {
|
|
|
- // 是否关键
|
|
|
- v.isKeyDoctor = v.tag_sys.includes("关键人");
|
|
|
- return v
|
|
|
- })
|
|
|
- this.setData({
|
|
|
- "content.pageNumber": res.pageNumber + 1,
|
|
|
- "content.pageTotal": res.pageTotal,
|
|
|
- "content.total": res.total,
|
|
|
- list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
|
|
|
- sa_customersid: content.sa_customersid
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- insetr() {
|
|
|
- const page = getCurrentPages().find(v => v.__route__ == 'prsx/hospital/detail'),
|
|
|
- detail = page.data.detail;
|
|
|
- wx.navigateTo({
|
|
|
- url: `/prsx/doctors/insert?sa_customersid=${detail.sa_customersid}&name=${detail.name}`
|
|
|
- })
|
|
|
- },
|
|
|
- toSearch() {
|
|
|
- if (this.data.showSearch && this.data.content.where.condition) {
|
|
|
- this.data.content.where.condition = '';
|
|
|
- this.getList("", true);
|
|
|
- } else if (this.data.condition) {
|
|
|
- this.data.content.where.condition = this.data.condition;
|
|
|
- this.setData({
|
|
|
- condition: this.data.condition
|
|
|
- })
|
|
|
- this.getList("", true);
|
|
|
- }
|
|
|
- this.setData({
|
|
|
- showSearch: !this.data.showSearch
|
|
|
- })
|
|
|
- setTimeout(() => {
|
|
|
- this.setData({
|
|
|
- focus: this.data.showSearch
|
|
|
- })
|
|
|
- }, 300)
|
|
|
- },
|
|
|
- onChange({
|
|
|
- detail
|
|
|
- }) {
|
|
|
- this.data.condition = detail;
|
|
|
- },
|
|
|
- onSearch({
|
|
|
- detail
|
|
|
- }) {
|
|
|
- this.data.content.where.condition = detail;
|
|
|
- this.getList("", true)
|
|
|
- },
|
|
|
- setKeyDoctor(e) {
|
|
|
- const { item } = e.currentTarget.dataset;
|
|
|
- let datatag = item.tag_sys;
|
|
|
- if (item.isKeyDoctor) {
|
|
|
- datatag = datatag.filter(v => v != "关键人");
|
|
|
- } else {
|
|
|
- datatag.push("关键人");
|
|
|
- }
|
|
|
- _Http.basic({
|
|
|
- "id": 2025110113493702,
|
|
|
- "content": {
|
|
|
- "ownertable": "sa_doctor",
|
|
|
- "ownerid": item.sa_doctorid,
|
|
|
- datatag
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- console.log("设置关键人", res)
|
|
|
- wx.showToast({
|
|
|
- title: res.code == 1 ? '设置成功' : res.data,
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- if (res.code != '1') return
|
|
|
- const item1 = this.data.list.find(v => v.sa_doctorid == item.sa_doctorid)
|
|
|
- item1.tag_sys = datatag;
|
|
|
- item1.isKeyDoctor = !item1.isKeyDoctor;
|
|
|
- this.setData({
|
|
|
- list: this.data.list
|
|
|
- })
|
|
|
- })
|
|
|
+ setKeyDoctor(e) {
|
|
|
+ const {
|
|
|
+ item
|
|
|
+ } = e.currentTarget.dataset;
|
|
|
+ let datatag = item.tag_sys;
|
|
|
+ if (item.isKeyDoctor) {
|
|
|
+ datatag = datatag.filter(v => v != "关键人");
|
|
|
+ } else {
|
|
|
+ datatag.push("关键人");
|
|
|
+ }
|
|
|
+ _Http.basic({
|
|
|
+ "id": 2025110113493702,
|
|
|
+ "content": {
|
|
|
+ "ownertable": "sa_doctor",
|
|
|
+ "ownerid": item.sa_doctorid,
|
|
|
+ datatag
|
|
|
}
|
|
|
+ }).then(res => {
|
|
|
+ console.log("设置关键人", res)
|
|
|
+ wx.showToast({
|
|
|
+ title: res.code == 1 ? '设置成功' : res.data,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ if (res.code != '1') return
|
|
|
+ const item1 = this.data.list.find(v => v.sa_doctorid == item.sa_doctorid)
|
|
|
+ item1.tag_sys = datatag;
|
|
|
+ item1.isKeyDoctor = !item1.isKeyDoctor;
|
|
|
+ this.setData({
|
|
|
+ list: this.data.list
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
+ }
|
|
|
})
|