|
|
@@ -0,0 +1,194 @@
|
|
|
+const _Http = getApp().globalData.http;
|
|
|
+
|
|
|
+Component({
|
|
|
+ properties: {
|
|
|
+ disabled: {
|
|
|
+ type: Boolean,
|
|
|
+ value: false
|
|
|
+ },
|
|
|
+ departmentid: {
|
|
|
+ type: [String, Number]
|
|
|
+ },
|
|
|
+ sa_service_improvementid: {
|
|
|
+ type: [String, Number]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ options: {
|
|
|
+ addGlobalClass: true
|
|
|
+ },
|
|
|
+ lifetimes: {
|
|
|
+ attached: function () {
|
|
|
+ getApp().globalData.Language.getLanguagePackage(this)
|
|
|
+ this.setData({
|
|
|
+ userid: wx.getStorageSync("userMsg").userid
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ content: {
|
|
|
+ nocache: true,
|
|
|
+ pageNumber: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ pageTotal: 1,
|
|
|
+ total: null,
|
|
|
+ where: {
|
|
|
+ condition: ""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ list: [],
|
|
|
+ record: "",
|
|
|
+ "sa_service_improvement_planid": 0,
|
|
|
+ "sa_service_improvement_recordid": 0,
|
|
|
+ unfolds: []
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ changeUndold(e) {
|
|
|
+ let {
|
|
|
+ id
|
|
|
+ } = e.currentTarget.dataset,
|
|
|
+ unfolds = this.data.unfolds;
|
|
|
+ if (unfolds.includes(id)) {
|
|
|
+ unfolds = unfolds.filter(v => v != id)
|
|
|
+ } else {
|
|
|
+ unfolds.push(id)
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ unfolds
|
|
|
+ })
|
|
|
+ },
|
|
|
+ areaInput(e) {
|
|
|
+ this.setData({
|
|
|
+ record: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onRecord(e) {
|
|
|
+ let that = this;
|
|
|
+ setTimeout(() => {
|
|
|
+ let record = that.data.record;
|
|
|
+ if (record == '') return wx.showToast({
|
|
|
+ title: getApp().globalData.Language.getMapText("请填写改善记录"),
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ _Http.basic({
|
|
|
+ "content": {
|
|
|
+ "sa_service_improvementid": that.data.sa_service_improvementid,
|
|
|
+ "sa_service_improvement_planid": that.data.sa_service_improvement_planid,
|
|
|
+ "sa_service_improvement_recordid": that.data.sa_service_improvement_recordid,
|
|
|
+ record
|
|
|
+ },
|
|
|
+ "id": 2026020210270102,
|
|
|
+ }).then(res => {
|
|
|
+ getApp().globalData.Language.showToast(res.code == '1' ? "保存成功" : res.msg)
|
|
|
+ if (res.code == 1) that.getList('', true);
|
|
|
+ })
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ onCancel() {
|
|
|
+ this.setData({
|
|
|
+ sa_service_improvement_planid: 0
|
|
|
+ })
|
|
|
+ },
|
|
|
+ add(e) {
|
|
|
+ const {
|
|
|
+ item
|
|
|
+ } = e.currentTarget.dataset;
|
|
|
+ this.setData({
|
|
|
+ sa_service_improvement_planid: item.sa_service_improvement_planid,
|
|
|
+ sa_service_improvement_recordid: 0,
|
|
|
+ record: ""
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getList(id, init = false) {
|
|
|
+ console.log("getList", id)
|
|
|
+ let content = {
|
|
|
+ ...this.data.content,
|
|
|
+ sa_service_improvementid: id || this.data.sa_service_improvementid
|
|
|
+ };
|
|
|
+ if (init) {
|
|
|
+ content.pageNumber = 1
|
|
|
+ content.pageTotal = 1
|
|
|
+ }
|
|
|
+ _Http.basic({
|
|
|
+ "id": 2026020210235502,
|
|
|
+ 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_service_improvementid: content.sa_service_improvementid
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onConfime(e) {
|
|
|
+ const {
|
|
|
+ item
|
|
|
+ } = e.currentTarget.dataset;
|
|
|
+ wx.showModal({
|
|
|
+ title: getApp().globalData.Language.getMapText('提示'),
|
|
|
+ content: getApp().globalData.Language.getMapText('是否确定完成该方案'),
|
|
|
+ cancelText: getApp().globalData.Language.getMapText('取消'),
|
|
|
+ confirmText: getApp().globalData.Language.getMapText('确定'),
|
|
|
+ complete: (res) => {
|
|
|
+ if (res.confirm) _Http.basic({
|
|
|
+ "id": 2026020210240002,
|
|
|
+ "content": {
|
|
|
+ "sa_service_improvement_planid": item.sa_service_improvement_planid
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ wx.showToast({
|
|
|
+ title: res.code != '1' ? res.msg : getApp().globalData.Language.getMapText('操作成功'),
|
|
|
+ icon: "none",
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ if (res.code == '1') this.getList("", true)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ deteleItem(e) {
|
|
|
+ const {
|
|
|
+ item
|
|
|
+ } = e.currentTarget.dataset;
|
|
|
+ wx.showModal({
|
|
|
+ title: getApp().globalData.Language.getMapText('提示'),
|
|
|
+ content: getApp().globalData.Language.getMapText('是否确定删除该记录'),
|
|
|
+ cancelText: getApp().globalData.Language.getMapText('取消'),
|
|
|
+ confirmText: getApp().globalData.Language.getMapText('确定'),
|
|
|
+ complete: (res) => {
|
|
|
+ if (res.confirm) _Http.basic({
|
|
|
+ "id": 2026020210271602,
|
|
|
+ "content": {
|
|
|
+ "sa_service_improvement_recordid": item.sa_service_improvement_recordid
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ wx.showToast({
|
|
|
+ title: res.code != '1' ? res.msg : getApp().globalData.Language.getMapText('删除成功'),
|
|
|
+ icon: "none",
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ if (res.code == '1') this.getList("", true)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ editItem(e) {
|
|
|
+ const {
|
|
|
+ item
|
|
|
+ } = e.currentTarget.dataset;
|
|
|
+ this.setData({
|
|
|
+ "sa_service_improvement_planid": item.sa_service_improvement_planid,
|
|
|
+ "sa_service_improvement_recordid": item.sa_service_improvement_recordid,
|
|
|
+ record: item.record
|
|
|
+ })
|
|
|
+ console.log(item)
|
|
|
+ }
|
|
|
+ }
|
|
|
+})
|