| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- const _Http = getApp().globalData.http;
- Component({
- properties: {
- list: {
- type: Array
- },
- disabled: {
- type: Boolean
- }
- },
- data: {
- viewIndex: null
- },
- options: {
- addGlobalClass: true
- },
- lifetimes: {
- attached: function () {
- getApp().globalData.Language.getLanguagePackage(this)
- }
- },
- methods: {
- selectClient(e) {
- if (!this.data.disabled) return;
- const {
- item
- } = e.currentTarget.dataset,
- pages = getCurrentPages(),
- page = pages[pages.length - 1];
- this.setData({
- taskname: item.taskname,
- content: {
- sa_projectid: page.data.detail.sa_projectid,
- sa_projtaskmagid: item.sa_projtaskmagid,
- sa_projstagemagid: item.sa_projstagemagid,
- }
- })
- if (item.partiestype.length != 0) {
- wx.navigateTo({
- url: '/packageA/select/setclient/select?params=' + JSON.stringify({
- "id": 20221129152204,
- content: {
- nocache: true,
- sa_projectid: page.data.detail.sa_projectid,
- sa_projtaskmagid: item.sa_projtaskmagid,
- where: {
- condition: "",
- }
- },
- }) + '&idname=sa_project_partiesid'
- });
- getApp().globalData.handleSelect = this.handleAdd.bind(this);
- } else {
- this.handleAdd({
- result: []
- });
- }
- },
- handleAdd(e) {
- let content = this.data.content;
- content.sa_project_partiesids = e.result;
- if (e.result.length) {
- wx.redirectTo({
- url: '/packageA/project/modules/task/add?content=' + JSON.stringify(content) + '&taskname=' + this.data.taskname,
- })
- } else {
- wx.navigateTo({
- url: '/packageA/project/modules/task/add?content=' + JSON.stringify(content) + '&taskname=' + this.data.taskname,
- })
- }
- },
- viewHistory(e) {
- const {
- sa_projectid,
- sa_projtaskmagid,
- sa_projstagemagid
- } = e.currentTarget.dataset.item,
- content = {
- nocheca: true,
- sa_projectid,
- sa_projtaskmagid,
- sa_projstagemagid,
- pageNumber: 1,
- pageTotal: 1,
- pageSize: 20
- };
- if (!content.sa_projectid) {
- let page = getCurrentPages().find(v => v.__route__ == 'packageA/project/detail');
- content.sa_projectid = page.data.detail.sa_projectid;
- }
- wx.navigateTo({
- url: '/packageA/project/modules/task/history?content=' + JSON.stringify(content),
- })
- }
- }
- })
|