|
|
@@ -25,14 +25,62 @@ Component({
|
|
|
list: [],
|
|
|
showSearch: false,
|
|
|
focus: false,
|
|
|
- condition: ""
|
|
|
- },
|
|
|
- lifetimes: {
|
|
|
- attached: function () {
|
|
|
- getApp().globalData.Language.getLanguagePackage(this)
|
|
|
- }
|
|
|
+ condition: "",
|
|
|
+ stages: [],
|
|
|
+ showAction: false
|
|
|
},
|
|
|
methods: {
|
|
|
+ changeStage(e) {
|
|
|
+ const {
|
|
|
+ item
|
|
|
+ } = e.currentTarget.dataset,
|
|
|
+ that = this;
|
|
|
+ this.setData({
|
|
|
+ stages: this.data.stages.map(v => {
|
|
|
+ v.color = v.stagename == item.stagename ? '#3874F6' : ''
|
|
|
+ return v
|
|
|
+ }),
|
|
|
+ showAction: true,
|
|
|
+ changeItem: item
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onSelect({
|
|
|
+ detail
|
|
|
+ }) {
|
|
|
+ let item = this.data.changeItem,
|
|
|
+ that = this;
|
|
|
+ if (detail.color) return that.onCancel()
|
|
|
+
|
|
|
+ wx.showModal({
|
|
|
+ content: `是否确定将阶段修改为“${detail.stagename}”?`,
|
|
|
+ complete: ({
|
|
|
+ confirm
|
|
|
+ }) => {
|
|
|
+ if (confirm) _Http.basic({
|
|
|
+ "id": "2025102110224102",
|
|
|
+ "content": {
|
|
|
+ sa_hospitaldep_itemid: item.sa_hospitaldep_itemid,
|
|
|
+ sa_devstageid: detail.sa_devstageid
|
|
|
+ },
|
|
|
+ }).then(res => {
|
|
|
+ wx.showToast({
|
|
|
+ title: res.code == 1 ? '修改成功' : res.msg,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ if (res.code == 1) {
|
|
|
+ that.getList('', true)
|
|
|
+ that.onCancel()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onCancel() {
|
|
|
+ this.setData({
|
|
|
+ showAction: false,
|
|
|
+ changeItem: null
|
|
|
+ })
|
|
|
+ },
|
|
|
getList(id, init = false) {
|
|
|
let content = {
|
|
|
...this.data.content,
|
|
|
@@ -42,6 +90,25 @@ Component({
|
|
|
content.pageNumber = 1
|
|
|
content.pageTotal = 1
|
|
|
}
|
|
|
+ if (this.data.stages.length == 0) _Http.basic({
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 999,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "id": 2025100916245502,
|
|
|
+ }).then(res => {
|
|
|
+ console.log("获取阶段列表", res)
|
|
|
+ if (res.code != 1) return;
|
|
|
+ this.setData({
|
|
|
+ stages: res.data.map(v => {
|
|
|
+ v.name = v.stagename
|
|
|
+ return v
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
_Http.basic({
|
|
|
"id": 2025102110205102,
|
|
|
content
|
|
|
@@ -51,7 +118,10 @@ Component({
|
|
|
title: res.data,
|
|
|
icon: "none"
|
|
|
});
|
|
|
- let list = res.data
|
|
|
+ let list = res.data.map(v => {
|
|
|
+ v.cover = v.attinfos.length ? _Http.getSpecifiedImage(v.attinfos[0]) : ''
|
|
|
+ return v
|
|
|
+ })
|
|
|
this.setData({
|
|
|
"content.pageNumber": res.pageNumber + 1,
|
|
|
"content.pageTotal": res.pageTotal,
|
|
|
@@ -74,6 +144,61 @@ Component({
|
|
|
wx.navigateTo({
|
|
|
url: `/prsx/select/product/index?params=${JSON.stringify(params)}&radio=true`
|
|
|
})
|
|
|
+ let that = this;
|
|
|
+ _Http.handleSelect = ({
|
|
|
+ item
|
|
|
+ }) => {
|
|
|
+ wx.showModal({
|
|
|
+ content: `是否确定添加“${item.itemname}”到推荐产品?`,
|
|
|
+ complete: ({
|
|
|
+ confirm
|
|
|
+ }) => {
|
|
|
+ if (confirm) _Http.basic({
|
|
|
+ "id": "2025102110170902",
|
|
|
+ "content": {
|
|
|
+ "sa_hospitaldepid": that.data.sa_hospitaldepid,
|
|
|
+ "itemids": [item.itemid]
|
|
|
+ },
|
|
|
+ }).then(res => {
|
|
|
+ wx.showToast({
|
|
|
+ title: res.code == 1 ? '添加成功' : res.msg,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ if (res.code == 1) {
|
|
|
+ that.getList('', true)
|
|
|
+ getCurrentPages().find(v => v.__route__ == 'prsx/select/product/index').uploadList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deleteItem(e) {
|
|
|
+ const {
|
|
|
+ item
|
|
|
+ } = e.currentTarget.dataset,
|
|
|
+ that = this;
|
|
|
+ wx.showModal({
|
|
|
+ content: `是否确定删除“${item.itemname}”?`,
|
|
|
+ complete: ({
|
|
|
+ confirm
|
|
|
+ }) => {
|
|
|
+ if (confirm) _Http.basic({
|
|
|
+ "id": "2025102110202602",
|
|
|
+ "content": {
|
|
|
+ sa_hospitaldep_itemid: item.sa_hospitaldep_itemid
|
|
|
+ },
|
|
|
+ }).then(res => {
|
|
|
+ wx.showToast({
|
|
|
+ title: res.code == 1 ? '删除成功' : res.msg,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ if (res.code == 1) {
|
|
|
+ that.getList('', true)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
toSearch() {
|
|
|
if (this.data.showSearch && this.data.content.where.condition) {
|