|
|
@@ -0,0 +1,151 @@
|
|
|
+const _Http = getApp().globalData.http;
|
|
|
+
|
|
|
+Component({
|
|
|
+ properties: {
|
|
|
+ disabled: {
|
|
|
+ type: Boolean,
|
|
|
+ value: false
|
|
|
+ },
|
|
|
+ billData: {
|
|
|
+ type: Object
|
|
|
+ }
|
|
|
+ },
|
|
|
+ options: {
|
|
|
+ addGlobalClass: true
|
|
|
+ },
|
|
|
+ lifetimes: {
|
|
|
+ attached: function () {
|
|
|
+ getApp().globalData.Language.getLanguagePackage(this)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ sa_workorderid: 0,
|
|
|
+ content: {
|
|
|
+ nocache: true,
|
|
|
+ pageNumber: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ pageTotal: 1,
|
|
|
+ total: null,
|
|
|
+ where: {
|
|
|
+ condition: ""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ list: [],
|
|
|
+ showSearch: false,
|
|
|
+ focus: false,
|
|
|
+ condition: ""
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getList(id, init = false) {
|
|
|
+ console.log("getList", id)
|
|
|
+ let content = {
|
|
|
+ ...this.data.content,
|
|
|
+ sa_workorderid: id || this.data.sa_workorderid
|
|
|
+ };
|
|
|
+ if (init) {
|
|
|
+ content.pageNumber = 1
|
|
|
+ content.pageTotal = 1
|
|
|
+ }
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20230211105903,
|
|
|
+ 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_workorderid: content.sa_workorderid
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async addConfirmBill() {
|
|
|
+ const res = await _Http.basic({
|
|
|
+ "id": "20230211105703",
|
|
|
+ "version": 1,
|
|
|
+ "content": {
|
|
|
+ "sa_workorder_confirmationid": 0,
|
|
|
+ "sa_workorderid": this.data.sa_workorderid,
|
|
|
+ "attitudescore": 0,
|
|
|
+ "responsescore": 0,
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ if (this.data.billData.actiontype === "非工序模板") {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/Eservice/materielConfirmBill/index?id=' + res.data.sa_workorder_confirmationid,
|
|
|
+ })
|
|
|
+ } else if (this.data.billData.type === '安装培训') {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/Eservice/trainConfirmBill/index?id=' + res.data.sa_workorder_confirmationid,
|
|
|
+ })
|
|
|
+ } else if (this.data.billData.type === '安装调试') {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/Eservice/installConfirmBill/index?id=' + res.data.sa_workorder_confirmationid,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/Eservice/serviceConfirmBill/index?id=' + res.data.sa_workorder_confirmationid,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ _Http.updateList = this.getList.bind(this)
|
|
|
+ },
|
|
|
+ toConfirmBill(data) {
|
|
|
+ let class1 = this.data.billData.status != '进行中' ? '&class=stopClick' : ''
|
|
|
+ if (this.data.billData.actiontype === "非工序模板") {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/Eservice/materielConfirmBill/index?id=' + data.currentTarget.dataset.item.sa_workorder_confirmationid + '&class=' + class1,
|
|
|
+ })
|
|
|
+ } else if (this.data.billData.type === '安装培训') {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/Eservice/trainConfirmBill/index?id=' + data.currentTarget.dataset.item.sa_workorder_confirmationid + '&class=' + class1,
|
|
|
+ })
|
|
|
+ } else if (this.data.billData.type === '安装调试') {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/Eservice/installConfirmBill/index?id=' + data.currentTarget.dataset.item.sa_workorder_confirmationid + '&class=' + class1,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/Eservice/serviceConfirmBill/index?id=' + data.currentTarget.dataset.item.sa_workorder_confirmationid + '&class=' + class1,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ _Http.updateList = this.getList.bind(this)
|
|
|
+ },
|
|
|
+ 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)
|
|
|
+ },
|
|
|
+ }
|
|
|
+})
|