| | |
| | | <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="right"> |
| | | <input v-model="hform.HBarCode" @confirm="GetMessageByBarCode(hform.HBarCode)" |
| | | placeholder="请输入(或扫描)模具条码" /> |
| | | </view> |
| | | <view class="icon-wrapper" @click="toScanCode"> |
| | | <uni-icons type="scan" size="20" ></uni-icons> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">保养开始:</view> |
| | | <view class="right"> |
| | | <uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HBeginDate"> |
| | | <input :value="hform.HBeginDate" /> |
| | | </uni-datetime-picker> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">保养结束:</view> |
| | | <view class="right"> |
| | | <uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HEndDate"> |
| | | <input :value="hform.HEndDate" /> |
| | | </uni-datetime-picker> |
| | | </view> |
| | | </view> |
| | | <view class="form-item" v-if="false"> |
| | | <view class="title">数量:</view> |
| | | <view class="right"> |
| | | <input type="number" v-model="hform.HQty" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">最终结论:</view> |
| | | <view class="right none-border"> |
| | | <radio-group @change="radioChange" class="radio_Container"> |
| | | <label> |
| | | <view> |
| | | <radio value="OK" :checked="hform.HLastResult == 'OK'" /> |
| | | <text>OK</text> |
| | | </view> |
| | | </label> |
| | | </label> |
| | | <view> |
| | | <radio value="NG" :checked="hform.HLastResult == 'NG'" /> |
| | | <text>NG</text> |
| | | </view> |
| | | </label> |
| | | </radio-group> |
| | | </view> |
| | | </view> |
| | | <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">备注:</view> |
| | | <view class="right"> |
| | | <input v-model="hform.HRemark" placeholder="请输入备注" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title required">模具名称:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HBarName" disabled /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">模具规格:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HBarSpec" disabled /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">模具型号:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HBarModel" disabled /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">保养计划:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HPlanNo" disabled /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">保养级别:</view> |
| | | <zxz-uni-data-select class="right" :localdata="HMaintainLevList" dataKey="保养级别名称" |
| | | dataValue="HItemID" v-model="hform.HMaintainLevID"> |
| | | </zxz-uni-data-select> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <!-- 明细信息 --> |
| | | <template v-if="tabs == 1"> |
| | | <view class="form"> |
| | | <view class="form-item"> |
| | | <view class="left"> |
| | | 模具保养规程 |
| | | </view> |
| | | <view class="right"> |
| | | <input type="text" :value="hform.HMouldMaintainRuleInterNo" /> |
| | | </view> |
| | | <view class="icon-wrapper" @click="toCheckFile"> |
| | | <uni-icons type="search" size="20" ></uni-icons> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="list" v-for="(item,index) in HCheckFileList" :key="index"> |
| | | <uni-card style="margin: 10px;"> |
| | | <view class="card-detail"> |
| | | <view class="detail"> |
| | | <text>序号:</text>{{index+1}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>结果:</text> |
| | | <checkbox-group style="display: inline-block;" |
| | | @change="checkBoxChangeHandler(index, $event)"> |
| | | <checkbox value="enabled" :checked="item.HMaintainResult" /> |
| | | </checkbox-group> |
| | | </view> |
| | | <view class="detail" v-if="false"> |
| | | <text>保养项目ID:</text>{{item.HMaintainItemID}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>保养项目:</text>{{item.HMaintainItem}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>保养部位:</text>{{item.HMaintainPart}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>具体要求:</text>{{item.HClaim}} |
| | | </view> |
| | | <view class="detail" v-if="false"> |
| | | <text>负责人ID:</text>{{item.HManagerID}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>负责人名称:</text>{{item.HManagerName}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>备注:</text>{{item.HRemark}} |
| | | </view> |
| | | <view class="detail" v-if="false"> |
| | | <text>源单ID:</text>{{item.HSourceInterID}} |
| | | </view> |
| | | <view class="detail" v-if="false"> |
| | | <text>源单子ID:</text>{{item.HSourceEntryID}} |
| | | </view> |
| | | <view class="detail" v-if="false"> |
| | | <text>源单号:</text>{{item.HSourceBillNo}} |
| | | </view> |
| | | <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="right"> |
| | | <input v-model="hform.HBarCode" @confirm="GetMessageByBarCode(hform.HBarCode)" |
| | | placeholder="请输入(或扫描)模具条码" /> |
| | | </view> |
| | | <view class="icon-wrapper" @click="toScanCode"> |
| | | <uni-icons type="scan" size="20"></uni-icons> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">保养开始:</view> |
| | | <view class="right"> |
| | | <uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HBeginDate"> |
| | | <input :value="hform.HBeginDate" /> |
| | | </uni-datetime-picker> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">保养结束:</view> |
| | | <view class="right"> |
| | | <uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HEndDate"> |
| | | <input :value="hform.HEndDate" /> |
| | | </uni-datetime-picker> |
| | | </view> |
| | | </view> |
| | | <view class="form-item" v-if="false"> |
| | | <view class="title">数量:</view> |
| | | <view class="right"> |
| | | <input type="number" v-model="hform.HQty" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">最终结论:</view> |
| | | <view class="right none-border"> |
| | | <radio-group @change="radioChange" class="radio_Container"> |
| | | <label> |
| | | <view> |
| | | <radio value="OK" :checked="hform.HLastResult == 'OK'" /> |
| | | <text>OK</text> |
| | | </view> |
| | | </label> |
| | | </label> |
| | | <view> |
| | | <radio value="NG" :checked="hform.HLastResult == 'NG'" /> |
| | | <text>NG</text> |
| | | </view> |
| | | </label> |
| | | </radio-group> |
| | | </view> |
| | | </view> |
| | | <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">备注:</view> |
| | | <view class="right"> |
| | | <input v-model="hform.HRemark" placeholder="请输入备注" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title required">模具名称:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HBarName" disabled /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">模具规格:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HBarSpec" disabled /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">模具型号:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HBarModel" disabled /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">保养计划:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HPlanNo" disabled /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">保养级别:</view> |
| | | <zxz-uni-data-select class="right" :localdata="HMaintainLevList" dataKey="保养级别名称" |
| | | dataValue="HItemID" v-model="hform.HMaintainLevID"> |
| | | </zxz-uni-data-select> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <!-- 明细信息 --> |
| | | <template v-if="tabs == 1"> |
| | | <view class="form"> |
| | | <view class="form-item"> |
| | | <view class="left"> |
| | | 模具保养规程 |
| | | </view> |
| | | <view class="right"> |
| | | <input type="text" :value="hform.HMouldMaintainRuleInterNo" /> |
| | | </view> |
| | | <view class="icon-wrapper" @click="toCheckFile"> |
| | | <uni-icons type="search" size="20"></uni-icons> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="list" v-for="(item,index) in HCheckFileList" :key="index"> |
| | | <uni-card style="margin: 10px;"> |
| | | <view class="card-detail"> |
| | | <view class="detail"> |
| | | <text>序号:</text>{{index+1}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>结果:</text> |
| | | <checkbox-group style="display: inline-block;" |
| | | @change="checkBoxChangeHandler(index, $event)"> |
| | | <checkbox value="enabled" :checked="item.HMaintainResult" /> |
| | | </checkbox-group> |
| | | </view> |
| | | <view class="detail" v-if="false"> |
| | | <text>保养项目ID:</text>{{item.HMaintainItemID}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>保养项目:</text>{{item.HMaintainItem}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>保养部位:</text>{{item.HMaintainPart}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>具体要求:</text>{{item.HClaim}} |
| | | </view> |
| | | <view class="detail" v-if="false"> |
| | | <text>负责人ID:</text>{{item.HManagerID}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>负责人名称:</text>{{item.HManagerName}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>备注:</text>{{item.HRemark}} |
| | | </view> |
| | | <view class="detail" v-if="false"> |
| | | <text>源单ID:</text>{{item.HSourceInterID}} |
| | | </view> |
| | | <view class="detail" v-if="false"> |
| | | <text>源单子ID:</text>{{item.HSourceEntryID}} |
| | | </view> |
| | | <view class="detail" v-if="false"> |
| | | <text>源单号:</text>{{item.HSourceBillNo}} |
| | | </view> |
| | | |
| | | </view> |
| | | </uni-card> |
| | | </view> |
| | | <view class="over" v-if="HCheckFileList.length == 0">暂无数据</view> |
| | | <view style="height: 120rpx;"></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> |
| | | </view> |
| | | </uni-card> |
| | | </view> |
| | | <view class="over" v-if="HCheckFileList.length == 0">暂无数据</view> |
| | | <view style="height: 120rpx;"></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> |
| | | <!-- 附件信息 --> |
| | | <template v-if="tabs == 3"> |
| | | <view class="card-item-wrapper"> |
| | | <view class="attachment-btns"> |
| | | <button type="primary" size="mini" @tap="fileUpload">选择文件</button> |
| | | <view style="flex: 1;"></view> |
| | | </view> |
| | | <view v-for="(item, index) in attachmentInfo" :key="index"> |
| | | <uni-card :title="item['fileName']" :thumbnail="item.filePath"> |
| | | <view class="card-detail"> |
| | | <view class="detail"> |
| | | <text>大小:</text>{{item["size"]}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>状态:</text>{{item["status"]}} |
| | | </view> |
| | | <view class="detail operation" v-if="item['status']!='上传成功'"> |
| | | <text>操作:</text> |
| | | <button class="btn-a" size="mini" @tap.stop="uploadFile(index)">上传</button> |
| | | <button class="btn-b" size="mini" @tap.stop="delFile(index)">删除</button> |
| | | </view> |
| | | </view> |
| | | </uni-card> |
| | | </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> |
| | | <!-- 附件信息 --> |
| | | <template v-if="tabs == 3"> |
| | | <view class="card-item-wrapper"> |
| | | <view class="attachment-btns"> |
| | | <button type="primary" size="mini" @tap="fileUpload">选择文件</button> |
| | | <view style="flex: 1;"></view> |
| | | </view> |
| | | <view v-for="(item, index) in attachmentInfo" :key="index"> |
| | | <uni-card :title="item['fileName']" :thumbnail="item.filePath"> |
| | | <view class="card-detail"> |
| | | <view class="detail"> |
| | | <text>大小:</text>{{item["size"]}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>状态:</text>{{item["status"]}} |
| | | </view> |
| | | <view class="detail operation" v-if="item['status']!='上传成功'"> |
| | | <text>操作:</text> |
| | | <button class="btn-a" size="mini" @tap.stop="uploadFile(index)">上传</button> |
| | | <button class="btn-b" size="mini" @tap.stop="delFile(index)">删除</button> |
| | | </view> |
| | | </view> |
| | | </uni-card> |
| | | </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"; |
| | | import { |
| | | TrackOpTypes |
| | | } from "vue"; |
| | | export default { |
| | | name: 'Sc_MouldMaintainBill', |
| | | data() { |
| | | return { |
| | | tabs: 0, |
| | | HMainSourceBillType: "", |
| | | btnTop: 0, |
| | | tabsBottom: 0, |
| | | HModName: "Sc_MouldMaintainBill", |
| | | HBillType: '3819', |
| | | operationType: 1, |
| | | uploadOptions: {}, |
| | | import dayjs from "dayjs"; |
| | | import { |
| | | CommonUtils |
| | | } from "@/utils/common"; |
| | | import { |
| | | MpaasScan |
| | | } from "@/utils/mpaasScan.js" |
| | | import { |
| | | getUserInfo |
| | | } from "../../../utils/auth"; |
| | | import { |
| | | TrackOpTypes |
| | | } from "vue"; |
| | | export default { |
| | | name: 'Sc_MouldMaintainBill', |
| | | data() { |
| | | return { |
| | | tabs: 0, |
| | | HMainSourceBillType: "", |
| | | btnTop: 0, |
| | | tabsBottom: 0, |
| | | HModName: "Sc_MouldMaintainBill", |
| | | HBillType: '3819', |
| | | operationType: 1, |
| | | uploadOptions: {}, |
| | | |
| | | HMaintainLevList: [], |
| | | HCheckFileList: [], |
| | | attachmentInfo: [], |
| | | HMaintainLevList: [], |
| | | HCheckFileList: [], |
| | | attachmentInfo: [], |
| | | |
| | | hform: { |
| | | HBarCode: "", |
| | | HBeginDate: dayjs(new Date()).format("YYYY-MM-DD"), |
| | | HEndDate: dayjs(new Date()).format("YYYY-MM-DD"), |
| | | HQty: 1, |
| | | HBillNo: "", |
| | | HInterID: 0, |
| | | HDate: dayjs(new Date()).format("YYYY-MM-DD"), |
| | | HMaintainLevName: "", |
| | | HMaintainLevID: 0, |
| | | HRemark: "", |
| | | HBarName: "", |
| | | HMouldID: 0, |
| | | HBarSpec: "", |
| | | HBarModel: "", |
| | | HPlanNo: "", |
| | | HPlanInterID: 0, |
| | | HMouldMaintainRuleInterID: 0, |
| | | HMouldMaintainRuleInterNo: "", |
| | | HRequestComDate: dayjs(new Date()).format("YYYY-MM-DD"), |
| | | HRecentMainModule: 0, |
| | | HCumulativeModule: 0, |
| | | HProductionModule: 0, |
| | | HExplanation: "", |
| | | HInnerBillNo: "", |
| | | HMainSourceInterID: 0, |
| | | HMainSourceEntryID: 0, |
| | | HMainSourceBillNo: "", |
| | | HMaker: getUserInfo()['Czymc'], |
| | | HMakeDate: dayjs(new Date()).format("YYYY-MM-DD"), |
| | | HUpDater: "", |
| | | HUpDateDate: "", |
| | | HChecker: "", |
| | | HCheckDate: "", |
| | | HDeleteMan: "", |
| | | HDeleteDate: "", |
| | | lngBillKey: 0, |
| | | lngBillSubKey: 0, |
| | | HLastResult: "OK" |
| | | } |
| | | }; |
| | | }, |
| | | computed: { |
| | | containerHeight: { |
| | | get() { |
| | | return this.btnTop - this.tabsBottom - 5 |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | addNew() { |
| | | uni.redirectTo({ |
| | | url: "./Sc_MouldMaintainBill?operationType=1" |
| | | }) |
| | | }, |
| | | goBack() { |
| | | uni.navigateBack() |
| | | }, |
| | | checkBoxChangeHandler(index, e) { |
| | | let cr = e.detail.value |
| | | if (cr.length == 0) { |
| | | this.HCheckFileList[index]["HMaintainResult"] = false |
| | | } else { |
| | | this.HCheckFileList[index]["HMaintainResult"] = true |
| | | } |
| | | }, |
| | | uploadFile(index) { |
| | | console.log('filePath: ', this.attachmentInfo[index].filePath); |
| | | // 通过临时路径读取文件 |
| | | uni.uploadFile({ |
| | | url: CommonUtils.getServerUrl() + "/Sc_MouldMaintainBill/UploadFile", |
| | | filePath: this.attachmentInfo[index].filePath, |
| | | name: 'file', |
| | | formData: { |
| | | HBillNo: this.hform.HBillNo, |
| | | HRemark: "", |
| | | HUserName: getUserInfo()["Czymc"] |
| | | }, |
| | | success: (uploadRes) => { |
| | | CommonUtils.showTips({ |
| | | message: "上传成功" |
| | | }) |
| | | this.attachmentInfo[index].status = "上传成功" |
| | | }, |
| | | fail: (err) => { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `上传失败: ${err}` |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | delFile(index) { |
| | | console.log('attachmentInfo: ', this.attachmentInfo[index]); |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: '确认要删除 " ' + this.attachmentInfo[index].fileName + ' " 删除后将不可恢复!', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | this.attachmentInfo.splice(index, 1) |
| | | } |
| | | }, |
| | | }) |
| | | hform: { |
| | | HBarCode: "", |
| | | HBeginDate: dayjs(new Date()).format("YYYY-MM-DD"), |
| | | HEndDate: dayjs(new Date()).format("YYYY-MM-DD"), |
| | | HQty: 1, |
| | | HBillNo: "", |
| | | HInterID: 0, |
| | | HDate: dayjs(new Date()).format("YYYY-MM-DD"), |
| | | HMaintainLevName: "", |
| | | HMaintainLevID: 0, |
| | | HRemark: "", |
| | | HBarName: "", |
| | | HMouldID: 0, |
| | | HBarSpec: "", |
| | | HBarModel: "", |
| | | HPlanNo: "", |
| | | HPlanInterID: 0, |
| | | HMouldMaintainRuleInterID: 0, |
| | | HMouldMaintainRuleInterNo: "", |
| | | HRequestComDate: dayjs(new Date()).format("YYYY-MM-DD"), |
| | | HRecentMainModule: 0, |
| | | HCumulativeModule: 0, |
| | | HProductionModule: 0, |
| | | HExplanation: "", |
| | | HInnerBillNo: "", |
| | | HMainSourceInterID: 0, |
| | | HMainSourceEntryID: 0, |
| | | HMainSourceBillNo: "", |
| | | HMaker: getUserInfo()['Czymc'], |
| | | HMakeDate: dayjs(new Date()).format("YYYY-MM-DD"), |
| | | HUpDater: "", |
| | | HUpDateDate: "", |
| | | HChecker: "", |
| | | HCheckDate: "", |
| | | HDeleteMan: "", |
| | | HDeleteDate: "", |
| | | lngBillKey: 0, |
| | | lngBillSubKey: 0, |
| | | HLastResult: "OK" |
| | | } |
| | | }; |
| | | }, |
| | | computed: { |
| | | containerHeight: { |
| | | get() { |
| | | return this.btnTop - this.tabsBottom - 5 |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | addNew() { |
| | | uni.redirectTo({ |
| | | url: "./Sc_MouldMaintainBill?operationType=1" |
| | | }) |
| | | }, |
| | | goBack() { |
| | | uni.navigateBack() |
| | | }, |
| | | checkBoxChangeHandler(index, e) { |
| | | let cr = e.detail.value |
| | | if (cr.length == 0) { |
| | | this.HCheckFileList[index]["HMaintainResult"] = false |
| | | } else { |
| | | this.HCheckFileList[index]["HMaintainResult"] = true |
| | | } |
| | | }, |
| | | uploadFile(index) { |
| | | console.log('filePath: ', this.attachmentInfo[index].filePath); |
| | | // 通过临时路径读取文件 |
| | | uni.uploadFile({ |
| | | url: CommonUtils.getServerUrl() + "/Sc_MouldMaintainBill/UploadFile", |
| | | filePath: this.attachmentInfo[index].filePath, |
| | | name: 'file', |
| | | formData: { |
| | | HBillNo: this.hform.HBillNo, |
| | | HRemark: "", |
| | | HUserName: getUserInfo()["Czymc"] |
| | | }, |
| | | success: (uploadRes) => { |
| | | CommonUtils.showTips({ |
| | | message: "上传成功" |
| | | }) |
| | | this.attachmentInfo[index].status = "上传成功" |
| | | }, |
| | | fail: (err) => { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `上传失败: ${err}` |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | delFile(index) { |
| | | console.log('attachmentInfo: ', this.attachmentInfo[index]); |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: '确认要删除 " ' + this.attachmentInfo[index].fileName + ' " 删除后将不可恢复!', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | this.attachmentInfo.splice(index, 1) |
| | | } |
| | | }, |
| | | }) |
| | | |
| | | }, |
| | | handleUploadCallback(res) { // 文件上传回调 |
| | | console.log('file: ', res); |
| | | let fileInfo = res.data[0] |
| | | this.attachmentInfo.push({ |
| | | fileName: fileInfo.name, |
| | | size: fileInfo.size, |
| | | status: '等待上传', |
| | | filePath: fileInfo.tempFilePath |
| | | }) |
| | | }, |
| | | // 上传文件 |
| | | fileUpload() { |
| | | this.$refs.XeUpload.upload('file', {}); |
| | | }, |
| | | //获取保养级别数据 |
| | | async getHMaintainLevList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Gy_BadReason/Gy_MaintainLevList', |
| | | data: { |
| | | sWhere: " and HUSEORGID = " + uni.getStorageSync('OrganizationID'), |
| | | user: uni.getStorageSync('HUserName') |
| | | } |
| | | }) |
| | | }, |
| | | handleUploadCallback(res) { // 文件上传回调 |
| | | console.log('file: ', res); |
| | | let fileInfo = res.data[0] |
| | | this.attachmentInfo.push({ |
| | | fileName: fileInfo.name, |
| | | size: fileInfo.size, |
| | | status: '等待上传', |
| | | filePath: fileInfo.tempFilePath |
| | | }) |
| | | }, |
| | | // 上传文件 |
| | | fileUpload() { |
| | | this.$refs.XeUpload.upload('file', {}); |
| | | }, |
| | | //获取保养级别数据 |
| | | async getHMaintainLevList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Gy_BadReason/Gy_MaintainLevList', |
| | | data: { |
| | | sWhere: " and HUSEORGID = " + uni.getStorageSync('OrganizationID'), |
| | | user: uni.getStorageSync('HUserName') |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HMaintainLevList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | toScanCode() { |
| | | MpaasScan.scanCode(cb => { |
| | | this.hform.HBarCode = cb |
| | | this.GetMessageByBarCode(cb) |
| | | }) |
| | | }, |
| | | async GetMessageByBarCode(HBarCode) { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: "/QJ_PDA_MouldDotCheckBill/txtHBarCode_KeyDown", |
| | | data: { |
| | | HBarCode: HBarCode, |
| | | user: uni.getStorageSync('HUserName') |
| | | }, |
| | | }) |
| | | if (!res) { |
| | | return |
| | | } |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HMaintainLevList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | toScanCode() { |
| | | MpaasScan.scanCode(cb => { |
| | | this.hform.HBarCode = cb |
| | | this.GetMessageByBarCode(cb) |
| | | }) |
| | | }, |
| | | async GetMessageByBarCode(HBarCode) { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: "/QJ_PDA_MouldDotCheckBill/txtHBarCode_KeyDown", |
| | | data: { |
| | | HBarCode: HBarCode, |
| | | user: uni.getStorageSync('HUserName') |
| | | }, |
| | | }) |
| | | if (!res) { |
| | | return |
| | | } |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | |
| | | console.log('data: ', data); |
| | | this.hform.HMouldID = data[0].HInterID |
| | | this.hform.HBarName = data[0].HName |
| | | this.hform.HBarSpec = data[0].HModel |
| | | this.hform.HBarModel = data[0].HModel2 |
| | | this.hform.HQty = 1 |
| | | // 获取检验规程 |
| | | this.GetItemByMouldFile() |
| | | } catch (err) { |
| | | console.log('data: ', data); |
| | | this.hform.HMouldID = data[0].HInterID |
| | | this.hform.HBarName = data[0].HName |
| | | this.hform.HBarSpec = data[0].HModel |
| | | this.hform.HBarModel = data[0].HModel2 |
| | | this.hform.HQty = 1 |
| | | // 获取保养规程 |
| | | await this.GetItemByMouldFile() |
| | | } catch (err) { |
| | | |
| | | } |
| | | }, |
| | | async GetItemByMouldFile() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Web/GetItemByMouldFile", |
| | | data: { |
| | | "MouldProjectID": this.hform.HMouldID, |
| | | "Type": "BY", |
| | | "HDate": this.hform.HBeginDate |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | async GetItemByMouldFile() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Web/GetItemByMouldFile", |
| | | data: { |
| | | "MouldProjectID": this.hform.HMouldID, |
| | | "Type": "BY", |
| | | "HDate": this.hform.HBeginDate |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | Message, |
| | | count |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.hform.HMouldMaintainRuleInterID = data[0].HMouldMaintainRuleID |
| | | this.hform.HMouldMaintainRuleInterNo = data[0].器具保养规程 |
| | | this.hform.HPlanNo = data[0].单据号 |
| | | this.hform.HMouldMaintainPlanInterID = (data[0].hmainid == null ? 0 : data[0].hmainid) == |
| | | "" ? |
| | | 0 : data[0].hmainid |
| | | this.hform.HMouldMaintainPlanEntryID = (data[0].HEntryID == null ? 0 : data[0].HEntryID) == |
| | | "" ? 0 : data[0].HEntryID |
| | | let { |
| | | data, |
| | | Message, |
| | | count |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.hform.HMouldMaintainRuleInterID = data[0].HMouldMaintainRuleID |
| | | this.hform.HMouldMaintainRuleInterNo = data[0].器具保养规程 |
| | | this.hform.HPlanNo = data[0].单据号 |
| | | this.hform.HMouldMaintainPlanInterID = (data[0].hmainid == null ? 0 : data[0].hmainid) == |
| | | "" ? |
| | | 0 : data[0].hmainid |
| | | this.hform.HMouldMaintainPlanEntryID = (data[0].HEntryID == null ? 0 : data[0].HEntryID) == |
| | | "" ? 0 : data[0].HEntryID |
| | | |
| | | this.HCheckFileList = Array.from(data).map(item => { |
| | | return { |
| | | // "HMaintainResult": item.默认结论 == 1 ? true : false, |
| | | "HMaintainItemID": item.保养项目ID, |
| | | "HMaintainItem": item.保养项目名称, |
| | | "HMaintainPart": item.保养部位, // 修改字段名 |
| | | "HClaim": item.具体要求, |
| | | "HManagerID": item.负责人ID, |
| | | "HManagerName": item.负责人名称, |
| | | "HSourceInterID": item.hmainid == null ? 0 : item.hmainid, // 需确认是否正确 |
| | | "HSourceEntryID": item.HEntryID == null ? 0 : item.HEntryID, // 需确认是否正确 |
| | | "HSourceBillNo": item.单据号, // 需确认是否正确 |
| | | "HMaintainResult": item.默认保养结果 == 'OK' ? true : false |
| | | } |
| | | }) |
| | | this.HCheckFileList = Array.from(data).map(item => { |
| | | return { |
| | | // "HMaintainResult": item.默认结论 == 1 ? true : false, |
| | | "HMaintainItemID": item.保养项目ID, |
| | | "HMaintainItem": item.保养项目名称, |
| | | "HMaintainPart": item.保养部位, // 修改字段名 |
| | | "HClaim": item.具体要求, |
| | | "HManagerID": item.负责人ID, |
| | | "HManagerName": item.负责人名称, |
| | | "HSourceInterID": item.hmainid == null ? 0 : item.hmainid, // 需确认是否正确 |
| | | "HSourceEntryID": item.HEntryID == null ? 0 : item.HEntryID, // 需确认是否正确 |
| | | "HSourceBillNo": item.单据号, // 需确认是否正确 |
| | | "HMaintainResult": item.默认保养结果 == 'OK' ? true : false |
| | | } |
| | | }) |
| | | |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `获取保养规程错误: ${Message}` |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `获取保养规程错误: ${err}` |
| | | }) |
| | | } |
| | | }, |
| | | toCheckFile() { |
| | | // 判断是否已扫描模具 |
| | | if (!this.hform.HMouldID || this.hform.HMouldID == 0) { |
| | | uni.showToast({ |
| | | title: '请先扫描模具二维码带出模具信息', |
| | | icon: 'none' |
| | | }); |
| | | return; |
| | | } |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `获取保养规程错误: ${Message}` |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `获取保养规程错误: ${err}` |
| | | }) |
| | | } |
| | | }, |
| | | toCheckFile() { |
| | | // 判断是否已扫描模具 |
| | | if (!this.hform.HMouldID || this.hform.HMouldID == 0) { |
| | | uni.showToast({ |
| | | title: '请先扫描模具二维码带出模具信息', |
| | | icon: 'none' |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | // 打开保养规程选择页面 |
| | | uni.navigateTo({ |
| | | url: '/pages/MJGL/mujubaoyangjiludan/Sc_MouldMaintainRuleBillList?mouldId=' + this.hform |
| | | .HMouldID, |
| | | success: (res) => { |
| | | // 通过事件通道监听返回的数据 |
| | | res.eventChannel.on('selectedPlanData', (data) => { |
| | | console.log('接收到选择的数据:', data); |
| | | // 赋值字段 |
| | | this.hform.HMouldMaintainRuleInterNo = data.单据号; |
| | | this.hform.HMouldMaintainRuleInterID = data.hmainid; |
| | | this.hform.HPlanNo = data.保养计划号 == null ? "" : data.保养计划号; |
| | | this.hform.HPlanInterID = data.保养计划id == null ? 0 : data.保养计划id, |
| | | this.hform.HMouldMaintainPlanInterID = data.保养计划id == null ? 0 : |
| | | data.保养计划id; |
| | | this.hform.HMouldMaintainPlanEntryID = data.保养计划子id == null ? 0 : data |
| | | .保养计划子id; |
| | | this.hform.HMainSourceBillNo = data.保养计划号 == null ? "" : data.保养计划号; |
| | | this.hform.HMaintainLevName = data.保养级别; |
| | | this.hform.HMaintainLevID = data.HMaintainLevID; |
| | | // 打开保养规程选择页面 |
| | | uni.navigateTo({ |
| | | url: '/pages/MJGL/mujubaoyangjiludan/Sc_MouldMaintainRuleBillList?mouldId=' + this.hform |
| | | .HMouldID, |
| | | success: (res) => { |
| | | // 通过事件通道监听返回的数据 |
| | | res.eventChannel.on('selectedPlanData', (data) => { |
| | | console.log('接收到选择的数据:', data); |
| | | // 赋值字段 |
| | | this.hform.HMouldMaintainRuleInterNo = data.单据号; |
| | | this.hform.HMouldMaintainRuleInterID = data.hmainid; |
| | | this.hform.HPlanNo = data.保养计划号 == null ? "" : data.保养计划号; |
| | | this.hform.HPlanInterID = data.保养计划id == null ? 0 : data.保养计划id, |
| | | this.hform.HMouldMaintainPlanInterID = data.保养计划id == null ? 0 : |
| | | data.保养计划id; |
| | | this.hform.HMouldMaintainPlanEntryID = data.保养计划子id == null ? 0 : data |
| | | .保养计划子id; |
| | | this.hform.HMainSourceBillNo = data.保养计划号 == null ? "" : data.保养计划号; |
| | | this.hform.HMaintainLevName = data.保养级别; |
| | | this.hform.HMaintainLevID = data.HMaintainLevID; |
| | | |
| | | // 调用获取保养项目的方法 |
| | | this.get_MaintainItem2(); |
| | | }); |
| | | // 调用获取保养项目的方法 |
| | | this.get_MaintainItem2(); |
| | | }); |
| | | |
| | | res.eventChannel.on('closePage', () => { |
| | | console.log('关闭选择页面'); |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | res.eventChannel.on('closePage', () => { |
| | | console.log('关闭选择页面'); |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 获取保养规则项目 |
| | | async get_MaintainItem2() { |
| | | try { |
| | | // 验证是否已选择保养规程 |
| | | if (!this.hform.HMouldMaintainRuleInterID || this.hform.HMouldMaintainRuleInterID == 0) { |
| | | uni.showToast({ |
| | | title: '请先选择保养规程', |
| | | icon: 'none' |
| | | }); |
| | | return; |
| | | } |
| | | // 获取保养规则项目 |
| | | async get_MaintainItem2() { |
| | | try { |
| | | // 验证是否已选择保养规程 |
| | | if (!this.hform.HMouldMaintainRuleInterID || this.hform.HMouldMaintainRuleInterID == 0) { |
| | | uni.showToast({ |
| | | title: '请先选择保养规程', |
| | | icon: 'none' |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Web/GetMaintainItemByMaintainRuleID/Mould', |
| | | data: { |
| | | "HMouldMaintainRuleInterID": this.hform.HMouldMaintainRuleInterID |
| | | } |
| | | }); |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Web/GetMaintainItemByMaintainRuleID/Mould', |
| | | data: { |
| | | "HMouldMaintainRuleInterID": this.hform.HMouldMaintainRuleInterID |
| | | } |
| | | }); |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data; |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data; |
| | | |
| | | if (count == 1) { |
| | | if (data && data.length > 0) { |
| | | this.HCheckFileList = Array.from(data).map(item => { |
| | | return { |
| | | "HMaintainItemID": item.HMaintainItemID || 0, |
| | | "HMaintainItem": item.保养项目 || "", |
| | | "HMaintainPart": item.保养部位 || "", |
| | | "HClaim": item.具体要求 || "", |
| | | "HManagerID": item.负责人ID || 0, |
| | | "HManagerCode": item.负责人代码 || "", |
| | | "HManagerName": item.负责人名称 || "", |
| | | "HMaintainResult": item.默认保养结果 == 'OK' ? true : false, |
| | | "HRemark": item.表体备注 || "", |
| | | }; |
| | | }); |
| | | } else { |
| | | this.HCheckFileList = []; |
| | | uni.showToast({ |
| | | title: '该保养规程暂无保养项目记录', |
| | | icon: 'none' |
| | | }); |
| | | } |
| | | } else { |
| | | this.HCheckFileList = []; |
| | | uni.showToast({ |
| | | title: Message || '获取保养项目失败', |
| | | icon: 'none' |
| | | }); |
| | | } |
| | | } catch (err) { |
| | | this.HCheckFileList = []; |
| | | uni.showToast({ |
| | | title: `获取保养项目失败: ${err}`, |
| | | icon: 'none' |
| | | }); |
| | | } |
| | | }, |
| | | radioChange(e) { |
| | | console.log('radioChange:', e.detail.value); |
| | | this.hform.HLastResult = e.detail.value; |
| | | }, |
| | | getEditData(hmainid) { |
| | | // 主表数据 |
| | | uni.request({ |
| | | url: CommonUtils.getServerUrl() + |
| | | '/Sc_MouldMaintainBill/Sc_MouldMaintainBillListCheckDetai', |
| | | data: { |
| | | HID: hmainid |
| | | }, |
| | | success: (res) => { |
| | | console.log('编辑接口返回数据:', res.data); |
| | | if (res.data.code == 1) { |
| | | var data = res.data.data.h_v_Sc_MouldMaintain[0]; |
| | | this.hform = { |
| | | HInterID: hmainid, |
| | | HBillNo: data.单据号, |
| | | HDate: data.日期.substr(0, 10), |
| | | HMouldID: data.HMouldID || 0, |
| | | HBarCode: data.模具条码 || "", |
| | | HBarName: data.产品模具 || "", |
| | | HBarSpec: data.模具规格 || "", |
| | | HBarModel: data.模具型号 || "", |
| | | HPlanNo: data.保养计划编号 || "", |
| | | HPlanInterID: data.保养计划内码 || 0, |
| | | HBeginDate: data.保养开始日期 ? data.保养开始日期.substr(0, 10) : dayjs(new Date()) |
| | | .format("YYYY-MM-DD HH:mm:ss"), |
| | | HEndDate: data.保养结束日期 ? data.保养结束日期.substr(0, 10) : dayjs(new Date()) |
| | | .format("YYYY-MM-DD HH:mm:ss"), |
| | | HLastResult: data.最终结论 === '合格' ? 'OK' : (data.最终结论 === '不合格' ? 'NG' : |
| | | 'OK'), |
| | | HMouldMaintainRuleInterID: data.HMouldMaintainRuleInterID || 0, |
| | | HMouldMaintainRuleInterNo: data.器具保养规程 || "", |
| | | HRemark: data.备注 || "", |
| | | HMaintainLevID: data.HMaintainLevID || 0, |
| | | HMaintainLevName: data.保养级别名称 || "", |
| | | HQty: data.数量 || 1, |
| | | HMaker: data.制单人 || getUserInfo()['Czymc'], |
| | | HMakeDate: data.制单日期 ? data.制单日期.substr(0, 10) : dayjs(new Date()) |
| | | .format( |
| | | "YYYY-MM-DD"), |
| | | HUpDater: data.修改人 || "", |
| | | HUpDateDate: data.修改日期 ? data.修改日期.substr(0, 10) : "", |
| | | HChecker: data.审核人 || "", |
| | | HCheckDate: data.审核日期 ? data.审核日期.substr(0, 10) : "", |
| | | HDeleteMan: data.作废人 || "", |
| | | HDeleteDate: data.作废日期 ? data.作废日期.substr(0, 10) : "", |
| | | lngBillKey: 0, |
| | | lngBillSubKey: 0, |
| | | HInnerBillNo: data.内部单据号 || "", |
| | | HExplanation: data.摘要 || "", |
| | | HRequestComDate: data.要求完成日期 ? data.要求完成日期.substr(0, 10) : "", |
| | | HRecentMainModule: data.最近保养模数 || 0, |
| | | HCumulativeModule: data.累计模数 || 0, |
| | | HProductionModule: data.本次生产模数 || 0 |
| | | }; |
| | | if (count == 1) { |
| | | if (data && data.length > 0) { |
| | | this.HCheckFileList = Array.from(data).map(item => { |
| | | return { |
| | | "HMaintainItemID": item.HMaintainItemID || 0, |
| | | "HMaintainItem": item.保养项目 || "", |
| | | "HMaintainPart": item.保养部位 || "", |
| | | "HClaim": item.具体要求 || "", |
| | | "HManagerID": item.负责人ID || 0, |
| | | "HManagerCode": item.负责人代码 || "", |
| | | "HManagerName": item.负责人名称 || "", |
| | | "HMaintainResult": item.默认保养结果 == 'OK' ? true : false, |
| | | "HRemark": item.表体备注 || "", |
| | | }; |
| | | }); |
| | | } else { |
| | | this.HCheckFileList = []; |
| | | uni.showToast({ |
| | | title: '该保养规程暂无保养项目记录', |
| | | icon: 'none' |
| | | }); |
| | | } |
| | | } else { |
| | | this.HCheckFileList = []; |
| | | uni.showToast({ |
| | | title: Message || '获取保养项目失败', |
| | | icon: 'none' |
| | | }); |
| | | } |
| | | } catch (err) { |
| | | this.HCheckFileList = []; |
| | | uni.showToast({ |
| | | title: `获取保养项目失败: ${err}`, |
| | | icon: 'none' |
| | | }); |
| | | } |
| | | }, |
| | | radioChange(e) { |
| | | console.log('radioChange:', e.detail.value); |
| | | this.hform.HLastResult = e.detail.value; |
| | | }, |
| | | getEditData(hmainid) { |
| | | // 主表数据 |
| | | uni.request({ |
| | | url: CommonUtils.getServerUrl() + |
| | | '/Sc_MouldMaintainBill/Sc_MouldMaintainBillListCheckDetai', |
| | | data: { |
| | | HID: hmainid |
| | | }, |
| | | success: (res) => { |
| | | console.log('编辑接口返回数据:', res.data); |
| | | if (res.data.code == 1) { |
| | | var data = res.data.data.h_v_Sc_MouldMaintain[0]; |
| | | this.hform = { |
| | | HInterID: hmainid, |
| | | HBillNo: data.单据号, |
| | | HDate: data.日期.substr(0, 10), |
| | | HMouldID: data.HMouldID || 0, |
| | | HBarCode: data.模具条码 || "", |
| | | HBarName: data.产品模具 || "", |
| | | HBarSpec: data.模具规格 || "", |
| | | HBarModel: data.模具型号 || "", |
| | | HPlanNo: data.保养计划编号 || "", |
| | | HPlanInterID: data.保养计划内码 || 0, |
| | | HBeginDate: data.保养开始日期 ? data.保养开始日期.substr(0, 10) : dayjs(new Date()) |
| | | .format("YYYY-MM-DD HH:mm:ss"), |
| | | HEndDate: data.保养结束日期 ? data.保养结束日期.substr(0, 10) : dayjs(new Date()) |
| | | .format("YYYY-MM-DD HH:mm:ss"), |
| | | HLastResult: data.最终结论 === '合格' ? 'OK' : (data.最终结论 === '不合格' ? 'NG' : |
| | | 'OK'), |
| | | HMouldMaintainRuleInterID: data.HMouldMaintainRuleInterID || 0, |
| | | HMouldMaintainRuleInterNo: data.器具保养规程 || "", |
| | | HRemark: data.备注 || "", |
| | | HMaintainLevID: data.HMaintainLevID || 0, |
| | | HMaintainLevName: data.保养级别名称 || "", |
| | | HQty: data.数量 || 1, |
| | | HMaker: data.制单人 || getUserInfo()['Czymc'], |
| | | HMakeDate: data.制单日期 ? data.制单日期.substr(0, 10) : dayjs(new Date()) |
| | | .format( |
| | | "YYYY-MM-DD"), |
| | | HUpDater: data.修改人 || "", |
| | | HUpDateDate: data.修改日期 ? data.修改日期.substr(0, 10) : "", |
| | | HChecker: data.审核人 || "", |
| | | HCheckDate: data.审核日期 ? data.审核日期.substr(0, 10) : "", |
| | | HDeleteMan: data.作废人 || "", |
| | | HDeleteDate: data.作废日期 ? data.作废日期.substr(0, 10) : "", |
| | | lngBillKey: 0, |
| | | lngBillSubKey: 0, |
| | | HInnerBillNo: data.内部单据号 || "", |
| | | HExplanation: data.摘要 || "", |
| | | HRequestComDate: data.要求完成日期 ? data.要求完成日期.substr(0, 10) : "", |
| | | HRecentMainModule: data.最近保养模数 || 0, |
| | | HCumulativeModule: data.累计模数 || 0, |
| | | HProductionModule: data.本次生产模数 || 0 |
| | | }; |
| | | |
| | | // 获取部门列表并设置保养级别 |
| | | if (data.HMaintainLevID) { |
| | | this.$nextTick(() => { |
| | | this.hform.HMaintainLevID = data.HMaintainLevID; |
| | | }); |
| | | } |
| | | } else { |
| | | uni.showToast({ |
| | | title: res.data.Message || '获取数据失败', |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | }, |
| | | fail: (res) => { |
| | | console.log('主表请求失败:', res); |
| | | uni.showToast({ |
| | | title: '接口请求失败', |
| | | icon: 'none' |
| | | }) |
| | | }, |
| | | complete: () => { |
| | | // 获取子表数据 |
| | | this.getSubEditData(hmainid); |
| | | } |
| | | }); |
| | | }, |
| | | // 获取部门列表并设置保养级别 |
| | | if (data.HMaintainLevID) { |
| | | this.$nextTick(() => { |
| | | this.hform.HMaintainLevID = data.HMaintainLevID; |
| | | }); |
| | | } |
| | | } else { |
| | | uni.showToast({ |
| | | title: res.data.Message || '获取数据失败', |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | }, |
| | | fail: (res) => { |
| | | console.log('主表请求失败:', res); |
| | | uni.showToast({ |
| | | title: '接口请求失败', |
| | | icon: 'none' |
| | | }) |
| | | }, |
| | | complete: () => { |
| | | // 获取子表数据 |
| | | this.getSubEditData(hmainid); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 获取子表数据 |
| | | getSubEditData(hmainid) { |
| | | uni.request({ |
| | | url: CommonUtils.getServerUrl() + |
| | | '/Sc_MouldMaintainBill/Sc_MouldMaintainBillListProjectDetaiNew', |
| | | data: { |
| | | "HInterID": hmainid |
| | | }, |
| | | success: (res) => { |
| | | console.log('子表数据:', res.data); |
| | | if (res.data.count == 1) { |
| | | this.HCheckFileList = res.data.list[0].map(item => { |
| | | const isChecked = item.HMaintainResult === '合格' ? true : false; |
| | | return { |
| | | "HMaintainItemID": item.HMaintainItemID || 0, |
| | | "HMaintainItem": item.HMaintainItem || "", |
| | | "HMaintainPart": item.HMaintainPart || "", |
| | | "HClaim": item.HClaim || "", |
| | | "HManagerID": item.HManagerID || 0, |
| | | "HManagerName": item.HManagerName || "", |
| | | "HMaintainResult": isChecked, |
| | | "HRemark": item.HManagerName || "" |
| | | }; |
| | | }); |
| | | } else { |
| | | console.log('子表数据为空或获取失败:', res.data.Message); |
| | | this.HCheckFileList = []; |
| | | } |
| | | }, |
| | | fail: (res) => { |
| | | console.log('子表请求失败:', res); |
| | | this.HCheckFileList = []; |
| | | } |
| | | }); |
| | | }, |
| | | async getMaxNum() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Web/GetMAXNum", |
| | | data: { |
| | | "HBillType": this.HBillType |
| | | } |
| | | }) |
| | | // 获取子表数据 |
| | | getSubEditData(hmainid) { |
| | | uni.request({ |
| | | url: CommonUtils.getServerUrl() + |
| | | '/Sc_MouldMaintainBill/Sc_MouldMaintainBillListProjectDetaiNew', |
| | | data: { |
| | | "HInterID": hmainid |
| | | }, |
| | | success: (res) => { |
| | | console.log('子表数据:', res.data); |
| | | if (res.data.count == 1) { |
| | | this.HCheckFileList = res.data.list[0].map(item => { |
| | | const isChecked = item.HMaintainResult === '合格' ? true : false; |
| | | return { |
| | | "HMaintainItemID": item.HMaintainItemID || 0, |
| | | "HMaintainItem": item.HMaintainItem || "", |
| | | "HMaintainPart": item.HMaintainPart || "", |
| | | "HClaim": item.HClaim || "", |
| | | "HManagerID": item.HManagerID || 0, |
| | | "HManagerName": item.HManagerName || "", |
| | | "HMaintainResult": isChecked, |
| | | "HRemark": item.HManagerName || "" |
| | | }; |
| | | }); |
| | | } else { |
| | | console.log('子表数据为空或获取失败:', res.data.Message); |
| | | this.HCheckFileList = []; |
| | | } |
| | | }, |
| | | fail: (res) => { |
| | | console.log('子表请求失败:', res); |
| | | this.HCheckFileList = []; |
| | | } |
| | | }); |
| | | }, |
| | | 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 = 0 |
| | | this.hform.HBillNo = data[0]["HBillNo"] |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "获取单据信息异常: " + err |
| | | }) |
| | | } |
| | | }, |
| | | async submit() { |
| | | if(!this.hform.HBillNo) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: '单据提交失败: 单据号不存在' |
| | | }) |
| | | return |
| | | } |
| | | |
| | | if(!this.hform.HMouldID) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: '单据提交失败: 模具不能为空' |
| | | }) |
| | | return |
| | | } |
| | | |
| | | try { |
| | | let oMain = JSON.stringify(this.hform); |
| | | let sSubStr = JSON.stringify(this.HCheckFileList); |
| | | let sMainSub = oMain + ';' + sSubStr + ';' + uni.getStorageSync('HUserName'); |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: "/Sc_MouldMaintainBill/SaveGetMouldMaintainBillListAPP", |
| | | data: { |
| | | "msg": sMainSub |
| | | }, |
| | | method: "POST" |
| | | }) |
| | | let { |
| | | count, |
| | | data, |
| | | Message |
| | | } = res.data |
| | | console.log('data: ', data); |
| | | this.hform.HInterID = 0 |
| | | this.hform.HBillNo = data[0]["HBillNo"] |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "获取单据信息异常: " + err |
| | | }) |
| | | } |
| | | }, |
| | | async submit() { |
| | | if (!this.hform.HBillNo) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: '单据提交失败: 单据号不存在' |
| | | }) |
| | | return |
| | | } |
| | | |
| | | if (!res) { |
| | | return |
| | | } |
| | | if (!this.hform.HMouldID) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: '单据提交失败: 模具不能为空' |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let { |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: res.data.Message + '。是否继续新增?(点击取消返回上级页面)', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | console.log('用户点击确定'); |
| | | uni.redirectTo({ |
| | | url: '/pages/MJGL/mujubaoyangjiludan/Sc_MouldMaintainBill?operationType=1' |
| | | }) |
| | | } else if (res.cancel) { |
| | | console.log('用户点击取消'); |
| | | setTimeout(() => { |
| | | uni.navigateBack(); |
| | | }, 50) |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "提交单据失败: " + Message |
| | | }) |
| | | } |
| | | try { |
| | | let oMain = JSON.stringify(this.hform); |
| | | let sSubStr = JSON.stringify(this.HCheckFileList); |
| | | let sMainSub = oMain + ';' + sSubStr + ';' + uni.getStorageSync('HUserName'); |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: "/Sc_MouldMaintainBill/SaveGetMouldMaintainBillListAPP", |
| | | data: { |
| | | "msg": sMainSub |
| | | }, |
| | | method: "POST" |
| | | }) |
| | | |
| | | if (!res) { |
| | | return |
| | | } |
| | | |
| | | let { |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: res.data.Message + '。是否继续新增?(点击取消返回上级页面)', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | console.log('用户点击确定'); |
| | | uni.redirectTo({ |
| | | url: '/pages/MJGL/mujubaoyangjiludan/Sc_MouldMaintainBill?operationType=1' |
| | | }) |
| | | } else if (res.cancel) { |
| | | console.log('用户点击取消'); |
| | | setTimeout(() => { |
| | | uni.navigateBack(); |
| | | }, 50) |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "提交单据失败: " + Message |
| | | }) |
| | | } |
| | | |
| | | |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "提交单据失败: " + err |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | onLoad(e) { |
| | | console.log('e: ', e); |
| | | this.getHMaintainLevList() |
| | | if (!e.operationType) { |
| | | this.operationType = 1 |
| | | } else { |
| | | this.operationType = e.operationType |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "提交单据失败: " + err |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | async onLoad(e) { |
| | | console.log('e: ', e); |
| | | this.getHMaintainLevList() |
| | | if (!e.operationType) { |
| | | this.operationType = 1 |
| | | } else { |
| | | this.operationType = e.operationType |
| | | } |
| | | |
| | | if (this.operationType == 1) { |
| | | // 新增 |
| | | this.getMaxNum() |
| | | } else if (this.operationType == 2) { |
| | | // 复制 |
| | | } else if (this.operationType == 3) { |
| | | // 编辑 |
| | | this.getEditData(e.hmainid) |
| | | } else if (this.operationType == 4) { |
| | | // 浏览 |
| | | // 下推 |
| | | let HBarCode = e.HBarCode |
| | | this.getMaxNum() |
| | | if (HBarCode) { |
| | | this.GetMessageByBarCode(HBarCode) |
| | | } |
| | | if (this.operationType == 1) { |
| | | // 新增 |
| | | this.getMaxNum() |
| | | } else if (this.operationType == 2) { |
| | | // 复制 |
| | | } else if (this.operationType == 3) { |
| | | // 编辑 |
| | | this.getEditData(e.hmainid) |
| | | } else if (this.operationType == 4) { |
| | | // 浏览 |
| | | // 下推 |
| | | let HBarCode = e.HBarCode |
| | | let HPlanHInterID = e.HPlanHInterID |
| | | let HPlanHEntryID = e.HPlanHEntryID |
| | | this.getMaxNum() |
| | | if (HBarCode) { |
| | | await this.GetMessageByBarCode(HBarCode) |
| | | if (uni.getStorageSync('Organization') == '宁波市华舟包装有限公司') { |
| | | this.hform.HMouldMaintainPlanInterID = (HPlanHInterID == null ? this.hform.HMouldMaintainPlanInterID : HPlanHInterID) == "" ? this.hform.HMouldMaintainPlanInterID : HPlanHInterID |
| | | this.hform.HMouldMaintainPlanEntryID = (HPlanHEntryID == null ? this.hform.HMouldMaintainPlanEntryID : HPlanHEntryID) == "" ? this.hform.HMouldMaintainPlanEntryID : HPlanHEntryID |
| | | } |
| | | } |
| | | |
| | | } |
| | | }, |
| | | 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) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | 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"> |
| | | @import "@/pages/MJGL/style/MJBillStyle.scss" |
| | | @import "@/pages/MJGL/style/MJBillStyle.scss" |
| | | </style> |