Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev
| | |
| | | "style": { |
| | | "navigationBarTitleText": "设备维修验收单缓存" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/MJGL/Sb_EquipRepairSendWork/Sb_EquipRepairSendWorkBill", |
| | | }, |
| | | { |
| | | "path" : "pages/MJGL/Sb_EquipRepairSendWork/Sb_EquipRepairSendWorkBill", |
| | | "style": { |
| | | "navigationBarTitleText": "设备维修派工单" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/MJGL/Sb_EquipRepairSendWork/Sb_EquipRepairSendWorkBillList", |
| | | "style": { |
| | | "navigationBarTitleText": "设备维修派工单缓存" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBill", |
| | | "style": { |
| | | "navigationBarTitleText": "器具维修派工单" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBillList", |
| | | "style": { |
| | | "navigationBarTitleText": "器具维修派工单缓存" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/MJGL/SC_MouldRepairCheck/Sc_MouldRepairCheckBill", |
| | | "style": { |
| | | "navigationBarTitleText": "器具维修验收单" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/MJGL/SC_MouldRepairCheck/Sc_MouldRepairCheckBillList", |
| | | "style": { |
| | | "navigationBarTitleText": "器具维修验收单缓存" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/ZLGL/OA_WorkLink/OA_WorkLinkBill", |
| | | "style": { |
| | | "navigationBarTitleText": "工作联系单" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/ZLGL/OA_WorkLink/OA_WorkLinkBillList", |
| | | "style": { |
| | | "navigationBarTitleText": "工作联系单列表" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/MJGL/Sb_EquipRepairTaskReport/Sb_EquipRepairTaskReport", |
| | | "style": { |
| | | "navigationBarTitleText": "设备维修任务" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/MJGL/Sc_MouldRepairTaskReport/Sc_MouldRepairTaskReport", |
| | | "style": { |
| | | "navigationBarTitleText": "器具维修任务" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/EmployeeRecords/EmployeeRecordsBill", |
| | | "style": { |
| | | "navigationBarTitleText": "员工签到记录表" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/EmployeeRecords/EmployeeRecordsBillList", |
| | | "style": { |
| | | "navigationBarTitleText": "员工签到记录表列表" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBill", |
| | | "style": { |
| | | "navigationBarTitleText": "设备故障登记单" |
| | | } |
| | | }, { |
| | | "path": "pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBillList", |
| | | "style": { |
| | | "navigationBarTitleText": "设备故障登记单列表" |
| | | } |
| | | } |
| | | "navigationBarTitleText" : "设备维修派工单" |
| | | } |
| | | }, |
| | | { |
| | | "path" : "pages/MJGL/Sb_EquipRepairSendWork/Sb_EquipRepairSendWorkBillList", |
| | | |
| | | "style": { |
| | | "navigationBarTitleText" : "设备维修派工单缓存" |
| | | } |
| | | }, |
| | | { |
| | | "path" : "pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBill", |
| | | |
| | | "style": { |
| | | "navigationBarTitleText" : "器具维修派工单" |
| | | } |
| | | }, |
| | | { |
| | | "path" : "pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBillList", |
| | | |
| | | "style": { |
| | | "navigationBarTitleText" : "器具维修派工单缓存" |
| | | } |
| | | }, |
| | | { |
| | | "path" : "pages/MJGL/SC_MouldRepairCheck/Sc_MouldRepairCheckBill", |
| | | |
| | | "style": { |
| | | "navigationBarTitleText" : "器具维修验收单" |
| | | } |
| | | }, |
| | | { |
| | | "path" : "pages/MJGL/SC_MouldRepairCheck/Sc_MouldRepairCheckBillList", |
| | | |
| | | "style": { |
| | | "navigationBarTitleText" : "器具维修验收单缓存" |
| | | } |
| | | }, |
| | | { |
| | | "path" : "pages/ZLGL/OA_WorkLink/OA_WorkLinkBill", |
| | | |
| | | "style": { |
| | | "navigationBarTitleText" : "工作联系单" |
| | | } |
| | | }, |
| | | { |
| | | "path" : "pages/ZLGL/OA_WorkLink/OA_WorkLinkBillList", |
| | | |
| | | "style": { |
| | | "navigationBarTitleText" : "工作联系单列表" |
| | | } |
| | | }, |
| | | { |
| | | "path" : "pages/MJGL/Sb_EquipRepairTaskReport/Sb_EquipRepairTaskReport", |
| | | |
| | | "style": { |
| | | "navigationBarTitleText" : "设备维修任务" |
| | | } |
| | | }, |
| | | { |
| | | "path" : "pages/MJGL/Sc_MouldRepairTaskReport/Sc_MouldRepairTaskReport", |
| | | |
| | | "style": { |
| | | "navigationBarTitleText" : "器具维修任务" |
| | | } |
| | | }, |
| | | { |
| | | "path" : "pages/EmployeeRecords/EmployeeRecordsBill", |
| | | |
| | | "style": { |
| | | "navigationBarTitleText" : "员工签到记录表" |
| | | } |
| | | }, |
| | | { |
| | | "path" : "pages/EmployeeRecords/EmployeeRecordsBillList", |
| | | |
| | | "style": { |
| | | "navigationBarTitleText" : "员工签到记录表列表" |
| | | } |
| | | }, |
| | | { |
| | | "path" : "pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBill", |
| | | |
| | | "style": { |
| | | "navigationBarTitleText" : "设备故障登记单" |
| | | } |
| | | },{ |
| | | "path" : "pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBillList", |
| | | |
| | | "style": { |
| | | "navigationBarTitleText" : "设备故障登记单列表" |
| | | } |
| | | }, |
| | | { |
| | | "path" : "pages/MJGL/Sb_EquipBegin/Sb_EquipBeginBill", |
| | | "style" : |
| | | { |
| | | "navigationBarTitleText" : "设备开机单" |
| | | } |
| | | }, |
| | | { |
| | | "path" : "pages/MJGL/Sb_EquipStop/Sb_EquipStopBill", |
| | | "style" : |
| | | { |
| | | "navigationBarTitleText" : "" |
| | | } |
| | | }, |
| | | { |
| | | "path" : "pages/MJGL/Sc_WorkDotCheck/Sc_WorkDotCheckBillList_Day", |
| | | "style" : |
| | | { |
| | | "navigationBarTitleText" : "点检清单" |
| | | } |
| | | }, |
| | | { |
| | | "path" : "pages/MJGL/Sb_EquipResumeCheckQuery/Sb_EquipResumeCheckQuery", |
| | | "style" : |
| | | { |
| | | "navigationBarTitleText" : "设备履历" |
| | | } |
| | | }, |
| | | { |
| | | "path" : "pages/MJGL/Sc_EquipmentProcessList/Sc_EquipmentProcess", |
| | | "style" : |
| | | { |
| | | "navigationBarTitleText" : "设备工艺路线" |
| | | } |
| | | } |
| | | |
| | | |
| | | ], |
| | | "tabBar": { |
| New file |
| | |
| | | <template> |
| | | <view> |
| | | <view class="tabs" id="tabs"> |
| | | <view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">基本信息</view> |
| | | <!-- <view :class="tabs == 1 ? 'on':''" @tap="tabs = 1">明细信息</view> --> |
| | | <view :class="tabs == 2 ? 'on':''" @tap="tabs = 2">其他信息</view> |
| | | <!-- <view :class="tabs == 3 ? 'on':''" @tap="tabs = 3">附件信息</view> --> |
| | | </view> |
| | | <!-- 基本信息 --> |
| | | <template v-if="tabs == 0"> |
| | | <view class="form" :style="{ |
| | | height: containerHeight + 'px', |
| | | overflow: 'auto' |
| | | }"> |
| | | <view class="form-item"> |
| | | <view class="title">单据号:</view> |
| | | <view class="righton"> |
| | | <input disabled v-model="hform.HBillNo" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">日期:</view> |
| | | <view class="righton"> |
| | | <input disabled v-model="hform.HDate" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title required">设备:</view> |
| | | <!-- <zxz-uni-data-select required class="right" :localdata="HDeptList" dataKey="部门名称" |
| | | dataValue="HItemID" v-model="hform.HEquipName"> |
| | | |
| | | </zxz-uni-data-select> --> |
| | | <view class="righton"> |
| | | <input disabled v-model="hform.HEquipName" placeholder="" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title required">关联主设备:</view> |
| | | <!-- <zxz-uni-data-select required class="right" :localdata="HEmpList" dataKey="HName" |
| | | dataValue="HItemID" v-model="hform.HEquipRelationName"> |
| | | |
| | | </zxz-uni-data-select> --> |
| | | <view class="righton"> |
| | | <input disabled v-model="hform.HEquipRelationName" placeholder="" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title required">开机人:</view> |
| | | <!-- <zxz-uni-data-select required class="right" :localdata="HEmpList" dataKey="HName" |
| | | dataValue="HItemID" v-model="hform.HBeginEmpName"> |
| | | |
| | | </zxz-uni-data-select> --> |
| | | <view class="righton"> |
| | | <input disabled v-model="hform.HBeginEmpName" placeholder="" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">开机时间:</view> |
| | | <view class="righton"> |
| | | <input disabled v-model="hform.HBeginTime" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">备注:</view> |
| | | <view class="right"> |
| | | <textarea v-model="hform.HRemark" placeholder="请输入备注" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <!-- 其他信息 --> |
| | | <template v-if="tabs == 2"> |
| | | <view class="form" :style="{ |
| | | height: containerHeight + 'px', |
| | | overflow: 'auto' |
| | | }"> |
| | | <view class="form-item"> |
| | | <view class="title">创建人:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HMaker" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">创建日期:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HMakeDate" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">修改人:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HUpDater" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">修改日期:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HUpDateDate" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">审核人:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HChecker" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">审核时间:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HCheckDate" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">作废人:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HDeleteMan" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">作废日期:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HDeleteDate" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | </template> |
| | | <!-- 操作按钮 --> |
| | | <view class="buttons" id="buttons"> |
| | | <button class="btn-a" size="mini" @tap="submit">提交</button> |
| | | <view style="flex: 1;"></view> |
| | | <!-- <button class="btn-a" size="mini" @tap="addNew">新增</button> --> |
| | | <button class="btn-c" size="mini" @tap="goBack">退出</button> |
| | | </view> |
| | | <!-- <xe-upload ref="XeUpload" :options="uploadOptions" @callback="handleUploadCallback"></xe-upload> --> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import dayjs from "dayjs"; |
| | | import { |
| | | CommonUtils |
| | | } from "@/utils/common"; |
| | | import { |
| | | MpaasScan |
| | | } from "@/utils/mpaasScan.js" |
| | | import { |
| | | getUserInfo |
| | | } from "../../../utils/auth"; |
| | | export default { |
| | | // 设备开机单 |
| | | name: 'Sb_EquipBeginBill', |
| | | data() { |
| | | return { |
| | | tabs: 0, |
| | | HMainSourceBillType: "", |
| | | btnTop: 0, |
| | | tabsBottom: 0, |
| | | HModName: "Sb_EquipBeginBill", |
| | | HBillType: '3917', |
| | | operationType: 1, |
| | | uploadOptions: {}, |
| | | enableEdit: true, |
| | | |
| | | HDeptList: [], |
| | | HRepairCheckList: [], |
| | | HEmpList: [], |
| | | HRepairList: [], |
| | | |
| | | hform: { |
| | | "HBillNo": "", |
| | | "HInterID": "0", |
| | | "HDate": dayjs(new Date()).format("YYYY-MM-DD"), |
| | | "HEquipName": "", |
| | | "HEquipID": "0", |
| | | "HEquipRelationName": "", |
| | | "HEquipRelationID": "0", |
| | | "HBeginEmpName": getUserInfo()["HEmpName"], |
| | | "HBeginEmpID": getUserInfo()["HEmpID"], |
| | | "HBeginTime": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"), |
| | | "HRemark": "", |
| | | HMaker: getUserInfo()["Czymc"], |
| | | HChecker: '', |
| | | HCloseMan: '', |
| | | HUpDater: '', |
| | | HMakeDate: dayjs(new Date()).format("YYYY-MM-DD"), |
| | | HCheckDate: '', |
| | | HCloseDate: '', |
| | | HUpDateDate: '', |
| | | HDeleteMan: '', |
| | | HDeleteDate: '' |
| | | }, |
| | | }; |
| | | }, |
| | | computed: { |
| | | containerHeight: { |
| | | get() { |
| | | return this.btnTop - this.tabsBottom - 5 |
| | | } |
| | | }, |
| | | }, |
| | | methods: { |
| | | // 维修项目 |
| | | async getRepairList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Gy_Repair/GetRepairList', |
| | | data: { |
| | | sWhere: '', |
| | | user: getUserInfo()["Czymc"] |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HRepairList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `获取检验项目失败: ${Message}` |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `获取检验项目失败: ${err}` |
| | | }) |
| | | } |
| | | }, |
| | | // 删除明细 |
| | | delDetail(item) { |
| | | |
| | | }, |
| | | // 提交数据有效性校验 |
| | | ValidCheck() { |
| | | if (this.hform.HEquipID == 0) { |
| | | return { |
| | | Message: "未录入设备信息,请先录入设备信息!", |
| | | state: false |
| | | } |
| | | } |
| | | |
| | | if (this.hform.HEmpID == 0) { |
| | | return { |
| | | Message: "验收人不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | |
| | | return { |
| | | Message: "", |
| | | state: true |
| | | } |
| | | }, |
| | | addNew() { |
| | | uni.redirectTo({ |
| | | url: './Sb_EquipRepairSendWorkBill?operationType=1' |
| | | }) |
| | | }, |
| | | goBack() { |
| | | uni.navigateBack() |
| | | }, |
| | | checkBoxChangeHandler(index, e) { |
| | | let cr = e.detail.value |
| | | if (cr.length == 0) { |
| | | this.HCheckFileList[index]["HDotCheckResult"] = false |
| | | } else { |
| | | this.HCheckFileList[index]["HDotCheckResult"] = true |
| | | } |
| | | }, |
| | | radioChange({ |
| | | detail: { |
| | | value |
| | | } |
| | | }) { |
| | | this.hform.HCheckResult = value |
| | | }, |
| | | async getMaxNum() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Web/GetMAXNum", |
| | | data: { |
| | | "HBillType": this.HBillType |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | count, |
| | | data, |
| | | Message |
| | | } = res.data |
| | | console.log('data: ', data); |
| | | this.hform.HInterID = data[0]["HInterID"] |
| | | this.hform.HBillNo = data[0]["HBillNo"] |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "获取单据信息异常: " + err |
| | | }) |
| | | } |
| | | }, |
| | | async set_CheckBill(HInterID, num) { |
| | | try{ |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Sb_EquipBeginBill/AuditSb_EquipBeginBill", |
| | | data: { |
| | | HInterID: HInterID, |
| | | type: num, |
| | | user: getUserInfo()['Czymc'] |
| | | } |
| | | }) |
| | | |
| | | if(res.count == 1) { |
| | | return |
| | | }else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "设备开机单审核失败: " + res.Message |
| | | }) |
| | | } |
| | | }catch(err){ |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "设备开机单审核失败: " + err |
| | | }) |
| | | } |
| | | }, |
| | | async submit() { |
| | | let valid = this.ValidCheck() |
| | | if (!valid.state) { |
| | | CommonUtils.showTips({ |
| | | message: valid.Message |
| | | }) |
| | | return |
| | | } |
| | | |
| | | try { |
| | | let oMain = JSON.stringify(this.hform); |
| | | let sMainSub = oMain + ';Add' + `;${getUserInfo()['Czymc']}`; |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: "/Sb_EquipBeginBill/SaveSb_EquipBeginBillMain", |
| | | data: { |
| | | "sMainSub": sMainSub |
| | | }, |
| | | method: "POST" |
| | | }) |
| | | |
| | | if (!res) { |
| | | return |
| | | } |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | if (data.Verify == "Y") { //自动审核 |
| | | set_checkBill(data.HInterID, 1) |
| | | } |
| | | |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: res.data.Message + '返回上级页面', |
| | | showCancel: false, |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | setTimeout(() => { |
| | | uni.navigateBack(); |
| | | }, 50) |
| | | } else if (res.cancel) { |
| | | setTimeout(() => { |
| | | uni.navigateBack(); |
| | | }, 50) |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "提交单据失败: " + Message |
| | | }) |
| | | } |
| | | |
| | | |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "提交单据失败: " + err |
| | | }) |
| | | } |
| | | }, |
| | | async getEquipInfo() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Gy_EquipFileMain/getSb_EquipList", |
| | | data: { |
| | | HInterID: this.hform.HEquipID, |
| | | user: getUserInfo()['Czymc'] |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | Message, |
| | | count |
| | | } = res.data |
| | | |
| | | if (count == 1) { |
| | | console.log('data: ', data); |
| | | |
| | | this.hform.HEquipID = data[0].hmainid |
| | | this.hform.HEquipName = data[0].设备名称 |
| | | this.hform.HEquipRelationID = data[0].HMainSourceID |
| | | this.hform.HEquipRelationName = data[0].所属主生产设备 |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "获取设备信息失败: " + Message |
| | | }) |
| | | } |
| | | |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "获取设备信息失败: " + err |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | onLoad(e) { |
| | | console.log('e: ', e); |
| | | if (!e.operationType) { |
| | | this.operationType = 1 |
| | | } else { |
| | | this.operationType = e.operationType |
| | | } |
| | | |
| | | if (this.operationType == 1) { |
| | | this.hform.HEquipID = e.HEquipID |
| | | // 新增 |
| | | this.getMaxNum() |
| | | this.getEquipInfo() |
| | | } else if (this.operationType == 2) { |
| | | // 复制 |
| | | } else if (this.operationType == 3) { |
| | | // 编辑 |
| | | |
| | | } else if (this.operationType == 4) { |
| | | // 浏览 |
| | | |
| | | } |
| | | }, |
| | | onReady() { |
| | | const query = uni.createSelectorQuery().in(this) |
| | | query.select("#buttons") |
| | | .boundingClientRect() |
| | | .select("#tabs") |
| | | .boundingClientRect() |
| | | .exec(res => { |
| | | this.btnTop = Math.floor(res[0].top) |
| | | this.tabsBottom = Math.ceil(res[1].bottom) |
| | | }) |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/pages/MJGL/style/MJBillStyle.scss" |
| | | </style> |
| | |
| | | |
| | | if (code == 1) { |
| | | data = data.h_v_Sb_EquipConkBookBillList_Edit[0] |
| | | |
| | | |
| | | this.enableEdit = false |
| | | } else { |
| | | CommonUtils.showTips({ |
| | |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `获取故障登记单失败: ${err}` |
| | | }) |
| | | } |
| | | }, |
| | | async GetEquipInfo(HEquipID) { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Gy_EquipFileMain/getSb_EquipList", |
| | | data: { |
| | | HInterID: HEquipID, |
| | | user: getUserInfo()["Czymc"] |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | Message, |
| | | count |
| | | } = res.data |
| | | if (count == 1) { |
| | | console.log('data: ',data); |
| | | Object.assign(this.hform, { |
| | | HDeptID: data[0]["HDeptID"], |
| | | HDeptName: data[0]["使用部门"], |
| | | HEquipID: data[0]["hmainid"], |
| | | HBarName: data[0]["设备名称"], |
| | | HBarModel: data[0]["设备规格"], |
| | | HBarSpec: data[0]["设备型号"], |
| | | HEmpID: getUserInfo()["HEmpID"], |
| | | HManagerID: data[0]["HRepairEmpID"] |
| | | }) |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `获取设备数据失败: ${Message}` |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `获取设备数据失败: ${err}` |
| | | }) |
| | | } |
| | | } |
| | |
| | | this.getEditData(hmainid) |
| | | |
| | | } else if (this.operationType == 4) { |
| | | // 浏览 |
| | | // 报工平台下推 |
| | | let HEquipID = e.HEquipID |
| | | this.getMaxNum() |
| | | this.GetEquipInfo(HEquipID) |
| | | |
| | | } |
| | | |
| New file |
| | |
| | | <template> |
| | | <view class="content"> |
| | | <view id="divide" style="width: 100%;height: 0rpx;background-color: #e5e5e5;"></view> |
| | | <view :style="{ |
| | | height: calcContentHeight + 'px', |
| | | overflowY: 'auto' |
| | | }"> |
| | | <view class="list" v-for="(item,index) in showList" :key="index" v-if="tabs==0"> |
| | | <uni-card :title="item.单据号" style="margin: 10px;"> |
| | | <view class="card-detail"> |
| | | <template v-for="(field, index) in CommonUtils.emptyValueFilter(item, HFieldList)"> |
| | | <view v-if="field.ColmType == 'DateTime'" class="detail"> |
| | | <text>{{field.ColmCols}}:</text>{{dayjs(item[field.ColmCols]).format("YYYY-MM-DD HH:mm:ss")}} |
| | | </view> |
| | | <view v-else class="detail"> |
| | | <text>{{field.ColmCols}}:</text>{{item[field.ColmCols]}} |
| | | </view> |
| | | </template> |
| | | </view> |
| | | </uni-card> |
| | | </view> |
| | | </view> |
| | | <view class="pagination-zone" id="pagination-zone"> |
| | | <uni-pagination show-icon :page-size="size" :total="dataLength" :current="page" |
| | | @change="onPaginationChangeHandler"></uni-pagination> |
| | | </view> |
| | | <BarCodePopupVue ref="barcodePopup"></BarCodePopupVue> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getUserInfo |
| | | } from "@/utils/auth.js"; |
| | | import BarCodePopupVue from "@/components/BarCodePopup/BarCodePopup.vue"; |
| | | import { |
| | | CommonUtils |
| | | } from "../../../utils/common"; |
| | | import dayjs from "dayjs"; |
| | | export default { |
| | | data() { |
| | | return { |
| | | dayjs, |
| | | CommonUtils, |
| | | userInfo: getUserInfo(), |
| | | serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API', |
| | | tabs: 0, |
| | | urls: '/Gy_EquipFileMain/GetResumeList', |
| | | MvarReportTitle: '设备履历', |
| | | hform: { |
| | | HInterID: 0, |
| | | HBillNo: '', |
| | | HSourceBillNo: '', |
| | | user: uni.getStorageSync('HUserName'), |
| | | HStockOrgID: uni.getStorageSync('OrganizationID'), |
| | | operationType: "4", |
| | | sWhere: "", |
| | | }, |
| | | sWhere: '', |
| | | listData: [], |
| | | showList: [], |
| | | HFieldList: [], // 字段列表 |
| | | showDetail: -1, |
| | | operations: -1, |
| | | |
| | | page: 1, |
| | | size: 20, |
| | | dataLength: 0, |
| | | divideBottom: 0, |
| | | paginationTop: 0, |
| | | showmore: false, |
| | | } |
| | | }, |
| | | computed: { |
| | | calcContentHeight: { |
| | | get() { |
| | | return this.paginationTop - this.divideBottom |
| | | } |
| | | } |
| | | }, |
| | | onShow() { |
| | | //用户模块权限判断 |
| | | this.changeTab(0) |
| | | console.log(this.userInfo, uni.getStorageSync('HUserName')) |
| | | }, |
| | | components: { |
| | | BarCodePopupVue |
| | | }, |
| | | onReady() { |
| | | this.getCalcHeight() |
| | | }, |
| | | methods: { |
| | | changeShowMore() { |
| | | this.showmore = !this.showmore |
| | | this.$nextTick(() => { |
| | | // 重新计算内容视口高度 |
| | | this.getCalcHeight() |
| | | }) |
| | | }, |
| | | getCalcHeight() { |
| | | let query = uni.createSelectorQuery().in(this) |
| | | query |
| | | .select("#divide") |
| | | .boundingClientRect() |
| | | .select("#pagination-zone") |
| | | .boundingClientRect() |
| | | .exec(res => { |
| | | this.divideBottom = Math.ceil(res[0].bottom) |
| | | this.paginationTop = Math.floor(res[1].top) |
| | | }) |
| | | }, |
| | | async qrCodeDisplay(item) { |
| | | this.$refs.barcodePopup.setCodeInfo(item.HBillNo) |
| | | await this.$nextTick() |
| | | this.$refs.barcodePopup.open() |
| | | }, |
| | | onPaginationChangeHandler({ |
| | | current |
| | | }) { |
| | | this.page = current |
| | | this.showList = this.getPage(current, this.size, this.listData) |
| | | }, |
| | | getPage(page, size, list) { |
| | | let sindex = (parseInt(page) - 1) * size |
| | | let eindex = parseInt(page) * size |
| | | let newList = list.slice(sindex, eindex) |
| | | return newList |
| | | }, |
| | | changeTab(e) { |
| | | this.tabs = e |
| | | this.page = 1 |
| | | this.showList = [] |
| | | |
| | | if (this.tabs == 0) { |
| | | this.urls = '/Gy_EquipFileMain/GetResumeList' |
| | | } |
| | | // if (this.tabs == 1) { |
| | | // this.urls = '/WEBSController/GetKf_ICStockBillQueryList_User_Json' |
| | | // } |
| | | this.search() |
| | | }, |
| | | async getList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: this.urls, |
| | | data: this.hform |
| | | }) |
| | | |
| | | let { |
| | | count, |
| | | data, |
| | | Message, |
| | | list |
| | | } = res.data |
| | | |
| | | if (count == 1) { |
| | | if (data == null) { |
| | | data = [] |
| | | } |
| | | this.listData = data |
| | | console.log('data: ', data); |
| | | this.showList = this.getPage(this.page, this.size, data) |
| | | this.dataLength = data.length |
| | | this.HFieldList = CommonUtils.fieldListFilterRole({ |
| | | FieldList: list, |
| | | ExcludeKeys: ["单据号"] |
| | | }).data |
| | | |
| | | console.log('this.HFieldList: ', this.HFieldList); |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `获取设备履历失败: ${Message}` |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `获取设备履历失败: ${err}` |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | search() { |
| | | this.hform.sWhere = '' |
| | | this.listData = [] |
| | | this.page = 1 |
| | | this.showList = [] |
| | | |
| | | this.hform.sWhere = { |
| | | Type: this.hform.Type, |
| | | HInterId: this.hform.HInterId |
| | | } |
| | | |
| | | this.getList() |
| | | }, |
| | | }, |
| | | onLoad(e) { |
| | | let { |
| | | operationType, |
| | | HEquipID |
| | | } = e |
| | | |
| | | if (operationType == 4) { |
| | | this.HInterID = HEquipID |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/pages/MJGL/style/MJListStyle.scss" |
| | | </style> |
| New file |
| | |
| | | <template> |
| | | <view> |
| | | <view class="tabs" id="tabs"> |
| | | <view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">基本信息</view> |
| | | <view :class="tabs == 2 ? 'on':''" @tap="tabs = 2">其他信息</view> |
| | | </view> |
| | | <!-- 基本信息 --> |
| | | <template v-if="tabs == 0"> |
| | | <view class="form" :style="{ |
| | | height: containerHeight + 'px', |
| | | overflow: 'auto' |
| | | }"> |
| | | <view class="form-item"> |
| | | <view class="title">单据号:</view> |
| | | <view class="righton"> |
| | | <input disabled v-model="hform.HBillNo" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">日期:</view> |
| | | <view class="righton"> |
| | | <input disabled v-model="hform.HDate" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title required">设备:</view> |
| | | <!-- <zxz-uni-data-select required class="right" :localdata="HDeptList" dataKey="部门名称" |
| | | dataValue="HItemID" v-model="hform.HEquipName"> |
| | | |
| | | </zxz-uni-data-select> --> |
| | | <view class="righton"> |
| | | <input disabled v-model="hform.HEquipName" placeholder="" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title required">关联主设备:</view> |
| | | <!-- <zxz-uni-data-select required class="right" :localdata="HEmpList" dataKey="HName" |
| | | dataValue="HItemID" v-model="hform.HEquipRelationName"> |
| | | |
| | | </zxz-uni-data-select> --> |
| | | <view class="righton"> |
| | | <input disabled v-model="hform.HEquipRelationName" placeholder="" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title required">停机人:</view> |
| | | <!-- <zxz-uni-data-select required class="right" :localdata="HEmpList" dataKey="HName" |
| | | dataValue="HItemID" v-model="hform.HBeginEmpName"> |
| | | |
| | | </zxz-uni-data-select> --> |
| | | <view class="righton"> |
| | | <input disabled v-model="hform.HStopEmpName" placeholder="" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">停机时间:</view> |
| | | <view class="righton"> |
| | | <input disabled v-model="hform.HStopTime" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">停机原因:</view> |
| | | <view class="right"> |
| | | <textarea v-model="hform.HStopReason" placeholder="请输入停机原因" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">备注:</view> |
| | | <view class="right"> |
| | | <textarea v-model="hform.HRemark" placeholder="请输入备注" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <!-- 其他信息 --> |
| | | <template v-if="tabs == 2"> |
| | | <view class="form" :style="{ |
| | | height: containerHeight + 'px', |
| | | overflow: 'auto' |
| | | }"> |
| | | <view class="form-item"> |
| | | <view class="title">创建人:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HMaker" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">创建日期:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HMakeDate" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">修改人:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HUpDater" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">修改日期:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HUpDateDate" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">审核人:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HChecker" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">审核时间:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HCheckDate" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">作废人:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HDeleteMan" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">作废日期:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HDeleteDate" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | </template> |
| | | <!-- 操作按钮 --> |
| | | <view class="buttons" id="buttons"> |
| | | <button class="btn-a" size="mini" @tap="submit">提交</button> |
| | | <view style="flex: 1;"></view> |
| | | <!-- <button class="btn-a" size="mini" @tap="addNew">新增</button> --> |
| | | <button class="btn-c" size="mini" @tap="goBack">退出</button> |
| | | </view> |
| | | <!-- <xe-upload ref="XeUpload" :options="uploadOptions" @callback="handleUploadCallback"></xe-upload> --> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import dayjs from "dayjs"; |
| | | import { |
| | | CommonUtils |
| | | } from "@/utils/common"; |
| | | import { |
| | | MpaasScan |
| | | } from "@/utils/mpaasScan.js" |
| | | import { |
| | | getUserInfo |
| | | } from "../../../utils/auth"; |
| | | export default { |
| | | // 设备停机单 |
| | | name: 'Sb_EquipBeginBill', |
| | | data() { |
| | | return { |
| | | tabs: 0, |
| | | HMainSourceBillType: "", |
| | | btnTop: 0, |
| | | tabsBottom: 0, |
| | | HModName: "Sb_EquipStopBillMain", |
| | | HBillType: '3918', |
| | | operationType: 1, |
| | | uploadOptions: {}, |
| | | enableEdit: true, |
| | | |
| | | HDeptList: [], |
| | | HRepairCheckList: [], |
| | | HEmpList: [], |
| | | HRepairList: [], |
| | | |
| | | hform: { |
| | | "HBillNo": "", |
| | | "HInterID": "0", |
| | | "HDate": dayjs(new Date()).format("YYYY-MM-DD"), |
| | | "HEquipName": "", |
| | | "HEquipID": "0", |
| | | "HEquipRelationName": "", |
| | | "HEquipRelationID": "0", |
| | | "HStopEmpName": getUserInfo()["HEmpName"], |
| | | "HStopEmpID": getUserInfo()["HEmpID"], |
| | | "HStopTime": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"), |
| | | "HRemark": "", |
| | | "HStopReason": "", |
| | | HMaker: getUserInfo()["Czymc"], |
| | | HChecker: '', |
| | | HCloseMan: '', |
| | | HUpDater: '', |
| | | HMakeDate: dayjs(new Date()).format("YYYY-MM-DD"), |
| | | HCheckDate: '', |
| | | HCloseDate: '', |
| | | HUpDateDate: '', |
| | | HDeleteMan: '', |
| | | HDeleteDate: '' |
| | | }, |
| | | }; |
| | | }, |
| | | computed: { |
| | | containerHeight: { |
| | | get() { |
| | | return this.btnTop - this.tabsBottom - 5 |
| | | } |
| | | }, |
| | | }, |
| | | methods: { |
| | | // 维修项目 |
| | | async getRepairList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Gy_Repair/GetRepairList', |
| | | data: { |
| | | sWhere: '', |
| | | user: getUserInfo()["Czymc"] |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HRepairList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `获取检验项目失败: ${Message}` |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `获取检验项目失败: ${err}` |
| | | }) |
| | | } |
| | | }, |
| | | // 删除明细 |
| | | delDetail(item) { |
| | | |
| | | }, |
| | | // 提交数据有效性校验 |
| | | ValidCheck() { |
| | | if (this.hform.HEquipID == 0) { |
| | | return { |
| | | Message: "未录入设备信息,请先录入设备信息!", |
| | | state: false |
| | | } |
| | | } |
| | | |
| | | if (this.hform.HEmpID == 0) { |
| | | return { |
| | | Message: "验收人不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | |
| | | return { |
| | | Message: "", |
| | | state: true |
| | | } |
| | | }, |
| | | addNew() { |
| | | uni.redirectTo({ |
| | | url: './Sb_EquipRepairSendWorkBill?operationType=1' |
| | | }) |
| | | }, |
| | | goBack() { |
| | | uni.navigateBack() |
| | | }, |
| | | checkBoxChangeHandler(index, e) { |
| | | let cr = e.detail.value |
| | | if (cr.length == 0) { |
| | | this.HCheckFileList[index]["HDotCheckResult"] = false |
| | | } else { |
| | | this.HCheckFileList[index]["HDotCheckResult"] = true |
| | | } |
| | | }, |
| | | radioChange({ |
| | | detail: { |
| | | value |
| | | } |
| | | }) { |
| | | this.hform.HCheckResult = value |
| | | }, |
| | | async getMaxNum() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Web/GetMAXNum", |
| | | data: { |
| | | "HBillType": this.HBillType |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | count, |
| | | data, |
| | | Message |
| | | } = res.data |
| | | console.log('data: ', data); |
| | | this.hform.HInterID = data[0]["HInterID"] |
| | | this.hform.HBillNo = data[0]["HBillNo"] |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "获取单据信息异常: " + err |
| | | }) |
| | | } |
| | | }, |
| | | async set_CheckBill(HInterID, num) { |
| | | try{ |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Sb_EquipStopBill/AuditSb_EquipStopBill", |
| | | data: { |
| | | HInterID: HInterID, |
| | | type: num, |
| | | user: getUserInfo()['Czymc'] |
| | | } |
| | | }) |
| | | |
| | | if(res.count == 1) { |
| | | return |
| | | }else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "设备开机单审核失败: " + res.Message |
| | | }) |
| | | } |
| | | }catch(err){ |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "设备开机单审核失败: " + err |
| | | }) |
| | | } |
| | | }, |
| | | async submit() { |
| | | let valid = this.ValidCheck() |
| | | if (!valid.state) { |
| | | CommonUtils.showTips({ |
| | | message: valid.Message |
| | | }) |
| | | return |
| | | } |
| | | |
| | | try { |
| | | let oMain = JSON.stringify(this.hform); |
| | | let sMainSub = oMain + ';Add' + `;${getUserInfo()['Czymc']}`; |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: "/Sb_EquipStopBill/SaveSb_EquipStopBillMain", |
| | | data: { |
| | | "sMainSub": sMainSub |
| | | }, |
| | | method: "POST" |
| | | }) |
| | | |
| | | if (!res) { |
| | | return |
| | | } |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | if (data.Verify == "Y") { //自动审核 |
| | | set_checkBill(data.HInterID, 1) |
| | | } |
| | | |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: res.data.Message + '返回上级页面', |
| | | showCancel: false, |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | setTimeout(() => { |
| | | uni.navigateBack(); |
| | | }, 50) |
| | | } else if (res.cancel) { |
| | | setTimeout(() => { |
| | | uni.navigateBack(); |
| | | }, 50) |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "提交单据失败: " + Message |
| | | }) |
| | | } |
| | | |
| | | |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "提交单据失败: " + err |
| | | }) |
| | | } |
| | | }, |
| | | async getEquipInfo() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Gy_EquipFileMain/getSb_EquipList", |
| | | data: { |
| | | HInterID: this.hform.HEquipID, |
| | | user: getUserInfo()['Czymc'] |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | Message, |
| | | count |
| | | } = res.data |
| | | |
| | | if (count == 1) { |
| | | console.log('data: ', data); |
| | | |
| | | this.hform.HEquipID = data[0].hmainid |
| | | this.hform.HEquipName = data[0].设备名称 |
| | | this.hform.HEquipRelationID = data[0].HMainSourceID |
| | | this.hform.HEquipRelationName = data[0].所属主生产设备 |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "获取设备信息失败: " + Message |
| | | }) |
| | | } |
| | | |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "获取设备信息失败: " + err |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | onLoad(e) { |
| | | console.log('e: ', e); |
| | | if (!e.operationType) { |
| | | this.operationType = 1 |
| | | } else { |
| | | this.operationType = e.operationType |
| | | } |
| | | |
| | | if (this.operationType == 1) { |
| | | this.hform.HEquipID = e.HEquipID |
| | | // 新增 |
| | | this.getMaxNum() |
| | | this.getEquipInfo() |
| | | } else if (this.operationType == 2) { |
| | | // 复制 |
| | | } else if (this.operationType == 3) { |
| | | // 编辑 |
| | | |
| | | } else if (this.operationType == 4) { |
| | | // 浏览 |
| | | |
| | | } |
| | | }, |
| | | onReady() { |
| | | const query = uni.createSelectorQuery().in(this) |
| | | query.select("#buttons") |
| | | .boundingClientRect() |
| | | .select("#tabs") |
| | | .boundingClientRect() |
| | | .exec(res => { |
| | | this.btnTop = Math.floor(res[0].top) |
| | | this.tabsBottom = Math.ceil(res[1].bottom) |
| | | }) |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/pages/MJGL/style/MJBillStyle.scss" |
| | | </style> |
| New file |
| | |
| | | <template> |
| | | <view class="content"> |
| | | <view id="divide" style="width: 100%;height: 0rpx;background-color: #e5e5e5;"></view> |
| | | <view :style="{ |
| | | height: calcContentHeight + 'px', |
| | | overflowY: 'auto' |
| | | }"> |
| | | <view class="list" v-for="(item,index) in showList" :key="index" v-if="tabs==0"> |
| | | <uni-card :title="item.单据号" style="margin: 10px;"> |
| | | <view class="card-detail"> |
| | | <template v-for="(field, index) in CommonUtils.emptyValueFilter(item, HFieldList)"> |
| | | <view v-if="field.ColmType == 'DateTime'" class="detail"> |
| | | <text>{{field.ColmCols}}:</text>{{dayjs(item[field.ColmCols]).format("YYYY-MM-DD HH:mm:ss")}} |
| | | </view> |
| | | <view v-else class="detail"> |
| | | <text>{{field.ColmCols}}:</text>{{item[field.ColmCols]}} |
| | | </view> |
| | | </template> |
| | | </view> |
| | | </uni-card> |
| | | </view> |
| | | </view> |
| | | <view class="pagination-zone" id="pagination-zone"> |
| | | <uni-pagination show-icon :page-size="size" :total="dataLength" :current="page" |
| | | @change="onPaginationChangeHandler"></uni-pagination> |
| | | </view> |
| | | <BarCodePopupVue ref="barcodePopup"></BarCodePopupVue> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getUserInfo |
| | | } from "@/utils/auth.js"; |
| | | import BarCodePopupVue from "@/components/BarCodePopup/BarCodePopup.vue"; |
| | | import { |
| | | CommonUtils |
| | | } from "../../../utils/common"; |
| | | import dayjs from "dayjs"; |
| | | export default { |
| | | data() { |
| | | return { |
| | | dayjs, |
| | | CommonUtils, |
| | | userInfo: getUserInfo(), |
| | | serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API', |
| | | tabs: 0, |
| | | urls: '/Sc_HEquipStateDistribution/Get_EquipICMOTechParamList_Json', |
| | | MvarReportTitle: '设备工艺', |
| | | hform: { |
| | | HInterID: 0, |
| | | HICMOInterID: 0, |
| | | HICMOEntryID: 0, |
| | | HBillNo: '', |
| | | HSourceBillNo: '', |
| | | user: uni.getStorageSync('HUserName'), |
| | | HStockOrgID: uni.getStorageSync('OrganizationID'), |
| | | operationType: "4", |
| | | sWhere: "", |
| | | }, |
| | | sWhere: '', |
| | | listData: [], |
| | | showList: [], |
| | | HFieldList: [], // 字段列表 |
| | | showDetail: -1, |
| | | operations: -1, |
| | | |
| | | page: 1, |
| | | size: 20, |
| | | dataLength: 0, |
| | | divideBottom: 0, |
| | | paginationTop: 0, |
| | | showmore: false, |
| | | } |
| | | }, |
| | | computed: { |
| | | calcContentHeight: { |
| | | get() { |
| | | return this.paginationTop - this.divideBottom |
| | | } |
| | | } |
| | | }, |
| | | onShow() { |
| | | //用户模块权限判断 |
| | | this.changeTab(0) |
| | | console.log(this.userInfo, uni.getStorageSync('HUserName')) |
| | | }, |
| | | components: { |
| | | BarCodePopupVue |
| | | }, |
| | | onReady() { |
| | | this.getCalcHeight() |
| | | }, |
| | | methods: { |
| | | changeShowMore() { |
| | | this.showmore = !this.showmore |
| | | this.$nextTick(() => { |
| | | // 重新计算内容视口高度 |
| | | this.getCalcHeight() |
| | | }) |
| | | }, |
| | | getCalcHeight() { |
| | | let query = uni.createSelectorQuery().in(this) |
| | | query |
| | | .select("#divide") |
| | | .boundingClientRect() |
| | | .select("#pagination-zone") |
| | | .boundingClientRect() |
| | | .exec(res => { |
| | | this.divideBottom = Math.ceil(res[0].bottom) |
| | | this.paginationTop = Math.floor(res[1].top) |
| | | }) |
| | | }, |
| | | async qrCodeDisplay(item) { |
| | | this.$refs.barcodePopup.setCodeInfo(item.HBillNo) |
| | | await this.$nextTick() |
| | | this.$refs.barcodePopup.open() |
| | | }, |
| | | onPaginationChangeHandler({ |
| | | current |
| | | }) { |
| | | this.page = current |
| | | this.showList = this.getPage(current, this.size, this.listData) |
| | | }, |
| | | getPage(page, size, list) { |
| | | let sindex = (parseInt(page) - 1) * size |
| | | let eindex = parseInt(page) * size |
| | | let newList = list.slice(sindex, eindex) |
| | | return newList |
| | | }, |
| | | changeTab(e) { |
| | | this.tabs = e |
| | | this.page = 1 |
| | | this.showList = [] |
| | | |
| | | if (this.tabs == 0) { |
| | | this.urls = '/Sc_HEquipStateDistribution/Get_EquipICMOTechParamList_Json' |
| | | } |
| | | // if (this.tabs == 1) { |
| | | // this.urls = '/WEBSController/GetKf_ICStockBillQueryList_User_Json' |
| | | // } |
| | | this.search() |
| | | }, |
| | | async getList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: this.urls, |
| | | data: this.hform |
| | | }) |
| | | |
| | | let { |
| | | count, |
| | | data, |
| | | Message, |
| | | list |
| | | } = res.data |
| | | |
| | | if (count == 1) { |
| | | if (data == null) { |
| | | data = [] |
| | | } |
| | | this.listData = data |
| | | console.log('data: ', data); |
| | | this.showList = this.getPage(this.page, this.size, data) |
| | | this.dataLength = data.length |
| | | this.HFieldList = CommonUtils.fieldListFilterRole({ |
| | | FieldList: list, |
| | | ExcludeKeys: ["单据号"] |
| | | }).data |
| | | |
| | | console.log('this.HFieldList: ', this.HFieldList); |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `获取设备履历失败: ${Message}` |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `获取设备履历失败: ${err}` |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | search() { |
| | | this.hform.sWhere = '' |
| | | this.listData = [] |
| | | this.page = 1 |
| | | this.showList = [] |
| | | |
| | | this.hform.sWhere = { |
| | | HEquipID: this.hform.HInterID, |
| | | HICMOInterID: this.hform.HICMOInterID, |
| | | HICMOEntryID: this.hform.HICMOEntryID, |
| | | } |
| | | |
| | | this.getList() |
| | | }, |
| | | }, |
| | | onLoad(e) { |
| | | let { |
| | | operationType, |
| | | HEquipID, |
| | | HICMOInterID, |
| | | HICMOEntryID |
| | | } = e |
| | | |
| | | if (operationType == 4) { |
| | | this.HInterID = HEquipID |
| | | this.HICMOInterID = HICMOInterID |
| | | this.HICMOEntryID = HICMOEntryID |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/pages/MJGL/style/MJListStyle.scss" |
| | | </style> |
| New file |
| | |
| | | <template> |
| | | <view class="content"> |
| | | <view id="divide" style="width: 100%;height: 0rpx;background-color: #e5e5e5;"></view> |
| | | <view :style="{ |
| | | height: calcContentHeight + 'px', |
| | | overflowY: 'auto' |
| | | }"> |
| | | <view class="list" v-for="(item,index) in showList" :key="index" v-if="tabs==0"> |
| | | <uni-card :title="item.检查项目" style="margin: 10px;"> |
| | | <view class="card-detail"> |
| | | <view class="detail" style="width: 25%; justify-content: left;" v-for="(field, index) in HFieldList" :key="index"> |
| | | <text>{{field.ColmCols}}:</text>{{item[field.ColmCols]}} |
| | | </view> |
| | | </view> |
| | | </uni-card> |
| | | </view> |
| | | </view> |
| | | <view class="pagination-zone" id="pagination-zone"> |
| | | <uni-pagination show-icon :page-size="size" :total="dataLength" :current="page" |
| | | @change="onPaginationChangeHandler"></uni-pagination> |
| | | </view> |
| | | <BarCodePopupVue ref="barcodePopup"></BarCodePopupVue> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getUserInfo |
| | | } from "@/utils/auth.js"; |
| | | import BarCodePopupVue from "@/components/BarCodePopup/BarCodePopup.vue"; |
| | | import { |
| | | CommonUtils |
| | | } from "../../../utils/common"; |
| | | import dayjs from "dayjs"; |
| | | export default { |
| | | data() { |
| | | return { |
| | | dayjs, |
| | | userInfo: getUserInfo(), |
| | | serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API', |
| | | tabs: 0, |
| | | urls: '/Sc_WorkBeginDotCheckBill/getSc_WorkDotCheckList_Day', |
| | | MvarReportTitle: '设备月点检记录', |
| | | hform: { |
| | | HInterId: 0, |
| | | HBillNo: '', |
| | | HSourceBillNo: '', |
| | | user: uni.getStorageSync('HUserName'), |
| | | HStockOrgID: uni.getStorageSync('OrganizationID'), |
| | | Type: "设备", |
| | | sWhere: "", |
| | | }, |
| | | sWhere: '', |
| | | listData: [], |
| | | showList: [], |
| | | HFieldList: [], // 字段列表 |
| | | showDetail: -1, |
| | | operations: -1, |
| | | |
| | | page: 1, |
| | | size: 20, |
| | | dataLength: 0, |
| | | divideBottom: 0, |
| | | paginationTop: 0, |
| | | showmore: false, |
| | | } |
| | | }, |
| | | computed: { |
| | | calcContentHeight: { |
| | | get() { |
| | | return this.paginationTop - this.divideBottom |
| | | } |
| | | } |
| | | }, |
| | | onShow() { |
| | | //用户模块权限判断 |
| | | this.changeTab(0) |
| | | console.log(this.userInfo, uni.getStorageSync('HUserName')) |
| | | }, |
| | | components: { |
| | | BarCodePopupVue |
| | | }, |
| | | onReady() { |
| | | this.getCalcHeight() |
| | | }, |
| | | methods: { |
| | | changeShowMore() { |
| | | this.showmore = !this.showmore |
| | | this.$nextTick(() => { |
| | | // 重新计算内容视口高度 |
| | | this.getCalcHeight() |
| | | }) |
| | | }, |
| | | getCalcHeight() { |
| | | let query = uni.createSelectorQuery().in(this) |
| | | query |
| | | .select("#divide") |
| | | .boundingClientRect() |
| | | .select("#pagination-zone") |
| | | .boundingClientRect() |
| | | .exec(res => { |
| | | this.divideBottom = Math.ceil(res[0].bottom) |
| | | this.paginationTop = Math.floor(res[1].top) |
| | | }) |
| | | }, |
| | | async qrCodeDisplay(item) { |
| | | this.$refs.barcodePopup.setCodeInfo(item.HBillNo) |
| | | await this.$nextTick() |
| | | this.$refs.barcodePopup.open() |
| | | }, |
| | | onPaginationChangeHandler({ |
| | | current |
| | | }) { |
| | | this.page = current |
| | | this.showList = this.getPage(current, this.size, this.listData) |
| | | }, |
| | | getPage(page, size, list) { |
| | | let sindex = (parseInt(page) - 1) * size |
| | | let eindex = parseInt(page) * size |
| | | let newList = list.slice(sindex, eindex) |
| | | return newList |
| | | }, |
| | | changeTab(e) { |
| | | this.tabs = e |
| | | this.page = 1 |
| | | this.showList = [] |
| | | |
| | | if (this.tabs == 0) { |
| | | this.urls = '/Sc_WorkBeginDotCheckBill/getSc_WorkDotCheckList_Day' |
| | | } |
| | | // if (this.tabs == 1) { |
| | | // this.urls = '/WEBSController/GetKf_ICStockBillQueryList_User_Json' |
| | | // } |
| | | this.search() |
| | | }, |
| | | async getList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: this.urls, |
| | | data: this.hform |
| | | }) |
| | | |
| | | let { |
| | | count, |
| | | data, |
| | | Message, |
| | | list |
| | | } = res.data |
| | | |
| | | if (count == 1) { |
| | | if (data == null) { |
| | | data = [] |
| | | } |
| | | this.listData = data |
| | | console.log('data: ', data); |
| | | this.showList = this.getPage(this.page, this.size, data) |
| | | this.dataLength = data.length |
| | | this.HFieldList = CommonUtils.fieldListFilterRole({ |
| | | FieldList: list, |
| | | ExcludeKeys: ["检查项目"] |
| | | }).data |
| | | |
| | | console.log('this.HFieldList: ',this.HFieldList); |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `获取点检记录失败: ${Message}` |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `获取点检记录失败: ${err}` |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | search() { |
| | | this.hform.sWhere = '' |
| | | this.listData = [] |
| | | this.page = 1 |
| | | this.showList = [] |
| | | |
| | | this.hform.sWhere = { |
| | | Type: this.hform.Type, |
| | | HInterId: this.hform.HInterId |
| | | } |
| | | |
| | | this.getList() |
| | | }, |
| | | }, |
| | | onLoad(e) { |
| | | let {operationType, HEquipID} = e |
| | | |
| | | this.hform.Type = operationType |
| | | this.hform.HInterId = HEquipID |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/pages/MJGL/style/MJListStyle.scss" |
| | | </style> |
| | |
| | | "id": 27, |
| | | "hidden": false |
| | | }, |
| | | { |
| | | "img": "../../static/icon/icon8.png", |
| | | "text": "设备状态查询", |
| | | "url": "/pages/shebeiyunxingzhuangtai/shebeiyunxingzhuangtai", |
| | | "id": 28, |
| | | "hidden": false |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | |
| | | <template> |
| | | <view class="content"> |
| | | <view class="form"> |
| | | <view class="form-item"> |
| | | <view class="title">单据号:</view> |
| | | <view class="right"> |
| | | <input v-model="hform.HBillNo" placeholder="请输入单据号" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">设备分类:</view> |
| | | <view class="right"> |
| | | <input v-model="hform.HEquipType" placeholder="请输入设备分类" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">开始时间:</view> |
| | | <view class="right"> |
| | | <picker mode="date" :value="hform.BenginHCreateDate" @change="BenginHCreateDateChange"> |
| | | <input name="BenginHCreateDate" disabled :value="hform.BenginHCreateDate" placeholder="请选择" /> |
| | | </picker> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">结束时间:</view> |
| | | <view class="right"> |
| | | <picker mode="date" :value="hform.EndHCreateDate" @change="EndHCreateDateChange"> |
| | | <input name="EndHCreateDate" disabled :value="hform.EndHCreateDate" placeholder="请选择" /> |
| | | </picker> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="buttons"> |
| | | <button class="btn-a" size="mini" type="default" @tap="clear">重置</button> |
| | | <!-- <button class="btn-b" size="mini" type="default">新增</button> --> |
| | | <button class="btn-c" size="mini" type="default" @tap="search">查询</button> |
| | | </view> |
| | | </view> |
| | | |
| | | <view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view> |
| | | |
| | | <view class="list" v-for="(item,index) in showList" :key="index"> |
| | | <uni-card :title="item.设备名称" :extra="item.单据号" style="margin: 10px;" @tap="showDetail = showDetail==index?-1:index"> |
| | | <view class="card-detail"> |
| | | <view class="detail" v-if="item.设备代码"> |
| | | <text>设备代码:</text>{{item.设备代码}} |
| | | </view> |
| | | <view class="detail" v-if="item.设备出厂日期"> |
| | | <text>出厂日期:</text>{{item.设备出厂日期.substr(0,10)}} |
| | | </view> |
| | | <view class="detail" v-if="item.设备型号"> |
| | | <text>设备型号:</text>{{item.设备型号}} |
| | | </view> |
| | | <view class="detail" v-if="item.设备类型"> |
| | | <text>设备类型:</text>{{item.设备类型}} |
| | | </view> |
| | | <view class="detail" v-if="item.设备编码"> |
| | | <text>设备编码:</text>{{item.设备编码}} |
| | | </view> |
| | | <view class="detail" v-if="item.设备规格"> |
| | | <text>设备规格:</text>{{item.设备规格}} |
| | | </view> |
| | | <view class="detail" v-if="item.当前状态"> |
| | | <text>当前状态:</text>{{item.当前状态}} |
| | | </view> |
| | | <view class="detail" v-if="item.日期"> |
| | | <text>日期:</text>{{item.日期.substr(0,10)}} |
| | | </view> |
| | | </view> |
| | | <view class="card-detail" v-if="showDetail == index"> |
| | | <!-- <view class="detail" v-if="item.hmainid"> |
| | | <view class="content"> |
| | | <view class="form"> |
| | | <view class="form-item"> |
| | | <view class="title">单据号:</view> |
| | | <view class="right"> |
| | | <input v-model="hform.HBillNo" placeholder="请输入单据号" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">设备分类:</view> |
| | | <view class="right"> |
| | | <input v-model="hform.HEquipType" placeholder="请输入设备分类" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">开始时间:</view> |
| | | <view class="right"> |
| | | <picker mode="date" :value="hform.BenginHCreateDate" @change="BenginHCreateDateChange"> |
| | | <input name="BenginHCreateDate" disabled :value="hform.BenginHCreateDate" placeholder="请选择" /> |
| | | </picker> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">结束时间:</view> |
| | | <view class="right"> |
| | | <picker mode="date" :value="hform.EndHCreateDate" @change="EndHCreateDateChange"> |
| | | <input name="EndHCreateDate" disabled :value="hform.EndHCreateDate" placeholder="请选择" /> |
| | | </picker> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="buttons"> |
| | | <button class="btn-a" size="mini" type="default" @tap="clear">重置</button> |
| | | <!-- <button class="btn-b" size="mini" type="default">新增</button> --> |
| | | <button class="btn-c" size="mini" type="default" @tap="search">查询</button> |
| | | </view> |
| | | </view> |
| | | |
| | | <view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view> |
| | | |
| | | <view class="list" v-for="(item,index) in showList" :key="index"> |
| | | <uni-card :title="item.设备名称" :extra="item.单据号" style="margin: 10px;" |
| | | @tap="showDetail = showDetail==index?-1:index"> |
| | | <view class="card-detail"> |
| | | <view class="detail" v-if="item.设备代码"> |
| | | <text>设备代码:</text>{{item.设备代码}} |
| | | </view> |
| | | <view class="detail" v-if="item.设备出厂日期"> |
| | | <text>出厂日期:</text>{{item.设备出厂日期.substr(0,10)}} |
| | | </view> |
| | | <view class="detail" v-if="item.设备型号"> |
| | | <text>设备型号:</text>{{item.设备型号}} |
| | | </view> |
| | | <view class="detail" v-if="item.设备类型"> |
| | | <text>设备类型:</text>{{item.设备类型}} |
| | | </view> |
| | | <view class="detail" v-if="item.设备编码"> |
| | | <text>设备编码:</text>{{item.设备编码}} |
| | | </view> |
| | | <view class="detail" v-if="item.设备规格"> |
| | | <text>设备规格:</text>{{item.设备规格}} |
| | | </view> |
| | | <view class="detail" v-if="item.当前状态"> |
| | | <text>当前状态:</text>{{item.当前状态}} |
| | | </view> |
| | | <view class="detail" v-if="item.日期"> |
| | | <text>日期:</text>{{item.日期.substr(0,10)}} |
| | | </view> |
| | | </view> |
| | | <view class="card-detail" v-if="showDetail == index"> |
| | | <!-- <view class="detail" v-if="item.hmainid"> |
| | | <text>hmainid:</text>{{item.hmainid}} |
| | | </view> --> |
| | | <view class="detail" v-if="item.条形码"> |
| | | <text>条码编号:</text>{{item.条形码}} |
| | | </view> |
| | | <!-- <view class="detail" v-if="item.HMaterID"> |
| | | <view class="detail" v-if="item.条形码"> |
| | | <text>条码编号:</text>{{item.条形码}} |
| | | </view> |
| | | <!-- <view class="detail" v-if="item.HMaterID"> |
| | | <text>HMaterID:</text>{{item.HMaterID}} |
| | | </view> --> |
| | | <view class="detail" v-if="item.物料名称"> |
| | | <text>物料名称:</text>{{item.物料名称}} |
| | | </view> |
| | | <!-- <view class="detail" v-if="item.HUnitID"> |
| | | <view class="detail" v-if="item.物料名称"> |
| | | <text>物料名称:</text>{{item.物料名称}} |
| | | </view> |
| | | <!-- <view class="detail" v-if="item.HUnitID"> |
| | | <text>HUnitID:</text>{{item.HUnitID}} |
| | | </view> --> |
| | | <view class="detail" v-if="item.单位"> |
| | | <text>单位:</text>{{item.单位}} |
| | | </view> |
| | | <!-- <view class="detail" v-if="item.HDeptID"> |
| | | <view class="detail" v-if="item.单位"> |
| | | <text>单位:</text>{{item.单位}} |
| | | </view> |
| | | <!-- <view class="detail" v-if="item.HDeptID"> |
| | | <text>HDeptID:</text>{{item.HDeptID}} |
| | | </view> --> |
| | | <view class="detail" v-if="item.使用部门"> |
| | | <text>使用部门:</text>{{item.使用部门}} |
| | | </view> |
| | | <view class="detail" v-if="item.HUseEmpID"> |
| | | <text>HUseEmpID:</text>{{item.HUseEmpID}} |
| | | </view> |
| | | <view class="detail" v-if="item.使用负责人"> |
| | | <text>使用负责人:</text>{{item.使用负责人}} |
| | | </view> |
| | | <!-- <view class="detail" v-if="item.HRepairEmpID"> |
| | | <view class="detail" v-if="item.使用部门"> |
| | | <text>使用部门:</text>{{item.使用部门}} |
| | | </view> |
| | | <view class="detail" v-if="item.HUseEmpID"> |
| | | <text>HUseEmpID:</text>{{item.HUseEmpID}} |
| | | </view> |
| | | <view class="detail" v-if="item.使用负责人"> |
| | | <text>使用负责人:</text>{{item.使用负责人}} |
| | | </view> |
| | | <!-- <view class="detail" v-if="item.HRepairEmpID"> |
| | | <text>HRepairEmpID:</text>{{item.HRepairEmpID}} |
| | | </view> --> |
| | | <view class="detail" v-if="item.维护负责人"> |
| | | <text>维护负责人:</text>{{item.维护负责人}} |
| | | </view> |
| | | <view class="detail" v-if="item.安装地点"> |
| | | <text>安装地点:</text>{{item.安装地点}} |
| | | </view> |
| | | <view class="detail" v-if="item.安装日期"> |
| | | <text>安装日期:</text>{{item.安装日期.substr(0,10)}} |
| | | </view> |
| | | <view class="detail" v-if="item.运行开始日期"> |
| | | <text>运行开始日期:</text>{{item.运行开始日期.substr(0,10)}} |
| | | </view> |
| | | <!-- <view class="detail" v-if="item.HEquipFileTypeID"> |
| | | <view class="detail" v-if="item.维护负责人"> |
| | | <text>维护负责人:</text>{{item.维护负责人}} |
| | | </view> |
| | | <view class="detail" v-if="item.安装地点"> |
| | | <text>安装地点:</text>{{item.安装地点}} |
| | | </view> |
| | | <view class="detail" v-if="item.安装日期"> |
| | | <text>安装日期:</text>{{item.安装日期.substr(0,10)}} |
| | | </view> |
| | | <view class="detail" v-if="item.运行开始日期"> |
| | | <text>运行开始日期:</text>{{item.运行开始日期.substr(0,10)}} |
| | | </view> |
| | | <!-- <view class="detail" v-if="item.HEquipFileTypeID"> |
| | | <text>HEquipFileTypeID:</text>{{item.HEquipFileTypeID}} |
| | | </view> --> |
| | | <view class="detail" v-if="item.工程编码"> |
| | | <text>工程编码:</text>{{item.工程编码}} |
| | | </view> |
| | | <view class="detail" v-if="item.产品"> |
| | | <text>产品:</text>{{item.产品}} |
| | | </view> |
| | | <view class="detail" v-if="item.品牌"> |
| | | <text>品牌:</text>{{item.品牌}} |
| | | </view> |
| | | <!-- <view class="detail" v-if="item.HSellSupID"> |
| | | <view class="detail" v-if="item.工程编码"> |
| | | <text>工程编码:</text>{{item.工程编码}} |
| | | </view> |
| | | <view class="detail" v-if="item.产品"> |
| | | <text>产品:</text>{{item.产品}} |
| | | </view> |
| | | <view class="detail" v-if="item.品牌"> |
| | | <text>品牌:</text>{{item.品牌}} |
| | | </view> |
| | | <!-- <view class="detail" v-if="item.HSellSupID"> |
| | | <text>HSellSupID:</text>{{item.HSellSupID}} |
| | | </view> --> |
| | | <view class="detail" v-if="item.供应商"> |
| | | <text>供应商:</text>{{item.供应商}} |
| | | </view> |
| | | <!-- <view class="detail" v-if="item.HMakeSupID"> |
| | | <view class="detail" v-if="item.供应商"> |
| | | <text>供应商:</text>{{item.供应商}} |
| | | </view> |
| | | <!-- <view class="detail" v-if="item.HMakeSupID"> |
| | | <text>HMakeSupID:</text>{{item.HMakeSupID}} |
| | | </view> --> |
| | | <view class="detail" v-if="item.制造商"> |
| | | <text>制造商:</text>{{item.制造商}} |
| | | </view> |
| | | <view class="detail" v-if="item.制单人"> |
| | | <text>制单人:</text>{{item.制单人}} |
| | | </view> |
| | | <view class="detail" v-if="item.制单日期"> |
| | | <text>制单日期:</text>{{item.制单日期.substr(0,10)}} |
| | | </view> |
| | | <view class="detail" v-if="item.审核人"> |
| | | <text>审核人:</text>{{item.审核人}} |
| | | </view> |
| | | <view class="detail" v-if="item.审核日期"> |
| | | <text>审核日期:</text>{{item.审核日期.substr(0,10)}} |
| | | </view> |
| | | <view class="detail" v-if="item.修改人"> |
| | | <text>修改人:</text>{{item.修改人}} |
| | | </view> |
| | | <view class="detail" v-if="item.修改日期"> |
| | | <text>修改日期:</text>{{item.修改日期.substr(0,10)}} |
| | | </view> |
| | | <view class="detail" v-if="item.关闭人"> |
| | | <text>关闭人:</text>{{item.关闭人}} |
| | | </view> |
| | | <view class="detail" v-if="item.关闭日期"> |
| | | <text>关闭日期:</text>{{item.关闭日期.substr(0,10)}} |
| | | </view> |
| | | <!-- <view class="detail" v-if="item.hbilltype"> |
| | | <view class="detail" v-if="item.制造商"> |
| | | <text>制造商:</text>{{item.制造商}} |
| | | </view> |
| | | <view class="detail" v-if="item.制单人"> |
| | | <text>制单人:</text>{{item.制单人}} |
| | | </view> |
| | | <view class="detail" v-if="item.制单日期"> |
| | | <text>制单日期:</text>{{item.制单日期.substr(0,10)}} |
| | | </view> |
| | | <view class="detail" v-if="item.审核人"> |
| | | <text>审核人:</text>{{item.审核人}} |
| | | </view> |
| | | <view class="detail" v-if="item.审核日期"> |
| | | <text>审核日期:</text>{{item.审核日期.substr(0,10)}} |
| | | </view> |
| | | <view class="detail" v-if="item.修改人"> |
| | | <text>修改人:</text>{{item.修改人}} |
| | | </view> |
| | | <view class="detail" v-if="item.修改日期"> |
| | | <text>修改日期:</text>{{item.修改日期.substr(0,10)}} |
| | | </view> |
| | | <view class="detail" v-if="item.关闭人"> |
| | | <text>关闭人:</text>{{item.关闭人}} |
| | | </view> |
| | | <view class="detail" v-if="item.关闭日期"> |
| | | <text>关闭日期:</text>{{item.关闭日期.substr(0,10)}} |
| | | </view> |
| | | <!-- <view class="detail" v-if="item.hbilltype"> |
| | | <text>hbilltype:</text>{{item.hbilltype}} |
| | | </view> --> |
| | | <view class="detail" v-if="item.单据类型"> |
| | | <text>单据类型:</text>{{item.单据类型}} |
| | | </view> |
| | | <!-- <view class="detail" v-if="item.HMoudType"> |
| | | <view class="detail" v-if="item.单据类型"> |
| | | <text>单据类型:</text>{{item.单据类型}} |
| | | </view> |
| | | <!-- <view class="detail" v-if="item.HMoudType"> |
| | | <text>HMoudType:</text>{{item.HMoudType}} |
| | | </view> |
| | | <view class="detail" v-if="item.hsubid"> |
| | | <text>hsubid:</text>{{item.hsubid}} |
| | | </view> --> |
| | | </view> |
| | | |
| | | <view class="more" v-if="showDetail == index"> |
| | | <view class="part" style="border-right: 1px solid #eee;"> |
| | | <uni-icons type="top" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>收起 |
| | | </view> |
| | | <view class="part" @tap.stop="toSon(item)"> |
| | | <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>查看子表 |
| | | </view> |
| | | </view> |
| | | <view class="more" v-if="showDetail != index"> |
| | | <view class="part" style="border-right: 1px solid #eee;"> |
| | | <uni-icons type="bottom" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>更多信息 |
| | | </view> |
| | | <view class="part" @tap.stop="toSon(item)"> |
| | | <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>查看子表 |
| | | </view> |
| | | </view> |
| | | </uni-card> |
| | | </view> |
| | | |
| | | <view class="over" v-if="listData.length == 0">暂无数据</view> |
| | | <view class="over" v-if="listData.length != 0 && listData.length != showList.length">加载中...</view> |
| | | <view class="over" v-if="listData.length != 0 && listData.length == showList.length">已到底</view> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="more" v-if="showDetail == index"> |
| | | <view class="part" style="border-right: 1px solid #eee;"> |
| | | <uni-icons type="top" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>收起 |
| | | </view> |
| | | <view class="part" @tap.stop="toSon(item)"> |
| | | <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;" |
| | | size="14"></uni-icons>查看子表 |
| | | </view> |
| | | </view> |
| | | <view class="more" v-if="showDetail != index"> |
| | | <view class="part" style="border-right: 1px solid #eee;"> |
| | | <uni-icons type="bottom" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>更多信息 |
| | | </view> |
| | | <view class="part" @tap.stop="toSon(item)"> |
| | | <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;" |
| | | size="14"></uni-icons>查看子表 |
| | | </view> |
| | | </view> |
| | | </uni-card> |
| | | </view> |
| | | |
| | | <view class="over" v-if="listData.length == 0">暂无数据</view> |
| | | <view class="over" v-if="listData.length != 0 && listData.length != showList.length">加载中...</view> |
| | | <view class="over" v-if="listData.length != 0 && listData.length == showList.length">已到底</view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getUserInfo } from "@/utils/auth.js"; |
| | | export default { |
| | | data() { |
| | | return { |
| | | userInfo:getUserInfo(), |
| | | serverUrl: uni.getStorageSync('serverUrl')||'http://47.96.97.237/API', |
| | | hform:{ |
| | | HBillNo:'', |
| | | HEquipType:'', |
| | | BenginHCreateDate:'', |
| | | EndHCreateDate:'', |
| | | }, |
| | | sWhere:'', |
| | | listData:[], |
| | | showList:[], |
| | | showDetail:-1, |
| | | |
| | | page:1, |
| | | } |
| | | }, |
| | | onLoad() { |
| | | this.getList() |
| | | console.log(this.userInfo,uni.getStorageSync('HUserName')) |
| | | }, |
| | | onReachBottom: function() { |
| | | this.page++ |
| | | setTimeout(() => { |
| | | this.showList = this.showList.concat(this.getPage(this.page,this.listData)) |
| | | }, 100) |
| | | }, |
| | | onPullDownRefresh: function() { |
| | | this.clear() |
| | | setTimeout(()=>{ |
| | | uni.stopPullDownRefresh(); |
| | | }, 1000); |
| | | }, |
| | | methods: { |
| | | getPage(page,list){ |
| | | let sindex = (parseInt(page) - 1) * 20 |
| | | let eindex = parseInt(page) * 20 |
| | | let newList = list.slice(sindex,eindex) |
| | | return newList |
| | | }, |
| | | getList(){ |
| | | console.log(this.sWhere) |
| | | uni.showLoading({ |
| | | title:'加载中...' |
| | | }) |
| | | uni.request({ |
| | | url: this.serverUrl + '/Gy_EquipFileMain/GetList', |
| | | data:{ |
| | | sWhere: this.sWhere, |
| | | user: uni.getStorageSync('HUserName') |
| | | }, |
| | | success: (res) => { |
| | | console.log(1,res); |
| | | if(res.data.count == 1){ |
| | | this.listData = res.data.data |
| | | this.showList = this.getPage(this.page,this.listData) |
| | | setTimeout(()=>{ |
| | | uni.hideLoading() |
| | | }, 1000) |
| | | }else{ |
| | | uni.hideLoading() |
| | | uni.showToast({ |
| | | title:res.data.Message, |
| | | icon:'none' |
| | | }) |
| | | } |
| | | }, |
| | | fail: (res) => { |
| | | console.log(res); |
| | | uni.hideLoading() |
| | | uni.showToast({ |
| | | title:'接口请求失败', |
| | | icon:'none' |
| | | }) |
| | | }, |
| | | }); |
| | | |
| | | // uni.request({ |
| | | // url: this.serverUrl + '/Gy_EquipFileMain/Sb_EquipFileBillResumeDate', |
| | | // data: { "HInterID": 2 }, |
| | | // success: (res) => { |
| | | // console.log(2,res); |
| | | |
| | | // } |
| | | // }); |
| | | }, |
| | | //选择单据日期 |
| | | BenginHCreateDateChange(e){ |
| | | console.log(e.detail.value) |
| | | this.hform.BenginHCreateDate = e.detail.value |
| | | }, |
| | | //选择单据日期 |
| | | EndHCreateDateChange(e){ |
| | | console.log(e.detail.value) |
| | | this.hform.EndHCreateDate = e.detail.value |
| | | }, |
| | | search(){ |
| | | this.sWhere = '' |
| | | this.listData = [] |
| | | this.page = 1 |
| | | this.showList = [] |
| | | |
| | | console.log(this.hform) |
| | | if (this.hform.HBillNo) { |
| | | this.sWhere += " and 单据号 like '%" + this.hform.HBillNo + "%'"; |
| | | } |
| | | if (this.hform.HEquipType) { |
| | | this.sWhere += " and 设备类型 like '%" + this.hform.HEquipType + "%'"; |
| | | } |
| | | if (this.hform.BenginHCreateDate) { |
| | | this.sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + this.hform.BenginHCreateDate + "'"; |
| | | } |
| | | if (this.hform.EndHCreateDate) { |
| | | this.sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + this.hform.EndHCreateDate + "'"; |
| | | } |
| | | |
| | | this.getList() |
| | | }, |
| | | clear(){ |
| | | this.listData = [] |
| | | this.page = 1 |
| | | this.showList = [] |
| | | |
| | | this.sWhere = '' |
| | | this.hform = { |
| | | HBillNo:'', |
| | | HEquipType:'', |
| | | BenginHCreateDate:'', |
| | | EndHCreateDate:'', |
| | | } |
| | | this.getList() |
| | | }, |
| | | toSon(item){ |
| | | uni.navigateTo({ |
| | | url:'/pages/shebeilvli/EquipFileBillResume_son?HInterID=' + item.hmainid |
| | | + '&设备名称=' + item.设备名称 |
| | | + '&设备代码=' + item.设备代码 |
| | | + '&设备出厂日期=' + item.设备出厂日期 |
| | | + '&设备出厂编号=' + item.设备出厂编号 |
| | | + '&设备型号=' + item.设备型号 |
| | | + '&设备类型=' + item.设备类型 |
| | | + '&设备编码=' + item.设备编码 |
| | | + '&设备规格=' + item.设备规格, |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | import { |
| | | getUserInfo |
| | | } from "@/utils/auth.js"; |
| | | export default { |
| | | data() { |
| | | return { |
| | | userInfo: getUserInfo(), |
| | | serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API', |
| | | hform: { |
| | | HBillNo: '', |
| | | HEquipType: '', |
| | | BenginHCreateDate: '', |
| | | EndHCreateDate: '', |
| | | }, |
| | | sWhere: '', |
| | | listData: [], |
| | | showList: [], |
| | | showDetail: -1, |
| | | |
| | | page: 1, |
| | | } |
| | | }, |
| | | onLoad(e) { |
| | | this.getList() |
| | | console.log(this.userInfo, uni.getStorageSync('HUserName')) |
| | | }, |
| | | onReachBottom: function() { |
| | | this.page++ |
| | | setTimeout(() => { |
| | | this.showList = this.showList.concat(this.getPage(this.page, this.listData)) |
| | | }, 100) |
| | | }, |
| | | onPullDownRefresh: function() { |
| | | this.clear() |
| | | setTimeout(() => { |
| | | uni.stopPullDownRefresh(); |
| | | }, 1000); |
| | | }, |
| | | methods: { |
| | | getPage(page, list) { |
| | | let sindex = (parseInt(page) - 1) * 20 |
| | | let eindex = parseInt(page) * 20 |
| | | let newList = list.slice(sindex, eindex) |
| | | return newList |
| | | }, |
| | | getList() { |
| | | console.log(this.sWhere) |
| | | uni.showLoading({ |
| | | title: '加载中...' |
| | | }) |
| | | uni.request({ |
| | | url: this.serverUrl + '/Gy_EquipFileMain/GetList', |
| | | data: { |
| | | sWhere: this.sWhere, |
| | | user: uni.getStorageSync('HUserName') |
| | | }, |
| | | success: (res) => { |
| | | console.log(1, res); |
| | | if (res.data.count == 1) { |
| | | this.listData = res.data.data |
| | | this.showList = this.getPage(this.page, this.listData) |
| | | setTimeout(() => { |
| | | uni.hideLoading() |
| | | }, 1000) |
| | | } else { |
| | | uni.hideLoading() |
| | | uni.showToast({ |
| | | title: res.data.Message, |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | }, |
| | | fail: (res) => { |
| | | console.log(res); |
| | | uni.hideLoading() |
| | | uni.showToast({ |
| | | title: '接口请求失败', |
| | | icon: 'none' |
| | | }) |
| | | }, |
| | | }); |
| | | |
| | | // uni.request({ |
| | | // url: this.serverUrl + '/Gy_EquipFileMain/Sb_EquipFileBillResumeDate', |
| | | // data: { "HInterID": 2 }, |
| | | // success: (res) => { |
| | | // console.log(2,res); |
| | | |
| | | // } |
| | | // }); |
| | | }, |
| | | //选择单据日期 |
| | | BenginHCreateDateChange(e) { |
| | | console.log(e.detail.value) |
| | | this.hform.BenginHCreateDate = e.detail.value |
| | | }, |
| | | //选择单据日期 |
| | | EndHCreateDateChange(e) { |
| | | console.log(e.detail.value) |
| | | this.hform.EndHCreateDate = e.detail.value |
| | | }, |
| | | search() { |
| | | this.sWhere = '' |
| | | this.listData = [] |
| | | this.page = 1 |
| | | this.showList = [] |
| | | |
| | | console.log(this.hform) |
| | | if (this.hform.HBillNo) { |
| | | this.sWhere += " and 单据号 like '%" + this.hform.HBillNo + "%'"; |
| | | } |
| | | if (this.hform.HEquipType) { |
| | | this.sWhere += " and 设备类型 like '%" + this.hform.HEquipType + "%'"; |
| | | } |
| | | if (this.hform.BenginHCreateDate) { |
| | | this.sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + this.hform.BenginHCreateDate + "'"; |
| | | } |
| | | if (this.hform.EndHCreateDate) { |
| | | this.sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + this.hform.EndHCreateDate + "'"; |
| | | } |
| | | |
| | | this.getList() |
| | | }, |
| | | clear() { |
| | | this.listData = [] |
| | | this.page = 1 |
| | | this.showList = [] |
| | | |
| | | this.sWhere = '' |
| | | this.hform = { |
| | | HBillNo: '', |
| | | HEquipType: '', |
| | | BenginHCreateDate: '', |
| | | EndHCreateDate: '', |
| | | } |
| | | this.getList() |
| | | }, |
| | | toSon(item) { |
| | | uni.navigateTo({ |
| | | url: '/pages/shebeilvli/EquipFileBillResume_son?HInterID=' + item.hmainid + |
| | | '&设备名称=' + item.设备名称 + |
| | | '&设备代码=' + item.设备代码 + |
| | | '&设备出厂日期=' + item.设备出厂日期 + |
| | | '&设备出厂编号=' + item.设备出厂编号 + |
| | | '&设备型号=' + item.设备型号 + |
| | | '&设备类型=' + item.设备类型 + |
| | | '&设备编码=' + item.设备编码 + |
| | | '&设备规格=' + item.设备规格, |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .form{ |
| | | width: 640rpx; |
| | | margin: 20rpx auto; |
| | | } |
| | | .form-item{ |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 28rpx; |
| | | padding: 6rpx 0; |
| | | .title{ |
| | | width: 180rpx; |
| | | text{ |
| | | color: red; |
| | | font-weight: bold; |
| | | } |
| | | } |
| | | .right{ |
| | | width: 450rpx; |
| | | border-radius: 22rpx; |
| | | border: 1px solid #acacac; |
| | | } |
| | | .righton{ |
| | | width: 450rpx; |
| | | border-radius: 22rpx; |
| | | border: 1px solid #e4e4e4; |
| | | background-color: #e4e4e4; |
| | | } |
| | | input{ |
| | | width: 100%; |
| | | padding: 8rpx 20rpx; |
| | | font-size: 30rpx; |
| | | } |
| | | } |
| | | .buttons{ |
| | | width: 100%; |
| | | display: flex; |
| | | justify-content: center; |
| | | margin-top: 20rpx; |
| | | button{ |
| | | border-radius: 50rpx; |
| | | width: 180rpx; |
| | | height: 66rpx; |
| | | line-height: 66rpx; |
| | | font-size: 28rpx; |
| | | } |
| | | .btn-a{ |
| | | background-color: #acacac; |
| | | color: #fff; |
| | | } |
| | | .btn-b{ |
| | | background-color: #41a863; |
| | | color: #fff; |
| | | } |
| | | .btn-c{ |
| | | background-color: #3a78ff; |
| | | color: #fff; |
| | | } |
| | | } |
| | | |
| | | .list{ |
| | | width: 100%; |
| | | .card-detail{ |
| | | width: 100%; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | justify-content: space-between; |
| | | line-height: 120%; |
| | | .detail{ |
| | | // width: 50%; |
| | | font-size: 26rpx; |
| | | margin-bottom: 12rpx; |
| | | color: #555; |
| | | margin-right: 20rpx; |
| | | text{ |
| | | color: #999; |
| | | font-size: 26rpx; |
| | | } |
| | | } |
| | | } |
| | | .more{ |
| | | color: #888; |
| | | font-size: 24rpx; |
| | | display: flex; |
| | | border-top: 1px solid #eee; |
| | | padding-top: 20rpx; |
| | | .part{ |
| | | width: 50%; |
| | | text-align: center; |
| | | } |
| | | } |
| | | } |
| | | .form { |
| | | width: 640rpx; |
| | | margin: 20rpx auto; |
| | | } |
| | | |
| | | </style> |
| | | .form-item { |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 28rpx; |
| | | padding: 6rpx 0; |
| | | |
| | | .title { |
| | | width: 180rpx; |
| | | |
| | | text { |
| | | color: red; |
| | | font-weight: bold; |
| | | } |
| | | } |
| | | |
| | | .right { |
| | | width: 450rpx; |
| | | border-radius: 22rpx; |
| | | border: 1px solid #acacac; |
| | | } |
| | | |
| | | .righton { |
| | | width: 450rpx; |
| | | border-radius: 22rpx; |
| | | border: 1px solid #e4e4e4; |
| | | background-color: #e4e4e4; |
| | | } |
| | | |
| | | input { |
| | | width: 100%; |
| | | padding: 8rpx 20rpx; |
| | | font-size: 30rpx; |
| | | } |
| | | } |
| | | |
| | | .buttons { |
| | | width: 100%; |
| | | display: flex; |
| | | justify-content: center; |
| | | margin-top: 20rpx; |
| | | |
| | | button { |
| | | border-radius: 50rpx; |
| | | width: 180rpx; |
| | | height: 66rpx; |
| | | line-height: 66rpx; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .btn-a { |
| | | background-color: #acacac; |
| | | color: #fff; |
| | | } |
| | | |
| | | .btn-b { |
| | | background-color: #41a863; |
| | | color: #fff; |
| | | } |
| | | |
| | | .btn-c { |
| | | background-color: #3a78ff; |
| | | color: #fff; |
| | | } |
| | | } |
| | | |
| | | .list { |
| | | width: 100%; |
| | | |
| | | .card-detail { |
| | | width: 100%; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | justify-content: space-between; |
| | | line-height: 120%; |
| | | |
| | | .detail { |
| | | // width: 50%; |
| | | font-size: 26rpx; |
| | | margin-bottom: 12rpx; |
| | | color: #555; |
| | | margin-right: 20rpx; |
| | | |
| | | text { |
| | | color: #999; |
| | | font-size: 26rpx; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .more { |
| | | color: #888; |
| | | font-size: 24rpx; |
| | | display: flex; |
| | | border-top: 1px solid #eee; |
| | | padding-top: 20rpx; |
| | | |
| | | .part { |
| | | width: 50%; |
| | | text-align: center; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <view class="container"> |
| | | <view class="graph-container"> |
| | | <view class="graph"><l-echart ref="chartRef1" @finished="initHistogram1"></l-echart></view> |
| | | <view class="graph"><l-echart ref="chartRef2" @finished="initLineChart"></l-echart></view> |
| | | <view class="graph"><l-echart ref="chartRef3" @finished="initStatistics"></l-echart></view> |
| | | <view class="graph"><l-echart ref="chartRef4" @finished="initHistogram4"></l-echart></view> |
| | | </view> |
| | | <view class="container"> |
| | | <view class="graph-container"> |
| | | <view class="graph"><l-echart ref="chartRef1" @finished="initHistogram1"></l-echart></view> |
| | | <view class="graph"><l-echart ref="chartRef2" @finished="initLineChart"></l-echart></view> |
| | | <view class="graph"><l-echart ref="chartRef3" @finished="initStatistics"></l-echart></view> |
| | | <view class="graph"><l-echart ref="chartRef4" @finished="initHistogram4"></l-echart></view> |
| | | </view> |
| | | |
| | | <view class="operation-zone"> |
| | | <button size="mini" plain>开机</button> |
| | | <button size="mini" plain>停机</button> |
| | | <button size="mini" plain>点检记录</button> |
| | | <button size="mini" plain>故障登记</button> |
| | | <button size="mini" plain>维修</button> |
| | | <button size="mini" plain>履历</button> |
| | | <button size="mini" plain>工艺</button> |
| | | <button size="mini" plain>状态</button> |
| | | </view> |
| | | <view class="operation-zone" @click="doOperation"> |
| | | <button size="mini" data-type="equipBegin" plain>开机</button> |
| | | <button size="mini" data-type="equipStop" plain>停机</button> |
| | | <button size="mini" data-type="workDotCheck" plain>点检记录</button> |
| | | <button size="mini" data-type="equipConkBook" plain>故障登记</button> |
| | | <button size="mini" plain>维修</button> |
| | | <button size="mini" data-type="equipResume" plain>履历</button> |
| | | <button size="mini" data-type="equipmentProcess" plain>工艺</button> |
| | | <button size="mini" plain>状态</button> |
| | | </view> |
| | | |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getUserInfo |
| | | } from "@/utils/auth.js"; |
| | | import * as echarts from "echarts" |
| | | export default { |
| | | data() { |
| | | return { |
| | | userInfo: getUserInfo(), |
| | | organInfo: { |
| | | id: uni.getStorageSync("OrganizationID") || "", |
| | | name: uni.getStorageSync("Organization") || "" |
| | | }, |
| | | serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API', |
| | | |
| | | } |
| | | }, |
| | | methods: { |
| | | doRequest(url, data, resFunction, errFunction, method) { |
| | | uni.showLoading({ |
| | | title: '加载中...' |
| | | }) |
| | | uni.request({ |
| | | method: method || "GET", |
| | | url: this.serverUrl + url, |
| | | data: data || "", |
| | | success: (res) => { |
| | | if (typeof resFunction === 'function') { |
| | | resFunction.call(this, res) |
| | | } else if (typeof errFunction === 'undefined') { |
| | | return |
| | | } else { |
| | | throw new TypeError("访问成功回调函数类型异常!") |
| | | } |
| | | }, |
| | | fail: (err) => { |
| | | import { |
| | | CommonUtils |
| | | } from "../../utils/common"; |
| | | import { |
| | | getUserInfo |
| | | } from "@/utils/auth.js"; |
| | | import * as echarts from "echarts" |
| | | export default { |
| | | data() { |
| | | return { |
| | | HEquipID: 0, |
| | | HICMOInterID: 0, |
| | | HICMOEntryID: 0, |
| | | userInfo: getUserInfo(), |
| | | organInfo: { |
| | | id: uni.getStorageSync("OrganizationID") || "", |
| | | name: uni.getStorageSync("Organization") || "" |
| | | }, |
| | | serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API', |
| | | |
| | | if (typeof errFunction === 'function') { |
| | | errFunction.call(this, err) |
| | | } else if (typeof errFunction === 'undefined') { |
| | | return |
| | | } else { |
| | | throw new TypeError("访问失败回调函数类型异常!") |
| | | } |
| | | } |
| | | }) |
| | | uni.hideLoading() |
| | | }, |
| | | } |
| | | }, |
| | | methods: { |
| | | doRequest(url, data, resFunction, errFunction, method) { |
| | | uni.showLoading({ |
| | | title: '加载中...' |
| | | }) |
| | | uni.request({ |
| | | method: method || "GET", |
| | | url: this.serverUrl + url, |
| | | data: data || "", |
| | | success: (res) => { |
| | | if (typeof resFunction === 'function') { |
| | | resFunction.call(this, res) |
| | | } else if (typeof errFunction === 'undefined') { |
| | | return |
| | | } else { |
| | | throw new TypeError("访问成功回调函数类型异常!") |
| | | } |
| | | }, |
| | | fail: (err) => { |
| | | |
| | | //柱状图 |
| | | async get_Histogram1(mychart11, chartData) { |
| | | console.log("初始化柱状图") |
| | | // 默认的option结构 |
| | | var option = { |
| | | title: { |
| | | text: '近七天产能', // 默认标题为空 |
| | | left: 'center', |
| | | top: '10%', // 调整标题位置,放到最上面 |
| | | textStyle: { |
| | | fontSize: 18, |
| | | color: '#ff0000' |
| | | } |
| | | }, |
| | | grid: { |
| | | top: '25%', // 调整grid的top值,给标题留出空间 |
| | | bottom: '20%', |
| | | left: '10%', |
| | | right: '10%' |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | data: [] // 默认x轴数据为空 |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [{ |
| | | data: [], // 默认series数据为空 |
| | | type: 'bar' |
| | | }] |
| | | }; |
| | | if (typeof errFunction === 'function') { |
| | | errFunction.call(this, err) |
| | | } else if (typeof errFunction === 'undefined') { |
| | | return |
| | | } else { |
| | | throw new TypeError("访问失败回调函数类型异常!") |
| | | } |
| | | } |
| | | }) |
| | | uni.hideLoading() |
| | | }, |
| | | |
| | | // 如果有数据,更新option的内容 |
| | | if (chartData && chartData.length > 0) { |
| | | option.title.text = '近七天产能'; // 正常数据时没有标题 |
| | | option.xAxis.data = chartData.map(item => item.日期); // 设置x轴数据 |
| | | option.series[0].data = chartData.map(item => item['生产总数']); // 设置y轴数据 |
| | | //柱状图 |
| | | async get_Histogram1(mychart11, chartData) { |
| | | console.log("初始化柱状图") |
| | | // 默认的option结构 |
| | | var option = { |
| | | title: { |
| | | text: '近七天产能', // 默认标题为空 |
| | | left: 'center', |
| | | top: '10%', // 调整标题位置,放到最上面 |
| | | textStyle: { |
| | | fontSize: 18, |
| | | color: '#ff0000' |
| | | } |
| | | }, |
| | | grid: { |
| | | top: '25%', // 调整grid的top值,给标题留出空间 |
| | | bottom: '20%', |
| | | left: '10%', |
| | | right: '10%' |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | data: [] // 默认x轴数据为空 |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [{ |
| | | data: [], // 默认series数据为空 |
| | | type: 'bar' |
| | | }], |
| | | animation: false |
| | | }; |
| | | |
| | | option.series[0].label = { |
| | | normal: { |
| | | show: true, |
| | | position: 'top', |
| | | formatter: function(params) { |
| | | return echarts.format.addCommas(params.value); |
| | | } |
| | | } |
| | | }; |
| | | // 如果有数据,更新option的内容 |
| | | if (chartData && chartData.length > 0) { |
| | | option.title.text = '近七天产能'; // 正常数据时没有标题 |
| | | option.xAxis.data = chartData.map(item => item.日期); // 设置x轴数据 |
| | | option.series[0].data = chartData.map(item => item['生产总数']); // 设置y轴数据 |
| | | |
| | | option.series[0].itemStyle = { |
| | | normal: { |
| | | color: '#15b1fa', |
| | | label: { |
| | | show: true // 在柱状图上显示数据 |
| | | } |
| | | } |
| | | }; |
| | | } else { |
| | | // 没有数据时,显示"暂无数据"提示 |
| | | option.title.text = '暂无数据'; |
| | | } |
| | | option.series[0].label = { |
| | | normal: { |
| | | show: true, |
| | | position: 'top', |
| | | formatter: function(params) { |
| | | return echarts.format.addCommas(params.value); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | // 更新图表 |
| | | mychart11.setOption(option); |
| | | }, |
| | | option.series[0].itemStyle = { |
| | | normal: { |
| | | color: '#15b1fa', |
| | | label: { |
| | | show: true // 在柱状图上显示数据 |
| | | } |
| | | } |
| | | }; |
| | | } else { |
| | | // 没有数据时,显示"暂无数据"提示 |
| | | option.title.text = '暂无数据'; |
| | | } |
| | | |
| | | //柱状图2 |
| | | async get_LineChart(mychart22, chartData1) { |
| | | // 默认的option结构 |
| | | var option = { |
| | | title: { |
| | | text: '维修', // 默认标题为空 |
| | | left: 'center', |
| | | top: '10%', // 调整标题位置,放到最上面 |
| | | textStyle: { |
| | | fontSize: 18, |
| | | color: '#ff0000' |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | show: true, |
| | | interval: 0, |
| | | color: '#15b1fa', |
| | | formatter: function(value) { |
| | | var ret = ""; //拼接加\n返回的类目项 |
| | | var maxLength = 1; //每项显示文字个数 |
| | | var valLength = value.length; //X轴类目项的文字个数 |
| | | var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数 |
| | | if (rowN > 1) //如果类目项的文字大于3, |
| | | { |
| | | for (var i = 0; i < rowN; i++) { |
| | | var temp = ""; //每次截取的字符串 |
| | | var start = i * maxLength; //开始截取的位置 |
| | | var end = start + maxLength; //结束截取的位置 |
| | | //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧 |
| | | temp = value.substring(start, end) + "\n"; |
| | | ret += temp; //凭借最终的字符串 |
| | | } |
| | | return ret; |
| | | } else { |
| | | return value; |
| | | } |
| | | } |
| | | }, |
| | | grid: { |
| | | top: '25%', // 调整grid的top值,给标题留出空间 |
| | | bottom: '20%', |
| | | left: '10%', |
| | | right: '10%' |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | data: [] // 默认x轴数据为空 |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [{ |
| | | data: [], // 默认series数据为空 |
| | | type: 'bar' |
| | | }] |
| | | }; |
| | | // 更新图表 |
| | | mychart11.setOption(option); |
| | | }, |
| | | |
| | | //柱状图2 |
| | | async get_LineChart(mychart22, chartData1) { |
| | | // 默认的option结构 |
| | | var option = { |
| | | title: { |
| | | text: '维修', // 默认标题为空 |
| | | left: 'center', |
| | | top: '10%', // 调整标题位置,放到最上面 |
| | | textStyle: { |
| | | fontSize: 18, |
| | | color: '#ff0000' |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | show: true, |
| | | interval: 0, |
| | | color: '#15b1fa', |
| | | formatter: function(value) { |
| | | var ret = ""; //拼接加\n返回的类目项 |
| | | var maxLength = 1; //每项显示文字个数 |
| | | var valLength = value.length; //X轴类目项的文字个数 |
| | | var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数 |
| | | if (rowN > 1) //如果类目项的文字大于3, |
| | | { |
| | | for (var i = 0; i < rowN; i++) { |
| | | var temp = ""; //每次截取的字符串 |
| | | var start = i * maxLength; //开始截取的位置 |
| | | var end = start + maxLength; //结束截取的位置 |
| | | //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧 |
| | | temp = value.substring(start, end) + "\n"; |
| | | ret += temp; //凭借最终的字符串 |
| | | } |
| | | return ret; |
| | | } else { |
| | | return value; |
| | | } |
| | | } |
| | | }, |
| | | grid: { |
| | | top: '25%', // 调整grid的top值,给标题留出空间 |
| | | bottom: '20%', |
| | | left: '10%', |
| | | right: '10%' |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | data: [] // 默认x轴数据为空 |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [{ |
| | | data: [], // 默认series数据为空 |
| | | type: 'bar' |
| | | }], |
| | | animation: false |
| | | }; |
| | | |
| | | |
| | | |
| | | // 如果有数据,更新option的内容 |
| | | if (chartData1 && chartData1.length > 0) { |
| | | option.title.text = '不良原因'; // 正常数据时没有标题 |
| | | option.xAxis.data = chartData1.map(item => item.不良原因); // 设置x轴数据 |
| | | option.series[0].data = chartData1.map(item => item['数量']); // 设置y轴数据 |
| | | // 如果有数据,更新option的内容 |
| | | if (chartData1 && chartData1.length > 0) { |
| | | option.title.text = '不良原因'; // 正常数据时没有标题 |
| | | option.xAxis.data = chartData1.map(item => item.不良原因); // 设置x轴数据 |
| | | option.series[0].data = chartData1.map(item => item['数量']); // 设置y轴数据 |
| | | |
| | | option.series[0].label = { |
| | | normal: { |
| | | show: true, |
| | | position: 'top', |
| | | formatter: function(params) { |
| | | return echarts.format.addCommas(params.value); |
| | | } |
| | | } |
| | | }; |
| | | option.series[0].label = { |
| | | normal: { |
| | | show: true, |
| | | position: 'top', |
| | | formatter: function(params) { |
| | | return echarts.format.addCommas(params.value); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | option.series[0].itemStyle = { |
| | | normal: { |
| | | color: '#15b1fa', |
| | | label: { |
| | | show: true // 在柱状图上显示数据 |
| | | } |
| | | } |
| | | }; |
| | | } else { |
| | | // 没有数据时,显示"暂无数据"提示 |
| | | option.title.text = '暂无数据'; |
| | | } |
| | | option.series[0].itemStyle = { |
| | | normal: { |
| | | color: '#15b1fa', |
| | | label: { |
| | | show: true // 在柱状图上显示数据 |
| | | } |
| | | } |
| | | }; |
| | | } else { |
| | | // 没有数据时,显示"暂无数据"提示 |
| | | option.title.text = '暂无数据'; |
| | | } |
| | | |
| | | // 更新图表 |
| | | mychart22.setOption(option); |
| | | }, |
| | | // 更新图表 |
| | | mychart22.setOption(option); |
| | | }, |
| | | |
| | | //饼图 |
| | | async get_Statistics(mychart3, chartData2) { |
| | | // 如果 chartData2 为空,提供一个“无数据”提示 |
| | | if (chartData2.length === 0) { |
| | | mychart3.setOption({ |
| | | title: { |
| | | text: '暂无数据', |
| | | left: 'center', |
| | | top: '10%', |
| | | textStyle: { |
| | | color: 'red', // 设置标题颜色为红色 |
| | | fontSize: 18, |
| | | fontWeight: 'bold' |
| | | } |
| | | }, |
| | | series: [], // 清空数据 |
| | | graphic: [] // 清空图形中的文本 |
| | | }); |
| | | return; |
| | | } |
| | | //饼图 |
| | | async get_Statistics(mychart3, chartData2) { |
| | | // 如果 chartData2 为空,提供一个“无数据”提示 |
| | | if (!chartData2 || chartData2.length == 0) { |
| | | mychart3.setOption({ |
| | | title: { |
| | | text: '暂无数据', |
| | | left: 'center', |
| | | top: '10%', |
| | | textStyle: { |
| | | color: 'red', // 设置标题颜色为红色 |
| | | fontSize: 18, |
| | | fontWeight: 'bold' |
| | | } |
| | | }, |
| | | series: [], // 清空数据 |
| | | graphic: [], // 清空图形中的文本 |
| | | animation: false |
| | | }); |
| | | } else { |
| | | // 状态颜色映射 |
| | | const statusColorMap = { |
| | | '开机': '#28a745', // 绿色 |
| | | '故障': '#ff63a5', // 桃红色 |
| | | '停机': '#f0ad4e', // 黄色 |
| | | '未知': '#6c757d' // 灰色 |
| | | }; |
| | | |
| | | // 状态颜色映射 |
| | | const statusColorMap = { |
| | | '开机': '#28a745', // 绿色 |
| | | '故障': '#ff63a5', // 桃红色 |
| | | '停机': '#f0ad4e', // 黄色 |
| | | '未知': '#6c757d' // 灰色 |
| | | }; |
| | | // 计算开机率 |
| | | chartData2 = Array.from(chartData2) |
| | | const totalDevices = chartData2.reduce((sum, item) => sum + item.数量, 0); |
| | | const onlineDevices = chartData2.find(item => item.状态 === '开机')?.数量 || 0; |
| | | const onlineRate = totalDevices === 0 ? 0 : (onlineDevices / totalDevices * 100).toFixed(2); |
| | | |
| | | // 计算开机率 |
| | | const totalDevices = chartData2.reduce((sum, item) => sum + item.数量, 0); |
| | | const onlineDevices = chartData2.find(item => item.状态 === '开机')?.数量 || 0; |
| | | const onlineRate = totalDevices === 0 ? 0 : (onlineDevices / totalDevices * 100).toFixed(2); |
| | | // 动态生成饼图数据,并根据状态设置颜色 |
| | | var data = chartData2.map(function(item) { |
| | | // 获取当前状态的颜色,默认为灰色 |
| | | var color = statusColorMap[item.状态] || statusColorMap['未知']; |
| | | |
| | | // 动态生成饼图数据,并根据状态设置颜色 |
| | | var data = chartData2.map(function(item) { |
| | | // 获取当前状态的颜色,默认为灰色 |
| | | var color = statusColorMap[item.状态] || statusColorMap['未知']; |
| | | return { |
| | | value: item.数量, |
| | | name: item.状态, |
| | | itemStyle: { |
| | | color: color // 为每个状态设置对应的颜色 |
| | | } |
| | | }; |
| | | }); |
| | | |
| | | return { |
| | | value: item.数量, |
| | | name: item.状态, |
| | | itemStyle: { |
| | | color: color // 为每个状态设置对应的颜色 |
| | | } |
| | | }; |
| | | }); |
| | | // 图表的配置项 |
| | | var option = { |
| | | title: { |
| | | text: '设备状态分析对比', |
| | | left: 'center', |
| | | top: '10%', // 将标题放置到顶部 |
| | | textStyle: { |
| | | color: 'red', // 设置标题字体颜色为红色 |
| | | fontSize: 18, |
| | | fontWeight: 'bold' |
| | | } |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | legend: { |
| | | orient: 'vertical', |
| | | left: 'left' |
| | | }, |
| | | series: [{ |
| | | name: '设备状态', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: data, // 使用动态生成的数据 |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | }], |
| | | graphic: [{ |
| | | type: 'text', |
| | | left: 'center', |
| | | top: '85%', // 调整文本位置,让其稍微更往下 |
| | | style: { |
| | | text: `开机率: ${onlineRate}%`, // 显示开机率 |
| | | font: '16px Arial', |
| | | fill: '#00aaff' // 使用浅蓝色显示开机率 |
| | | } |
| | | }] |
| | | }; |
| | | |
| | | // 图表的配置项 |
| | | var option = { |
| | | title: { |
| | | text: '设备状态分析对比', |
| | | left: 'center', |
| | | top: '10%', // 将标题放置到顶部 |
| | | textStyle: { |
| | | color: 'red', // 设置标题字体颜色为红色 |
| | | fontSize: 18, |
| | | fontWeight: 'bold' |
| | | } |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | legend: { |
| | | orient: 'vertical', |
| | | left: 'left' |
| | | }, |
| | | series: [{ |
| | | name: '设备状态', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: data, // 使用动态生成的数据 |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | }], |
| | | graphic: [{ |
| | | type: 'text', |
| | | left: 'center', |
| | | top: '85%', // 调整文本位置,让其稍微更往下 |
| | | style: { |
| | | text: `开机率: ${onlineRate}%`, // 显示开机率 |
| | | font: '16px Arial', |
| | | fill: '#00aaff' // 使用浅蓝色显示开机率 |
| | | } |
| | | }] |
| | | }; |
| | | // 设置图表的配置项 |
| | | mychart3.setOption(option); |
| | | } |
| | | |
| | | // 设置图表的配置项 |
| | | mychart3.setOption(option); |
| | | }, |
| | | |
| | | //柱状图4 |
| | | async get_Histogram4(mychart4, chartData3) { |
| | | // 默认的option结构 |
| | | var option = { |
| | | title: { |
| | | text: '维修', // 默认标题为空 |
| | | left: 'center', |
| | | top: '10%', // 调整标题位置,放到最上面 |
| | | textStyle: { |
| | | fontSize: 18, |
| | | color: '#ff0000' |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | show: true, |
| | | interval: 0, |
| | | color: '#15b1fa', |
| | | formatter: function(value) { |
| | | var ret = ""; //拼接加\n返回的类目项 |
| | | var maxLength = 1; //每项显示文字个数 |
| | | var valLength = value.length; //X轴类目项的文字个数 |
| | | var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数 |
| | | if (rowN > 1) //如果类目项的文字大于3, |
| | | { |
| | | for (var i = 0; i < rowN; i++) { |
| | | var temp = ""; //每次截取的字符串 |
| | | var start = i * maxLength; //开始截取的位置 |
| | | var end = start + maxLength; //结束截取的位置 |
| | | //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧 |
| | | temp = value.substring(start, end) + "\n"; |
| | | ret += temp; //凭借最终的字符串 |
| | | } |
| | | return ret; |
| | | } else { |
| | | return value; |
| | | } |
| | | } |
| | | }, |
| | | grid: { |
| | | top: '25%', // 调整grid的top值,给标题留出空间 |
| | | bottom: '20%', |
| | | left: '10%', |
| | | right: '10%' |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | data: [] // 默认x轴数据为空 |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [{ |
| | | data: [], // 默认series数据为空 |
| | | type: 'bar' |
| | | }] |
| | | }; |
| | | }, |
| | | |
| | | // 如果有数据,更新option的内容 |
| | | if (chartData3 && chartData3.length > 0) { |
| | | option.title.text = '维修'; // 正常数据时没有标题 |
| | | option.xAxis.data = chartData3.map(item => item.维修项目); // 设置x轴数据 |
| | | option.series[0].data = chartData3.map(item => item['维修次数']); // 设置y轴数据 |
| | | //柱状图4 |
| | | async get_Histogram4(mychart4, chartData3) { |
| | | // 默认的option结构 |
| | | var option = { |
| | | title: { |
| | | text: '维修', // 默认标题为空 |
| | | left: 'center', |
| | | top: '10%', // 调整标题位置,放到最上面 |
| | | textStyle: { |
| | | fontSize: 18, |
| | | color: '#ff0000' |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | show: true, |
| | | interval: 0, |
| | | color: '#15b1fa', |
| | | formatter: function(value) { |
| | | var ret = ""; //拼接加\n返回的类目项 |
| | | var maxLength = 1; //每项显示文字个数 |
| | | var valLength = value.length; //X轴类目项的文字个数 |
| | | var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数 |
| | | if (rowN > 1) //如果类目项的文字大于3, |
| | | { |
| | | for (var i = 0; i < rowN; i++) { |
| | | var temp = ""; //每次截取的字符串 |
| | | var start = i * maxLength; //开始截取的位置 |
| | | var end = start + maxLength; //结束截取的位置 |
| | | //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧 |
| | | temp = value.substring(start, end) + "\n"; |
| | | ret += temp; //凭借最终的字符串 |
| | | } |
| | | return ret; |
| | | } else { |
| | | return value; |
| | | } |
| | | } |
| | | }, |
| | | grid: { |
| | | top: '25%', // 调整grid的top值,给标题留出空间 |
| | | bottom: '20%', |
| | | left: '10%', |
| | | right: '10%' |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | data: [] // 默认x轴数据为空 |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [{ |
| | | data: [], // 默认series数据为空 |
| | | type: 'bar' |
| | | }], |
| | | animation: false |
| | | }; |
| | | |
| | | option.series[0].label = { |
| | | normal: { |
| | | show: true, |
| | | position: 'top', |
| | | formatter: function(params) { |
| | | return echarts.format.addCommas(params.value); |
| | | } |
| | | } |
| | | }; |
| | | // 如果有数据,更新option的内容 |
| | | if (chartData3 && chartData3.length > 0) { |
| | | option.title.text = '维修'; // 正常数据时没有标题 |
| | | option.xAxis.data = chartData3.map(item => item.维修项目); // 设置x轴数据 |
| | | option.series[0].data = chartData3.map(item => item['维修次数']); // 设置y轴数据 |
| | | |
| | | option.series[0].itemStyle = { |
| | | normal: { |
| | | color: '#15b1fa', |
| | | label: { |
| | | show: true // 在柱状图上显示数据 |
| | | } |
| | | } |
| | | }; |
| | | } else { |
| | | // 没有数据时,显示"暂无数据"提示 |
| | | option.title.text = '暂无数据'; |
| | | } |
| | | option.series[0].label = { |
| | | normal: { |
| | | show: true, |
| | | position: 'top', |
| | | formatter: function(params) { |
| | | return echarts.format.addCommas(params.value); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | // 更新图表 |
| | | mychart4.setOption(option); |
| | | }, |
| | | initCharts(data) { |
| | | try { |
| | | let { |
| | | h_p_Sc_FourStateDistributionReport, |
| | | h_p_Sc_FourStateDistributionReport1, |
| | | h_p_Sc_FourStateDistributionReport2, |
| | | h_p_Sc_FourStateDistributionReport3 |
| | | } = data |
| | | |
| | | // 能显示暂无数据,但是需要渲染两次图表 |
| | | this.initHistogram1 = this.initHistogram1(h_p_Sc_FourStateDistributionReport); |
| | | this.initLineChart = this.initLineChart(h_p_Sc_FourStateDistributionReport1); |
| | | this.initStatistics = this.initStatistics(h_p_Sc_FourStateDistributionReport2); |
| | | this.initHistogram4 = this.initHistogram4(h_p_Sc_FourStateDistributionReport3); |
| | | } catch (e) { |
| | | console.error(e) |
| | | } |
| | | }, |
| | | async initHistogram1(data) { |
| | | const chart = await this.$refs.chartRef1.init(echarts) |
| | | this.get_Histogram1(chart, data) |
| | | }, |
| | | async initLineChart(data) { |
| | | const chart = await this.$refs.chartRef2.init(echarts) |
| | | this.get_LineChart(chart, data) |
| | | }, |
| | | async initStatistics(data) { |
| | | const chart = await this.$refs.chartRef3.init(echarts) |
| | | this.get_Statistics(chart, data) |
| | | }, |
| | | async initHistogram4(data) { |
| | | const chart = await this.$refs.chartRef4.init(echarts) |
| | | this.get_Histogram4(chart, data) |
| | | } |
| | | }, |
| | | onLoad(options) { |
| | | let { |
| | | HDeptID, |
| | | HSourceID |
| | | } = options |
| | | this.doRequest( |
| | | "/Sc_HEquipStateDistribution/Get_EquipStateDistribution_FourReport", { |
| | | sWhere: { |
| | | "HDeptID": HDeptID, |
| | | "HSourceID": HSourceID |
| | | }, |
| | | user: this.userInfo.HEmpName, |
| | | OrganizationID: this.organInfo.id |
| | | }, |
| | | function(res) { |
| | | let res1 = res.data |
| | | this.initCharts(res1.data) |
| | | }, |
| | | function(err) { |
| | | uni.showToast({ |
| | | icon: "fail", |
| | | title: '接口请求失败!' |
| | | }) |
| | | } |
| | | ) |
| | | }, |
| | | } |
| | | option.series[0].itemStyle = { |
| | | normal: { |
| | | color: '#15b1fa', |
| | | label: { |
| | | show: true // 在柱状图上显示数据 |
| | | } |
| | | } |
| | | }; |
| | | } else { |
| | | // 没有数据时,显示"暂无数据"提示 |
| | | option.title.text = '暂无数据'; |
| | | } |
| | | |
| | | // 更新图表 |
| | | mychart4.setOption(option); |
| | | }, |
| | | initCharts(data) { |
| | | try { |
| | | let { |
| | | h_p_Sc_FourStateDistributionReport, |
| | | h_p_Sc_FourStateDistributionReport1, |
| | | h_p_Sc_FourStateDistributionReport2, |
| | | h_p_Sc_FourStateDistributionReport3 |
| | | } = data |
| | | |
| | | // 能显示暂无数据,但是需要渲染两次图表 |
| | | this.initHistogram1 = this.initHistogram1(h_p_Sc_FourStateDistributionReport); |
| | | this.initLineChart = this.initLineChart(h_p_Sc_FourStateDistributionReport1); |
| | | this.initStatistics = this.initStatistics(h_p_Sc_FourStateDistributionReport2); |
| | | this.initHistogram4 = this.initHistogram4(h_p_Sc_FourStateDistributionReport3); |
| | | } catch (e) { |
| | | console.error(e) |
| | | } |
| | | }, |
| | | async initHistogram1(data) { |
| | | const chart = await this.$refs.chartRef1.init(echarts) |
| | | this.get_Histogram1(chart, data) |
| | | }, |
| | | async initLineChart(data) { |
| | | const chart = await this.$refs.chartRef2.init(echarts) |
| | | this.get_LineChart(chart, data) |
| | | }, |
| | | async initStatistics(data) { |
| | | const chart = await this.$refs.chartRef3.init(echarts) |
| | | this.get_Statistics(chart, data) |
| | | }, |
| | | async initHistogram4(data) { |
| | | const chart = await this.$refs.chartRef4.init(echarts) |
| | | this.get_Histogram4(chart, data) |
| | | }, |
| | | doOperation(e) { |
| | | let ds = e.target |
| | | let type = ds.dataset.type |
| | | if (type) { |
| | | switch (type) { |
| | | case "equipBegin": |
| | | // 导航到 设备开机单 |
| | | uni.navigateTo({ |
| | | url: "/pages/MJGL/Sb_EquipBegin/Sb_EquipBeginBill?HEquipID=" + this.HEquipID |
| | | }); |
| | | break; |
| | | case "equipStop": |
| | | // 导航到 设备停机单 |
| | | uni.navigateTo({ |
| | | url: "/pages/MJGL/Sb_EquipStop/Sb_EquipStopBill?HEquipID=" + this.HEquipID |
| | | }); |
| | | break; |
| | | case "workDotCheck": |
| | | // 导航到点检记录 |
| | | uni.navigateTo({ |
| | | url: "/pages/MJGL/Sc_WorkDotCheck/Sc_WorkDotCheckBillList_Day?operationType=设备&HEquipID=" + this.HEquipID |
| | | }); |
| | | ;break; |
| | | case "equipConkBook": |
| | | // 导航到设备故障登记单 |
| | | uni.navigateTo({ |
| | | url: "/pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBill?operationType=4&HEquipID=" + this.HEquipID |
| | | }) |
| | | ;break; |
| | | case "equipResume": |
| | | // 导航到设备履历 |
| | | uni.navigateTo({ |
| | | url: "/pages/MJGL/Sb_EquipResumeCheckQuery/Sb_EquipResumeCheckQuery?operationType=4&HEquipID=" + this.HEquipID |
| | | }) |
| | | ;break; |
| | | case "equipmentProcess": |
| | | // 导航到设备工艺 |
| | | if(!this.HICMOInterID && !this.HICMOEntryID) { |
| | | CommonUtils.showTips({ |
| | | message: "当前设备无生产订单,无法查看工艺" |
| | | }) |
| | | } |
| | | uni.navigateTo({ |
| | | url: "/pages/MJGL/Sc_EquipmentProcessList/Sc_EquipmentProcess?operationType=4&HEquipID=" + this.HEquipID |
| | | + `&HICMOInterID=${this.HICMOInterID}&HICMOEntryID=${this.HICMOEntryID}` |
| | | }) |
| | | ;break; |
| | | default: |
| | | return; |
| | | } |
| | | } |
| | | }, |
| | | async getDiagram(HDeptID, HSourceID) { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Sc_HEquipStateDistribution/Get_EquipStateDistribution_FourReport", |
| | | data: { |
| | | sWhere: { |
| | | "HDeptID": HDeptID, |
| | | "HSourceID": HSourceID |
| | | }, |
| | | user: getUserInfo()["Czymc"], |
| | | OrganizationID: this.organInfo.id |
| | | } |
| | | }) |
| | | |
| | | let res1 = res.data |
| | | this.initCharts(res1.data) |
| | | } catch (err) { |
| | | uni.showToast({ |
| | | icon: "fail", |
| | | title: '接口请求失败!' |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | onLoad(options) { |
| | | let { |
| | | HDeptID, |
| | | HSourceID, |
| | | HEquipID, |
| | | HICMOInterID, |
| | | HICMOEntryID |
| | | } = options |
| | | this.HEquipID = HEquipID |
| | | this.HICMOInterID = HICMOInterID |
| | | this.HICMOEntryID = HICMOEntryID |
| | | |
| | | this.getDiagram(HDeptID, HSourceID) |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | * { |
| | | box-sizing: border-box; |
| | | } |
| | | * { |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .container { |
| | | padding: 20rpx 40rpx; |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 20rpx; |
| | | .container { |
| | | padding: 20rpx 40rpx; |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 20rpx; |
| | | |
| | | >div { |
| | | padding: 10rpx; |
| | | } |
| | | >div { |
| | | padding: 10rpx; |
| | | } |
| | | |
| | | .operation-zone { |
| | | .operation-zone { |
| | | |
| | | >button { |
| | | margin-right: 10rpx; |
| | | margin-top: 10rpx; |
| | | width: auto; |
| | | } |
| | | >button { |
| | | margin-right: 10rpx; |
| | | margin-top: 10rpx; |
| | | width: auto; |
| | | } |
| | | |
| | | >button:last-child { |
| | | margin-right: 0; |
| | | } |
| | | >button:last-child { |
| | | margin-right: 0; |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <uni-icons type="smallcircle-filled" size="14" |
| | | color=""></uni-icons><text>{{item["设备状态"]}}</text> |
| | | </view> |
| | | <view class="op2" v-if="item['设备状态']=='故障'"> |
| | | <uni-icons type="smallcircle-filled" size="14" |
| | | color=""></uni-icons><text>{{item["设备状态"]}}</text> |
| | | </view> |
| | | <view class="op1" v-if="item['设备状态']=='生产'"> |
| | | <uni-icons type="smallcircle-filled" size="14" |
| | | color=""></uni-icons><text>{{item["设备状态"]}}</text> |
| | |
| | | departmentsTitles: [], |
| | | departmentsIdArray: [], |
| | | devices: [], |
| | | selectedDepartment: "" |
| | | selectedDepartment: "", |
| | | HDeptID: 0 |
| | | }; |
| | | }, |
| | | methods: { |
| | |
| | | let index = e.detail.value |
| | | this.selectedDepartment = this.departmentsTitles[index] |
| | | let id = this.departmentsIdArray[index] |
| | | |
| | | this.HDeptID = id |
| | | // 合并稼动率和OEE => Sc_HEquipStateDistribution/Sc_HEquipStateDistribution_Souce_MergeOEEReport |
| | | this.doRequest( |
| | | "/Sc_HEquipStateDistribution/Sc_HEquipStateDistribution_Souce_MergeOEEReport", |
| | |
| | | uni.hideLoading() |
| | | }, |
| | | ToDetail(item) { |
| | | console.log('item: ',item); |
| | | uni.navigateTo({ |
| | | url: "./detail?HDeptID=" + (item['设备id'] || 0) + "&HSourceID=" + (item['HSourceID'] || 0) |
| | | }) |
| | | url: "./detail?HDeptID=" + (this.HDeptID || 0) + "&HSourceID=" + (item['HSourceID'] || 0) + `&HEquipID=${item['设备id'] || 0}` |
| | | + `&HICMOInterID=${item["生产订单主内码"] || 0}&HICMOEntryID=${item["生产订单子内码"] || 0}` |
| | | }) |
| | | }, |
| | | async initDepartment() { |
| | | this.doRequest( |
| | |
| | | }) // 自动触发首条数据的更新语句 |
| | | }, |
| | | ) |
| | | } |
| | | }, |
| | | refreshEquipList() { |
| | | let departIndex = this.departmentsTitles.indexOf(this.selectedDepartment) |
| | | if (departIndex != -1) { |
| | | let departId = this.departmentsIdArray[departIndex] |
| | | // 合并稼动率和OEE => Sc_HEquipStateDistribution/Sc_HEquipStateDistribution_Souce_MergeOEEReport |
| | | this.doRequest( |
| | | "/Sc_HEquipStateDistribution/Sc_HEquipStateDistribution_Souce_MergeOEEReport", |
| | | // "/Sc_HEquipStateDistribution/Sc_HEquipStateDistribution_Souce", |
| | | { |
| | | HDeptID: departId, |
| | | user: this.userInfo.Czymc, |
| | | OrganizationID: this.organInfo.id |
| | | }, |
| | | function(res) { |
| | | let res1 = res.data |
| | | let { |
| | | count, |
| | | data |
| | | } = res1 |
| | | if (count > 0) { |
| | | console.log(data) |
| | | this.devices = data["h_p_sc_HDeptSouceMOList_MergeOEEReport"].map(item => { |
| | | return Object.assign(item, { |
| | | imgSrc: "../../static/sb.png" |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | | function(err) { |
| | | console.error(err) |
| | | } |
| | | ) |
| | | } |
| | | } |
| | | }, |
| | | async onLoad() { |
| | | await this.initDepartment() |
| | | }, |
| | | async onShow() { |
| | | this.refreshEquipList() |
| | | }, |
| | | onPullDownRefresh() { |
| | | let departIndex = this.departmentsTitles.indexOf(this.selectedDepartment) |
| | | if (departIndex != -1) { |
| | | let departId = this.departmentsIdArray[departIndex] |
| | | // 合并稼动率和OEE => Sc_HEquipStateDistribution/Sc_HEquipStateDistribution_Souce_MergeOEEReport |
| | | this.doRequest( |
| | | "/Sc_HEquipStateDistribution/Sc_HEquipStateDistribution_Souce_MergeOEEReport", |
| | | // "/Sc_HEquipStateDistribution/Sc_HEquipStateDistribution_Souce", |
| | | { |
| | | HDeptID: departId, |
| | | user: this.userInfo.Czymc, |
| | | OrganizationID: this.organInfo.id |
| | | }, |
| | | function(res) { |
| | | let res1 = res.data |
| | | let { |
| | | count, |
| | | data |
| | | } = res1 |
| | | if (count > 0) { |
| | | console.log(data) |
| | | this.devices = data["h_p_sc_HDeptSouceMOList_MergeOEEReport"].map(item => { |
| | | return Object.assign(item, { |
| | | imgSrc: "../../static/sb.png" |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | | function(err) { |
| | | console.error(err) |
| | | } |
| | | ) |
| | | } |
| | | this.refreshEquipList() |
| | | |
| | | uni.stopPullDownRefresh() |
| | | } |