xiaohaizhao 2 hónapja
szülő
commit
cb5233fb85

+ 68 - 52
E-service/serviceBillList/detail.js

@@ -57,7 +57,7 @@ Page({
       "content": {
         "sa_serviceorderid": this.data.sa_serviceorderid
       },
-    }).then(res => {
+    }).then(async res => {
       console.log("申请单详情", res)
       if (res.code != '1') return wx.showToast({
         title: res.msg,
@@ -82,62 +82,78 @@ Page({
       this.setTabbar()
       this.partialRenewal();
       const appAuth = wx.getStorageSync('auth').applyBill;
-      if (appAuth.options.some(v => v == 'workOrders')) this.getWorkDetail(res.data.sa_workorderid)
+      if (appAuth.options.some(v => v == 'workOrders')) await this.getWorkDetail(res.data.sa_workorderid)
+
+      this.setData({
+        tabsList: this.data.tabsList.concat([{
+          label: "附件",
+          color: "#ED4949",
+          model: "#Files"
+        }, {
+          label: "操作记录",
+          color: "#ED4949",
+          model: "#Record"
+        }])
+      })
     })
   },
   getWorkDetail(id) {
-    _Http.basic({
-      "id": 20230208140103,
-      "content": {
-        "sa_workorderid": id
-      },
-    }).then(res => {
-      console.log("工单详情", res)
-      if (res.code != '1') return wx.showToast({
-        title: res.msg,
-        icon: "none"
-      })
-      let tabsList = [{
-        label: "工单服务商品",
-        model: "#WorkOrderProduct",
-        idname: "sa_workorderid",
-        color: "#2AA520"
-      }, {
-        label: "工序详情",
-        model: "#WorkOrderNodes",
-        idname: "sa_workorderid",
-        color: "#2AA520"
-      }, {
-        label: "工单物料",
-        model: "#WorkOrderMaterial",
-        idname: "sa_workorderid",
-        color: "#2AA520"
-      }, {
-        label: "服务确认单",
-        model: "#WorkOrderNotarizeBill",
-        idname: "sa_workorderid",
-        color: "#2AA520"
-      }, {
-        label: "服务团队",
-        idname: "sa_workorderid",
-        color: "#2AA520"
-      }, {
-        label: "工单信息",
-        idname: "sa_workorderid",
-        color: "#2AA520"
-      }];
-      if (res.data.actiontype == '非工序模板') {
-        tabsList = tabsList.filter(v => ['工单服务商品', '服务确认单', '服务团队', '工单信息'].includes(v.label))
+    return new Promise((resolve) => {
+      _Http.basic({
+        "id": 20230208140103,
+        "content": {
+          "sa_workorderid": id
+        },
+      }).then(res => {
+        console.log("工单详情", res)
+        resolve()
+        if (res.code != '1') return wx.showToast({
+          title: res.msg,
+          icon: "none"
+        })
+        let tabsList = [{
+          label: "工单服务商品",
+          model: "#WorkOrderProduct",
+          idname: "sa_workorderid",
+          color: "#2AA520"
+        }, {
+          label: "工序详情",
+          model: "#WorkOrderNodes",
+          idname: "sa_workorderid",
+          color: "#2AA520"
+        }, {
+          label: "工单物料",
+          model: "#WorkOrderMaterial",
+          idname: "sa_workorderid",
+          color: "#2AA520"
+        }, {
+          label: "服务确认单",
+          model: "#WorkOrderNotarizeBill",
+          idname: "sa_workorderid",
+          color: "#2AA520"
+        }, {
+          label: "服务团队",
+          idname: "sa_workorderid",
+          color: "#2AA520"
+        }, {
+          label: "工单信息",
+          idname: "sa_workorderid",
+          color: "#2AA520"
+        }];
+        if (res.data.actiontype == '非工序模板') {
+          tabsList = tabsList.filter(v => ['工单服务商品', '服务确认单', '服务团队', '工单信息'].includes(v.label))
 
-      } else {
-        tabsList = tabsList.filter(v => ['工序详情', '工单物料', '服务确认单', '服务团队', '工单信息'].includes(v.label))
-      }
-      this.setData({
-        tabsList: this.data.tabsList.concat(tabsList),
-        workDetail: res.data
+        } else {
+          tabsList = tabsList.filter(v => ['工序详情', '工单物料', '服务确认单', '服务团队', '工单信息'].includes(v.label))
+        }
+        this.setData({
+          tabsList: this.data.tabsList.concat(tabsList),
+          workDetail: res.data
+        })
+        this.selectComponent("#WorkOrderPview").setPreview(res);
       })
-      this.selectComponent("#WorkOrderPview").setPreview(res);
     })
+
   },
   onCancel() {
     this.setData({
@@ -334,7 +350,7 @@ Page({
             pageNumber,
             pageTotal
           } = Component.data.content,
-          id = this.data.detail[ac.idname || ''];
+          id = this.data.detail[ac.idname || 'sa_serviceorderid'];
         if (total == null || init) {
           Component.getList(id, init);
         } else if (pageNumber <= pageTotal) {

+ 3 - 1
E-service/serviceBillList/detail.json

@@ -8,6 +8,8 @@
     "WorkOrderNodes": "/E-service/workOrder/nodes/index",
     "WorkOrderTeam": "/E-service/workOrder/team/index",
     "WorkOrderPview": "/E-service/workOrder/Pview/index",
-    "WorkOrderNotarizeBill": "/E-service/workOrder/notarizeBill/index"
+    "WorkOrderNotarizeBill": "/E-service/workOrder/notarizeBill/index",
+    "Files": "/components/files/index",
+    "Record": "/components/record/index"
   }
 }

+ 3 - 0
E-service/serviceBillList/detail.wxml

@@ -70,6 +70,9 @@
 	<WorkOrderProduct slot='工单服务商品' id='WorkOrderProduct' disabled="{{detail.status != '进行中'}}" />
 	<WorkOrderMaterial slot='工单物料' id='WorkOrderMaterial' />
 	<WorkOrderNotarizeBill slot='服务确认单' billData='{{workDetail}}' id='WorkOrderNotarizeBill' disabled="{{true}}" />
+
+	<Record slot='操作记录' id="Record" ownertable='sa_serviceorder' ownerid='{{detail.sa_serviceorderid}}' />
+	<Files slot='附件' id="Files" ownertable='sa_serviceorder' ownerid='{{detail.sa_serviceorderid}}' />
 	<view style="height: 180rpx;" />
 </Yl_FunTabs>
 

+ 130 - 10
E-service/serviceImprovement/detail.js

@@ -15,21 +15,27 @@ Page({
     },
     tabsList: [{
       label: "真因分析",
-      model: "#Analysis"
+      model: "#Analysis",
+      color: "#EA820A"
     }, {
       label: "改善方案",
-      model: "#Scheme"
+      model: "#Scheme",
+      color: "#EA820A"
     }, {
       label: "方案执行",
-      model: "#Execute"
+      model: "#Execute",
+      color: "#EA820A"
     }, {
       label: "影响产品范围",
-      model: "#Product"
+      model: "#Product",
+      color: "#EA820A"
     }, {
-      label: "改善单信息"
+      label: "改善单信息",
+      color: "#EA820A"
     }, {
       label: "关联改善单",
-      model: "#Improvement"
+      model: "#Improvement",
+      color: "#EA820A"
     }],
     user_analysis: false,
     user_charge: false,
@@ -41,7 +47,7 @@ Page({
     this.getDetail()
     getApp().globalData.Language.getLanguagePackage(this, '改善单详情');
     let auth = wx.getStorageSync('auth').wServiceImprovement;
-    console.log("auth",auth)
+    console.log("auth", auth)
     this.setData({
       isProduct: auth.options.includes("product")
     })
@@ -52,7 +58,7 @@ Page({
       "content": {
         "sa_service_improvementid": this.data.sa_service_improvementid
       },
-    }).then(res => {
+    }).then(async res => {
       console.log("改善单详情", res)
       if (res.code != '1') return wx.showToast({
         title: res.msg,
@@ -64,6 +70,119 @@ Page({
       this.setTabbar()
       this.setPreview(res)
       this.partialRenewal();
+      const appAuth = wx.getStorageSync('auth').wServiceImprovement;
+      if (appAuth.options.some(v => v == 'applicationForm')) await this.getServiceDetail(res.data.sa_serviceorderid)
+      if (appAuth.options.some(v => v == 'workOrders')) await this.getWorkDetail(res.data.sa_workorderid)
+      this.setData({
+        tabsList: this.data.tabsList.concat([{
+          label: "附件",
+          color: "#ED4949",
+          model: "#Files"
+        }, {
+          label: "操作记录",
+          color: "#ED4949",
+          model: "#Record"
+        }])
+      })
+
+    })
+  },
+  getServiceDetail(id) {
+    return new Promise((resolve) => {
+      _Http.basic({
+        "id": 20230206091603,
+        "content": {
+          "sa_serviceorderid": id
+        },
+      }).then(res => {
+        console.log("申请单详情", res)
+        resolve()
+        if (res.code != '1') return wx.showToast({
+          title: res.msg,
+          icon: "none"
+        })
+        let tabsList = [{
+          label: "申请信息",
+          idname: "sa_serviceorderid",
+          color: "#3874F6"
+        }, {
+          label: "受理信息",
+          idname: "sa_serviceorderid",
+          color: "#3874F6"
+        }];
+        if (['售中', "售后"].includes(res.data.servicetype)) {
+          tabsList.unshift({
+            label: "服务商品",
+            model: "#ServiceProduct",
+            idname: "sa_serviceorderid",
+            color: "#3874F6"
+          })
+        }
+        this.setData({
+          tabsList: this.data.tabsList.concat(tabsList),
+          serviceDetail: res.data
+        })
+        this.selectComponent("#ServicePview1").setPreview(res);
+        this.selectComponent("#ServicePview2").setPreview(res);
+      })
+    })
+
+  },
+  getWorkDetail(id) {
+    return new Promise((resolve) => {
+      _Http.basic({
+        "id": 20230208140103,
+        "content": {
+          "sa_workorderid": id
+        },
+      }).then(res => {
+        console.log("工单详情", res)
+        resolve()
+        if (res.code != '1') return wx.showToast({
+          title: res.msg,
+          icon: "none"
+        })
+        let tabsList = [{
+          label: "工单服务商品",
+          model: "#WorkOrderProduct",
+          idname: "sa_workorderid",
+          color: "#2AA520"
+        }, {
+          label: "工序详情",
+          model: "#WorkOrderNodes",
+          idname: "sa_workorderid",
+          color: "#2AA520"
+        }, {
+          label: "工单物料",
+          model: "#WorkOrderMaterial",
+          idname: "sa_workorderid",
+          color: "#2AA520"
+        }, {
+          label: "服务确认单",
+          model: "#WorkOrderNotarizeBill",
+          idname: "sa_workorderid",
+          color: "#2AA520"
+        }, {
+          label: "服务团队",
+          idname: "sa_workorderid",
+          color: "#2AA520"
+        }, {
+          label: "工单信息",
+          idname: "sa_workorderid",
+          color: "#2AA520"
+        }];
+        if (res.data.actiontype == '非工序模板') {
+          tabsList = tabsList.filter(v => ['工单服务商品', '服务确认单', '服务团队', '工单信息'].includes(v.label))
+
+        } else {
+          tabsList = tabsList.filter(v => ['工序详情', '工单物料', '服务确认单', '服务团队', '工单信息'].includes(v.label))
+        }
+        this.setData({
+          tabsList: this.data.tabsList.concat(tabsList),
+          workDetail: res.data
+        })
+        this.selectComponent("#WorkOrderPview").setPreview(res);
+      })
     })
   },
   setPreview(res) {
@@ -366,7 +485,8 @@ Page({
   //局部数据更新 tabs
   partialRenewal(init = false) {
     try {
-      let model = this.data.tabsList[this.data.tabsActive].model;
+      let ac = this.data.tabsList[this.data.tabsActive];
+      let model = ac.model;
       if (model) {
         let Component = this.selectComponent(model),
           {
@@ -374,7 +494,7 @@ Page({
             pageNumber,
             pageTotal
           } = Component.data.content,
-          id = this.data.detail.sa_service_improvementid;
+          id = this.data.detail[ac.idname || 'sa_service_improvementid'];
         if (total == null || init) {
           Component.getList(id, init);
         } else if (pageNumber <= pageTotal) {

+ 12 - 1
E-service/serviceImprovement/detail.json

@@ -5,6 +5,17 @@
     "Product": "./product/index",
     "Scheme": "./scheme/index",
     "Execute": "./execute/index",
-    "Analysis": "./analysis/index"
+    "Analysis": "./analysis/index",
+    "ServiceProduct": "/E-service/serviceBillList/product/index",
+    "ServicePview1": "/E-service/serviceBillList/Pview1/index",
+    "ServicePview2": "/E-service/serviceBillList/Pview2/index",
+    "WorkOrderProduct": "/E-service/workOrder/product/index",
+    "WorkOrderMaterial": "/E-service/workOrder/material/index",
+    "WorkOrderNodes": "/E-service/workOrder/nodes/index",
+    "WorkOrderTeam": "/E-service/workOrder/team/index",
+    "WorkOrderPview": "/E-service/workOrder/Pview/index",
+    "WorkOrderNotarizeBill": "/E-service/workOrder/notarizeBill/index",
+    "Files": "/components/files/index",
+    "Record": "/components/record/index"
   }
 }

+ 21 - 1
E-service/serviceImprovement/detail.wxml

@@ -46,13 +46,33 @@
 <view style="height: 20rpx;" />
 <Yl_FunTabs list='{{tabsList}}' showIcon='{{false}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
 	<Analysis detail='{{detail}}' id="Analysis" slot='真因分析' disabled="{{!(user_analysis && detail.status == '新建')}}" />
-
 	<Scheme id="Scheme" slot='改善方案' disabled="{{!(user_charge && detail.status == '分析已提交')}}" departmentid='{{detail.departmentid}}' sa_service_improvementid="{{detail.sa_service_improvementid}}" />
 	<Execute id="Execute" slot='方案执行' disabled="{{detail.status != '方案已发布'}}" departmentid='{{detail.departmentid}}' sa_service_improvementid="{{detail.sa_service_improvementid}}" />
 	<Preview slot='改善单信息' list1='{{list1}}' list2='{{list2}}' />
 	<Improvement id="Improvement" slot='关联改善单' />
 	<Product id="Product" slot='影响产品范围' disabled="{{!isProduct || detail.status == '已完成' || detail.status == '已中止'}}" />
 	<view style="height: 180rpx;" />
+
+	<!-- 服务申请单 -->
+	<ServiceProduct slot='服务商品' id="ServiceProduct" sa_orderid='{{detail.sa_orderid}}' disabled='{{true}}' />
+	<ServicePview1 id='ServicePview1' slot='申请信息' />
+	<ServicePview2 id='ServicePview2' slot='受理信息' />
+
+	<!-- 工单 -->
+	<WorkOrderPview id='WorkOrderPview' slot='工单信息' tabColorS='{{tabColorS}}' />
+	<view slot='工序详情' wx:if="{{workDetail.nodes.length == 0}}" style="padding: 20rpx; background-color: #fff;">
+		<WorkOrderNodes id='WorkOrderNodes' wx:if="{{workDetail.nodes}}" nodes='{{workDetail.nodes}}' sa_workorderid='{{workDetail.sa_workorderid}}' status="已完结" />
+	</view>
+	<Yl_Empty wx:else slot='工序详情' />
+
+	<WorkOrderTeam slot='服务团队' list='{{workDetail.team}}' projectleader='{{workDetail.projectleader}}' sa_workorderid='{{workDetail.sa_workorderid}}' disabled="{{true}}" />
+	<WorkOrderProduct slot='工单服务商品' id='WorkOrderProduct' disabled="{{detail.status != '进行中'}}" />
+	<WorkOrderMaterial slot='工单物料' id='WorkOrderMaterial' />
+	<WorkOrderNotarizeBill slot='服务确认单' billData='{{workDetail}}' id='WorkOrderNotarizeBill' disabled="{{true}}" />
+
+
+	<Record slot='操作记录' id="Record" ownertable='sa_service_improvement' ownerid='{{detail.sa_service_improvementid}}' />
+	<Files slot='附件' id="Files" ownertable='sa_service_improvement' ownerid='{{detail.sa_service_improvementid}}' />
 </Yl_FunTabs>
 
 <Yl_Tabbar wx:if="{{tabbarList.length}}" list='{{tabbarList}}' bind:callback="tabbarOnClick" />

+ 52 - 34
E-service/workOrder/detail.js

@@ -73,7 +73,7 @@ Page({
       "content": {
         "sa_workorderid": this.data.sa_workorderid
       },
-    }).then(res => {
+    }).then(async res => {
       console.log("工单详情", res)
       if (res.code != '1') return wx.showToast({
         title: res.msg,
@@ -95,45 +95,60 @@ Page({
       this.setTabbar()
       this.partialRenewal()
       const appAuth = wx.getStorageSync('auth').workBill;
-      if (appAuth.options.some(v => v == 'applicationForm')) this.getServiceDetail(res.data.sa_serviceorderid)
+      if (appAuth.options.some(v => v == 'applicationForm')) await this.getServiceDetail(res.data.sa_serviceorderid)
+      this.setData({
+        tabsList: this.data.tabsList.concat([{
+          label: "附件",
+          color: "#ED4949",
+          model: "#Files"
+        }, {
+          label: "操作记录",
+          color: "#ED4949",
+          model: "#Record"
+        }])
+      })
     })
   },
   getServiceDetail(id) {
-    _Http.basic({
-      "id": 20230206091603,
-      "content": {
-        "sa_serviceorderid": id
-      },
-    }).then(res => {
-      console.log("申请单详情", res)
-      if (res.code != '1') return wx.showToast({
-        title: res.msg,
-        icon: "none"
-      })
-      let tabsList = [{
-        label: "申请信息",
-        idname: "sa_serviceorderid",
-        color: "#3874F6"
-      }, {
-        label: "受理信息",
-        idname: "sa_serviceorderid",
-        color: "#3874F6"
-      }];
-      if (['售中', "售后"].includes(res.data.servicetype)) {
-        tabsList.unshift({
-          label: "服务商品",
-          model: "#ServiceProduct",
+    return new Promise((resolve) => {
+      _Http.basic({
+        "id": 20230206091603,
+        "content": {
+          "sa_serviceorderid": id
+        },
+      }).then(res => {
+        console.log("申请单详情", res)
+        resolve()
+        if (res.code != '1') return wx.showToast({
+          title: res.msg,
+          icon: "none"
+        })
+        let tabsList = [{
+          label: "申请信息",
           idname: "sa_serviceorderid",
           color: "#3874F6"
+        }, {
+          label: "受理信息",
+          idname: "sa_serviceorderid",
+          color: "#3874F6"
+        }];
+        if (['售中', "售后"].includes(res.data.servicetype)) {
+          tabsList.unshift({
+            label: "服务商品",
+            model: "#ServiceProduct",
+            idname: "sa_serviceorderid",
+            color: "#3874F6"
+          })
+        }
+        this.setData({
+          tabsList: this.data.tabsList.concat(tabsList),
+          serviceDetail: res.data
         })
-      }
-      this.setData({
-        tabsList: this.data.tabsList.concat(tabsList),
-        serviceDetail: res.data
+        this.selectComponent("#ServicePview1").setPreview(res);
+        this.selectComponent("#ServicePview2").setPreview(res);
       })
-      this.selectComponent("#ServicePview1").setPreview(res);
-      this.selectComponent("#ServicePview2").setPreview(res);
     })
+
   },
   areaInput(e) {
     this.data.reason[e.currentTarget.dataset.name] = e.detail.value;
@@ -345,9 +360,12 @@ Page({
   async setTabbar() {
     let status = this.data.detail.status,
       tabbarList = [],
-      isLeader = this.data.detail.team.find(v => v.isleader).userid == wx.getStorageSync("userMsg").userid,
+      isLeader = false,
       isqQuery = this.data.isqQuery,
       isworkleader = this.data.isworkleader || false;
+    try {
+      isLeader = this.data.detail.team.find(v => v.isleader).userid == wx.getStorageSync("userMsg").userid
+    } catch (error) {}
     let options = {
       编辑: {
         icon: "icon-bianji2",
@@ -448,7 +466,7 @@ Page({
             pageNumber,
             pageTotal
           } = Component.data.content,
-          id = this.data.detail[ac.idname || ''];
+          id = this.data.detail[ac.idname || 'sa_workorderid'];
         if (total == null || init) {
           Component.getList(id, init);
         } else if (pageNumber <= pageTotal) {

+ 3 - 1
E-service/workOrder/detail.json

@@ -8,6 +8,8 @@
     "WorkOrderNotarizeBill": "/E-service/workOrder/notarizeBill/index",
     "ServiceProduct": "/E-service/serviceBillList/product/index",
     "ServicePview1": "/E-service/serviceBillList/Pview1/index",
-    "ServicePview2": "/E-service/serviceBillList/Pview2/index"
+    "ServicePview2": "/E-service/serviceBillList/Pview2/index",
+    "Files": "/components/files/index",
+    "Record": "/components/record/index"
   }
 }

+ 3 - 0
E-service/workOrder/detail.wxml

@@ -72,6 +72,9 @@
 	<ServicePview1 id='ServicePview1' slot='申请信息' />
 	<ServicePview2 id='ServicePview2' slot='受理信息' />
 
+	<Record slot='操作记录' id="Record" ownertable='sa_workorder' ownerid='{{detail.sa_workorderid}}' />
+	<Files slot='附件' id="Files" ownertable='sa_workorder' ownerid='{{detail.sa_workorderid}}' />
+
 	<view style="height: 180rpx;" />
 </Yl_FunTabs>
 

+ 2 - 1
components/Yl_FunTabs/index.wxss

@@ -15,7 +15,8 @@
     flex-direction: column;
     align-items: center;
     height: 100%;
-    width: 172rpx;
+    min-width: 172rpx;
+    padding: 20rpx;
     padding-top: 16rpx;
     text-align: center;
     box-sizing: border-box;

+ 92 - 0
components/files/index.js

@@ -0,0 +1,92 @@
+const _Http = getApp().globalData.http,
+    MFT = require("../../utils/FormatTheAttachment"),
+    checkFile = require("../../utils/checkFile");
+Component({
+    options: {
+        addGlobalClass: true
+    },
+    properties: {
+        ownertable: {
+            type: String
+        },
+        ownerid: {
+            type: String
+        },
+        disabled: {
+            type: Boolean,
+            value: true
+        }
+    },
+    data: {
+        content: {
+            nocache: true,
+            pageNumber: 1,
+            pageSize: 10,
+            pageTotal: 1,
+            total: null,
+            usetype: ""
+        },
+        list: []
+    },
+    lifetimes: {
+        attached: function () {
+            getApp().globalData.Language.getLanguagePackage(this)
+        }
+    },
+    methods: {
+        getList(id, init = false) {
+            let content = {
+                ...this.data.content,
+                "ownertable": this.data.ownertable,
+                "ownerid": this.data.ownerid,
+                nocache: true,
+            };
+            if (init) content.pageNumber = 1
+            _Http.basic({
+                "classname": "system.attachment.Attachment",
+                "method": "queryFileLink",
+                content
+            }).then(res => {
+                console.log("附件列表", res)
+                if (res.code != '1') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                });
+                res.data = MFT.fileList(res.data)
+                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)
+                })
+            })
+        },
+        addFiles({
+            detail
+        }) {
+            _Http.basic({
+                "classname": "system.attachment.Attachment",
+                "method": "createFileLink",
+                "content": {
+                    "ownertable": this.data.ownertable,
+                    "ownerid": this.data.ownerid,
+                    "usetype": "default",
+                    "attachmentids": detail
+                }
+            }).then(res => {
+                console.log('上传附件', res)
+                if (res.code != '1') return wx.showToast({
+                    title: res.msg,
+                    icon: "none"
+                });
+                this.getList(1, true);
+            })
+        },
+        openFile(e) {
+            const {
+                item
+            } = e.currentTarget.dataset;
+            checkFile.checkFile(item)
+        }
+    }
+})

+ 6 - 0
components/files/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "My_upload": "/components/Yl_Upload/index"
+    }
+}

+ 84 - 0
components/files/index.scss

@@ -0,0 +1,84 @@
+.head {
+    display: flex;
+    align-items: center;
+    width: 100vw;
+    height: 120rpx;
+    padding: 0 20rpx 0 30rpx;
+    box-sizing: border-box;
+
+    .count {
+        font-size: 28rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #333333;
+    }
+
+    .expand {
+        flex: 1;
+        display: flex;
+        align-items: center;
+        justify-content: flex-end;
+
+        .but {
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            flex-shrink: 0;
+            width: 80rpx;
+            height: 80rpx;
+            background: #FFFFFF;
+            border-radius: 8rpx;
+            border: 2rpx solid #CCCCCC;
+            margin-left: 20rpx;
+            color: #666666;
+        }
+    }
+}
+
+.my-card {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    width: 690rpx;
+    margin: 0 auto 10rpx;
+    height: 100rpx;
+    padding: 10rpx 30rpx 0;
+    background-color: #fff;
+    box-sizing: border-box;
+    border-radius: 8rpx;
+
+    .flie {
+        display: flex;
+        align-items: center;
+        height: 100%;
+
+        .image {
+            width: 58rpx;
+            height: 58rpx;
+        }
+
+        .details {
+            width: 500rpx;
+            height: 100%;
+            margin-left: 25rpx;
+
+            .name {
+                display: flex;
+                align-items: center;
+                height: 40rpx;
+                font-size: 28rpx;
+                font-family: PingFang SC-Bold, PingFang SC;
+                font-weight: bold;
+                color: #333333;
+                margin-right: 10rpx;
+            }
+
+            .time {
+                font-size: 20rpx;
+                font-family: PingFang SC-Regular, PingFang SC;
+                color: #999999;
+                margin-top: 14rpx;
+            }
+        }
+    }
+
+}

+ 26 - 0
components/files/index.wxml

@@ -0,0 +1,26 @@
+<view class="head">
+    <view class="count">
+        <text wx:if="{{language['总共']}}">{{language['总共']}}:{{content.total}}</text>
+        <text wx:else>总共{{content.total}}个</text>
+    </view>
+    <view class="expand">
+        <My_upload wx:if="{{disabled}}" bind:uploadCallback='addFiles'>
+            <navigator url="#" class="but">
+                <van-icon name="plus" />
+            </navigator>
+        </My_upload>
+    </view>
+</view>
+<navigator class="my-card" url="#" wx:for="{{list}}" wx:key="attachmentid" data-item="{{item}}" bindtap="openFile">
+    <view class="flie">
+        <image class="image" src="{{item.cover}}" />
+        <view class="details">
+            <view class="name">
+                <view class="line-1">{{item.document}}</view>
+                <van-icon wx:if="{{item.isCollect==1}}" name="star" color='#FADB14' />
+            </view>
+            <view class="time">{{item.createdate}}</view>
+        </view>
+    </view>
+</navigator>
+<Yl_Empty wx:if="{{list.length==0}}" />

+ 58 - 0
components/record/index.js

@@ -0,0 +1,58 @@
+const _Http = getApp().globalData.http;
+Component({
+    options: {
+        addGlobalClass: true
+    },
+    properties: {
+        ownertable: {
+            type: String
+        },
+        ownerid: {
+            type: String
+        },
+    },
+    data: {
+        content: {
+            nocache: true,
+            pageNumber: 1,
+            pageSize: 10,
+            pageTotal: 1,
+            total: null
+        },
+        list: []
+    },
+    lifetimes: {
+        attached: function () {
+            getApp().globalData.Language.getLanguagePackage(this)
+        }
+    },
+    methods: {
+        getList(id, init = false) {
+            let content = {
+                ...this.data.content,
+                "ownertable": this.data.ownertable,
+                "ownerid": this.data.ownerid,
+            };
+            if (init) {
+                content.pageNumber = 1
+                content.pageTotal = 1
+            }
+            _Http.basic({
+                "id": 20221114125401,
+                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)
+                })
+            })
+        },
+    }
+})

+ 4 - 0
components/record/index.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 120 - 0
components/record/index.scss

@@ -0,0 +1,120 @@
+.head {
+	display: flex;
+	align-items: center;
+	width: 100vw;
+	height: 120rpx;
+	padding: 0 20rpx 0 30rpx;
+	box-sizing: border-box;
+
+	.count {
+		font-size: 28rpx;
+		font-family: PingFang SC-Regular, PingFang SC;
+		color: #333333;
+	}
+
+	.expand {
+		flex: 1;
+		display: flex;
+		align-items: center;
+		justify-content: flex-end;
+
+		.but {
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			flex-shrink: 0;
+			width: 80rpx;
+			height: 80rpx;
+			background: #FFFFFF;
+			border-radius: 8rpx;
+			border: 2rpx solid #CCCCCC;
+			margin-left: 20rpx;
+			color: #666666;
+		}
+	}
+}
+
+.exp {
+    margin-top: 8rpx;
+    font-size: 24rpx;
+    font-family: PingFang SC-Regular, PingFang SC;
+    color: #333333;
+}
+
+.record-box {
+    width: 100vw;
+    padding: 0 30rpx;
+    box-sizing: border-box;
+    background-color: #ffffff;
+
+    .item {
+        width: 100%;
+        border-bottom: 1px solid #DDDDDD;
+        padding: 20rpx 0;
+
+        .head {
+            display: flex;
+            width: 100%;
+            height: 80rpx;
+
+            .portrait {
+                width: 80rpx;
+                height: 80rpx;
+                border-radius: 50%;
+                overflow: hidden;
+                margin-right: 20rpx;
+                flex-shrink: 0;
+
+                .replace {
+                    text-align: center;
+                    line-height: 80rpx;
+                    background-color: #3874F6;
+                    font-size: 28rpx;
+                    font-family: PingFang SC-Regular, PingFang SC;
+                    color: #FFFFFF;
+                }
+            }
+
+            .introduce {
+                flex: 1;
+                height: 80rpx;
+
+                .title {
+                    display: flex;
+                    align-items: flex-end;
+                    height: 42rpx;
+                    font-size: 30rpx;
+                    font-weight: 400;
+                    color: #333333;
+                    font-family: PingFang SC-Regular, PingFang SC;
+
+                    .line-1 {
+                        max-width: 400rpx;
+                    }
+
+                    text {
+                        display: inline-block;
+                        margin-left: 20rpx;
+                        font-size: 24rpx;
+                        color: #666666;
+                    }
+                }
+
+                .time {
+                    font-size: 24rpx;
+                    color: #999999;
+                    margin-top: 6rpx;
+                }
+            }
+        }
+
+        .remarks {
+            font-size: 24rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #666666;
+            line-height: 28rpx;
+            margin-top: 20rpx;
+            word-break: break-all;
+        }
+    }
+}

+ 33 - 0
components/record/index.wxml

@@ -0,0 +1,33 @@
+<view class="head">
+    <view class="count">
+        <text wx:if="{{language['总共']}}">{{language['总共']}}:{{content.total}}</text>
+        <text wx:else>总共{{content.total}}个</text>
+    </view>
+</view>
+<navigator class="record-box" url="#" wx:for="{{list}}" wx:key="actionuserid">
+    <view class="item">
+        <view class="head">
+            <view class="portrait">
+                <van-image wx:if="{{item.headpic}}" width="100%" height="100%" src="{{item.headpic}}" use-loading-slot lazy-load>
+                    <van-loading slot="loading" type="spinner" size="20" vertical />
+                </van-image>
+                <view class="replace" wx:else>
+                    {{item.actionby[0]}}
+                </view>
+            </view>
+            <view class="introduce">
+                <view class="title">
+                    <view class="line-1">{{item.actionby}}</view>
+                    <text>{{language[item.action]||item.action}}</text>
+                </view>
+                <view class="time">
+                    {{item.actiondate}}
+                </view>
+            </view>
+        </view>
+        <view class="remarks" wx:if="{{item.remarks}}">
+            {{language[item.remarks]||item.remarks}}
+        </view>
+    </view>
+</navigator>
+<My_empty wx:if="{{list.length==0}}" />

+ 46 - 0
utils/checkFile.js

@@ -0,0 +1,46 @@
+module.exports.checkFile = (item) => {
+    if (['image', 'video'].includes(item.fileType)) {
+        preViewMedia(item)
+    } else if (['word', 'excel', 'ppt', 'pdf'].includes(item.fileType)) {
+        openDocument(item)
+    } else {
+        wx.setClipboardData({
+            data: item.url,
+            success: function () {
+                getApp().globalData.Language.modeBoxPrompts('当前文件类型不支持在线浏览,已将文件下载地址复制到剪切板,您可在浏览器中打开链接下载到本地浏览')
+            }
+        })
+    }
+}
+
+function preViewMedia(item) {
+    wx.previewMedia({
+        sources: [{
+            url: item.url,
+            type: item.fileType,
+        }],
+        current: 0,
+        showmenu: true
+    })
+}
+
+function openDocument(item) {
+    wx.downloadFile({
+        url: item.url,
+        success: function (res) {
+            console.log(res.tempFilePath)
+            wx.openDocument({
+                filePath: res.tempFilePath,
+                fileType: item.postfix,
+                showMenu: true,
+                success: function (res) {
+                    console.log(res)
+                    console.log('打开文档成功')
+                },
+                fail: (err) => {
+                    getApp().globalData.Language.showToast('打开失败')
+                }
+            })
+        }
+    })
+}