设备、模具保养任务 今日改为近七日 增加对应的下推任务
模具、设备维修任务 增加下推按钮 三个待派工(故障单的负责人)、待维修(故障单的维修人)、待验收(故障单发现人)
| | |
| | | "name" : "智云LMES", |
| | | "appid" : "__UNI__B002F49", |
| | | "description" : "", |
| | | "versionName" : "2.0.65", |
| | | "versionCode" : 265, |
| | | "versionName" : "2.0.66", |
| | | "versionCode" : 266, |
| | | "transformPx" : false, |
| | | /* 5+App特有相关 */ |
| | | "app-plus" : { |
| | |
| | | </view> |
| | | |
| | | <view class="op" v-if="operations == item.hmainid"> |
| | | <button class="op1" v-if="activeTab == 0" size="mini" plain @tap.stop="pushBill(0,item)">下推保养单</button> |
| | | <button class="op5" size="mini" plain @tap.stop="operations = -1">取消操作</button> |
| | | </view> |
| | | </uni-card> |
| | |
| | | activeTab: 0, |
| | | |
| | | tabs: [{ |
| | | label: '今日待保养', |
| | | label: '近日待保养', |
| | | type: 0, |
| | | count: 0, |
| | | listData: [], // 添加这个 |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: '今日已保养', |
| | | label: '近日已保养', |
| | | type: 1, |
| | | count: 0, |
| | | listData: [], // 添加这个 |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: '今日全部任务', |
| | | label: '近日全部任务', |
| | | type: 2, |
| | | count: 0, |
| | | listData: [], // 添加这个 |
| | |
| | | }, |
| | | |
| | | dateRangePicker: ["任意间隔", "今天", "近两天", "近三天", "近四天", "近五天", "近六天", "近七天", "近30天"], |
| | | curDateGap: "今天", |
| | | curDateGap: "近七天", |
| | | enableCustomDateRange: false, |
| | | startDate: dayjs(new Date()).format('YYYY-MM-DD'), |
| | | startDate: dayjs(new Date()).subtract(7, 'days').format('YYYY-MM-DD'), |
| | | endDate: dayjs(new Date()).format('YYYY-MM-DD'), |
| | | HBillNo: '', |
| | | |
| | |
| | | // #endif |
| | | }, |
| | | methods: { |
| | | pushBill(currTab, item) { |
| | | let Query = `?operationType=4&HBarCode=${item['设备代码']}` |
| | | if(currTab == 0) { |
| | | uni.navigateTo({ |
| | | url: '/pages/MJGL/Sb_EquipMaintainBill/Sb_EquipMaintainBill' + Query |
| | | }) |
| | | } |
| | | }, |
| | | goTop: function(e) { |
| | | // 解决view层不同步的问题 |
| | | this.scrollTop = this.old.scrollTop |
| | |
| | | }, |
| | | |
| | | clear() { |
| | | this.curDateGap = "今天" |
| | | this.curDateGap = "近7天" |
| | | this.enableCustomDateRange = false |
| | | this.startDate = dayjs(new Date()).format('YYYY-MM-DD') |
| | | this.startDate = dayjs(new Date()).subtract(7, 'days').format('YYYY-MM-DD') |
| | | this.endDate = dayjs(new Date()).format('YYYY-MM-DD') |
| | | this.HBillNo = '' |
| | | }, |
| | |
| | | <template> |
| | | <view> |
| | | <view class="page-header"> |
| | | <view class="search-item"> |
| | | <view class="left">日期间隔</view> |
| | | <view class="right"> |
| | | <picker mode="selector" :value="curDateGap" :range="dateRangePicker" |
| | | @change="onDateRangePickerChangeHandler"> |
| | | <input disabled v-model="curDateGap" placeholder="请选择日期间隔" /> |
| | | <view class="picker-overlay"></view> |
| | | </picker> |
| | | <view> |
| | | <view class="page-header"> |
| | | <view class="search-item"> |
| | | <view class="left">日期间隔</view> |
| | | <view class="right"> |
| | | <picker mode="selector" :value="curDateGap" :range="dateRangePicker" |
| | | @change="onDateRangePickerChangeHandler"> |
| | | <input disabled v-model="curDateGap" placeholder="请选择日期间隔" /> |
| | | <view class="picker-overlay"></view> |
| | | </picker> |
| | | |
| | | </view> |
| | | </view> |
| | | <view class="search-item"> |
| | | <view class="left">开始日期</view> |
| | | <view class="right"> |
| | | <uni-datetime-picker :clear-icon="false" type="date" v-model="startDate" |
| | | :disabled="!enableCustomDateRange"> |
| | | <view class="datetime-picker-inner" |
| | | :class="enableCustomDateRange?'font__enable':'font__disable'"> |
| | | <text>{{ startDate }}</text> |
| | | </view> |
| | | </uni-datetime-picker> |
| | | </view> |
| | | </view> |
| | | <view class="search-item"> |
| | | <view class="left">结束日期</view> |
| | | <view class="right"> |
| | | <uni-datetime-picker :clear-icon="false" type="date" v-model="endDate" |
| | | :disabled="!enableCustomDateRange"> |
| | | <view class="datetime-picker-inner" |
| | | :class="enableCustomDateRange?'font__enable':'font__disable'">{{ endDate }}</view> |
| | | </uni-datetime-picker> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="search-item"> |
| | | <view class="left">开始日期</view> |
| | | <view class="right"> |
| | | <uni-datetime-picker :clear-icon="false" type="date" v-model="startDate" |
| | | :disabled="!enableCustomDateRange"> |
| | | <view class="datetime-picker-inner" |
| | | :class="enableCustomDateRange?'font__enable':'font__disable'"> |
| | | <text>{{ startDate }}</text> |
| | | </view> |
| | | </uni-datetime-picker> |
| | | </view> |
| | | </view> |
| | | <view class="search-item"> |
| | | <view class="left">结束日期</view> |
| | | <view class="right"> |
| | | <uni-datetime-picker :clear-icon="false" type="date" v-model="endDate" |
| | | :disabled="!enableCustomDateRange"> |
| | | <view class="datetime-picker-inner" |
| | | :class="enableCustomDateRange?'font__enable':'font__disable'">{{ endDate }}</view> |
| | | </uni-datetime-picker> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="button-groups"> |
| | | <button type="default" size="mini" class="btn-c" @tap.stop="onSearchClickHandler">查询</button> |
| | | <button type="default" size="mini" class="btn-a" @tap.stop="onResetClickHandler">重置</button> |
| | | </view> |
| | | </view> |
| | | <view class="button-groups"> |
| | | <button type="default" size="mini" class="btn-c" @tap.stop="onSearchClickHandler">查询</button> |
| | | <button type="default" size="mini" class="btn-a" @tap.stop="onResetClickHandler">重置</button> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- 页签区域 --> |
| | | <view class="tab-container"> |
| | | <view class="tab-list"> |
| | | <view v-for="(tab, index) in tabs" :key="index" :class="['tab-item', { 'active': activeTab === index }]" |
| | | @tap="switchTab(index)"> |
| | | <text>{{ tab.label }}</text> |
| | | <text v-if="tab.count > 0" class="tab-count">{{ tab.count }}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <!-- 页签区域 --> |
| | | <view class="tab-container"> |
| | | <view class="tab-list"> |
| | | <view v-for="(tab, index) in tabs" :key="index" :class="['tab-item', { 'active': activeTab === index }]" |
| | | @tap="switchTab(index)"> |
| | | <text>{{ tab.label }}</text> |
| | | <text v-if="tab.count > 0" class="tab-count">{{ tab.count }}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view> |
| | | <view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view> |
| | | |
| | | <!-- 页签内容区域 --> |
| | | <scroll-view v-for="(tab, tabIndex) in tabs" :key="tabIndex" v-show="activeTab === tabIndex" id="pageContent" |
| | | scroll-y class="page-content" :style="{height: pageContentHeight + 'px'}"> |
| | | <view class="list" v-for="(item,index) in tab.listData" :key="index"> |
| | | <uni-card :title="item.器具号" :extra="item.器具保养计划单号" style="margin: 10px;" |
| | | @tap="showDetail = showDetail==item.hmainid?-1:item.hmainid"> |
| | | <view class="card-detail"> |
| | | <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.保养负责人}} |
| | | </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> |
| | | <view class="card-detail" v-if="showDetail == item.hmainid"> |
| | | <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.作废人"> |
| | | <text>作废人:</text>{{item.作废人}} |
| | | </view> |
| | | <view class="detail" v-if="item.作废日期"> |
| | | <text>作废日期:</text>{{item.作废日期.substr(0,10)}} |
| | | </view> |
| | | </view> |
| | | <!-- 页签内容区域 --> |
| | | <scroll-view v-for="(tab, tabIndex) in tabs" :key="tabIndex" v-show="activeTab === tabIndex" id="pageContent" |
| | | scroll-y class="page-content" :style="{height: pageContentHeight + 'px'}"> |
| | | <view class="list" v-for="(item,index) in tab.listData" :key="index"> |
| | | <uni-card :title="item.器具号" :extra="item.器具保养计划单号" style="margin: 10px;" |
| | | @tap="showDetail = showDetail==item.hmainid?-1:item.hmainid"> |
| | | <view class="card-detail"> |
| | | <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.保养负责人}} |
| | | </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> |
| | | <view class="card-detail" v-if="showDetail == item.hmainid"> |
| | | <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.作废人"> |
| | | <text>作废人:</text>{{item.作废人}} |
| | | </view> |
| | | <view class="detail" v-if="item.作废日期"> |
| | | <text>作废日期:</text>{{item.作废日期.substr(0,10)}} |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="more" v-if="showDetail == item.hmainid && operations != item.hmainid"> |
| | | <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="operations = operations==item.hmainid?-1:item.hmainid"> |
| | | <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;" |
| | | size="14"></uni-icons>操作 |
| | | </view> |
| | | </view> |
| | | <view class="more" v-if="showDetail != item.hmainid && operations != item.hmainid"> |
| | | <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="operations = operations==item.hmainid?-1:item.hmainid"> |
| | | <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;" |
| | | size="14"></uni-icons>操作 |
| | | </view> |
| | | </view> |
| | | <view class="more" v-if="showDetail == item.hmainid && operations != item.hmainid"> |
| | | <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="operations = operations==item.hmainid?-1:item.hmainid"> |
| | | <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;" |
| | | size="14"></uni-icons>操作 |
| | | </view> |
| | | </view> |
| | | <view class="more" v-if="showDetail != item.hmainid && operations != item.hmainid"> |
| | | <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="operations = operations==item.hmainid?-1:item.hmainid"> |
| | | <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;" |
| | | size="14"></uni-icons>操作 |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="op" v-if="operations == item.hmainid"> |
| | | <button class="op5" size="mini" plain @tap.stop="operations = -1">取消操作</button> |
| | | </view> |
| | | </uni-card> |
| | | </view> |
| | | <view class="over" v-if="tabs[activeTab].listData.length == 0">暂无数据</view> |
| | | </scroll-view> |
| | | <view class="op" v-if="operations == item.hmainid"> |
| | | <button class="op1" v-if="activeTab == 0" size="mini" plain |
| | | @tap.stop="pushBill(0,item)">下推保养单</button> |
| | | <button class="op5" size="mini" plain @tap.stop="operations = -1">取消操作</button> |
| | | </view> |
| | | </uni-card> |
| | | </view> |
| | | <view class="over" v-if="tabs[activeTab].listData.length == 0">暂无数据</view> |
| | | </scroll-view> |
| | | |
| | | <!-- 分页器 --> |
| | | <view class="page-footer"> |
| | | <uni-pagination id="pagination" title="标题文字" v-model="tabs[activeTab].pageMeta.curPage" |
| | | :pageSize="tabs[activeTab].pageMeta.size" :total="tabs[activeTab].pageMeta.total" |
| | | @change="onPageChangeHandler"></uni-pagination> |
| | | </view> |
| | | </view> |
| | | <!-- 分页器 --> |
| | | <view class="page-footer"> |
| | | <uni-pagination id="pagination" title="标题文字" v-model="tabs[activeTab].pageMeta.curPage" |
| | | :pageSize="tabs[activeTab].pageMeta.size" :total="tabs[activeTab].pageMeta.total" |
| | | @change="onPageChangeHandler"></uni-pagination> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import dayjs from 'dayjs' |
| | | import { |
| | | CommonUtils |
| | | } from '@/utils/common.js' |
| | | import { |
| | | getUserInfo |
| | | } from '../../../utils/auth' |
| | | export default { |
| | | data() { |
| | | return { |
| | | // 计算卡片列表高度 |
| | | pagination_top: 0, |
| | | pageContent_top: 0, |
| | | import dayjs from 'dayjs' |
| | | import { |
| | | CommonUtils |
| | | } from '@/utils/common.js' |
| | | import { |
| | | getUserInfo |
| | | } from '../../../utils/auth' |
| | | export default { |
| | | data() { |
| | | return { |
| | | // 计算卡片列表高度 |
| | | pagination_top: 0, |
| | | pageContent_top: 0, |
| | | |
| | | // 当前激活的页签 |
| | | activeTab: 0, |
| | | // 当前激活的页签 |
| | | activeTab: 0, |
| | | |
| | | tabs: [{ |
| | | label: '今日待保养', |
| | | type: 0, |
| | | count: 0, |
| | | listData: [], // 添加这个 |
| | | pageMeta: { // 添加这个 |
| | | curPage: 1, |
| | | size: 50, |
| | | total: 0, |
| | | } |
| | | }, |
| | | { |
| | | label: '今日已保养', |
| | | type: 1, |
| | | count: 0, |
| | | listData: [], // 添加这个 |
| | | pageMeta: { // 添加这个 |
| | | curPage: 1, |
| | | size: 50, |
| | | total: 0, |
| | | } |
| | | }, |
| | | { |
| | | label: '今日全部任务', |
| | | type: 2, |
| | | count: 0, |
| | | listData: [], // 添加这个 |
| | | pageMeta: { // 添加这个 |
| | | curPage: 1, |
| | | size: 50, |
| | | total: 0, |
| | | } |
| | | } |
| | | ], |
| | | tabs: [{ |
| | | label: '近日待保养', |
| | | type: 0, |
| | | count: 0, |
| | | listData: [], // 添加这个 |
| | | pageMeta: { // 添加这个 |
| | | curPage: 1, |
| | | size: 50, |
| | | total: 0, |
| | | } |
| | | }, |
| | | { |
| | | label: '近日已保养', |
| | | type: 1, |
| | | count: 0, |
| | | listData: [], // 添加这个 |
| | | pageMeta: { // 添加这个 |
| | | curPage: 1, |
| | | size: 50, |
| | | total: 0, |
| | | } |
| | | }, |
| | | { |
| | | label: '近日全部任务', |
| | | type: 2, |
| | | count: 0, |
| | | listData: [], // 添加这个 |
| | | pageMeta: { // 添加这个 |
| | | curPage: 1, |
| | | size: 50, |
| | | total: 0, |
| | | } |
| | | } |
| | | ], |
| | | |
| | | // 滚动控制 |
| | | scrollTop: 0, |
| | | old: { |
| | | scrollTop: 0 |
| | | }, |
| | | // 滚动控制 |
| | | scrollTop: 0, |
| | | old: { |
| | | scrollTop: 0 |
| | | }, |
| | | |
| | | dateRangePicker: ["任意间隔", "今天", "近两天", "近三天", "近四天", "近五天", "近六天", "近七天", "近30天"], |
| | | curDateGap: "今天", |
| | | enableCustomDateRange: false, |
| | | startDate: dayjs(new Date()).format('YYYY-MM-DD'), |
| | | endDate: dayjs(new Date()).format('YYYY-MM-DD'), |
| | | HBillNo: '', |
| | | dateRangePicker: ["任意间隔", "今天", "近两天", "近三天", "近四天", "近五天", "近六天", "近七天", "近30天"], |
| | | curDateGap: "近七天", |
| | | enableCustomDateRange: false, |
| | | startDate: dayjs(new Date()).subtract(7, 'days').format('YYYY-MM-DD'), |
| | | endDate: dayjs(new Date()).format('YYYY-MM-DD'), |
| | | HBillNo: '', |
| | | |
| | | showDetail: -1, |
| | | operations: -1, |
| | | } |
| | | }, |
| | | computed: { |
| | | pageContentHeight: { |
| | | get() { |
| | | return (this.pagination_top - this.pageContent_top) |
| | | } |
| | | }, |
| | | }, |
| | | onLoad() { |
| | | this.onSearchClickHandler() |
| | | }, |
| | | onPullDownRefresh() { |
| | | this.onSearchClickHandler() |
| | | }, |
| | | async onReady() { |
| | | // #ifndef MP-WEIXIN |
| | | let query = uni.createSelectorQuery().in(this) |
| | | query.select("#pagination") |
| | | .boundingClientRect((data) => { |
| | | if (data) { |
| | | this.pagination_top = data.top |
| | | } else { |
| | | console.log("未找到#pagination节点"); |
| | | } |
| | | }) |
| | | .exec(); |
| | | query.select("#pageContent") |
| | | .boundingClientRect((data) => { |
| | | if (data) { |
| | | this.pageContent_top = data.top |
| | | } else { |
| | | console.log("未找到#pageContent节点"); |
| | | } |
| | | }) |
| | | .exec(); |
| | | // #endif |
| | | }, |
| | | methods: { |
| | | goTop: function(e) { |
| | | // 解决view层不同步的问题 |
| | | this.scrollTop = this.old.scrollTop |
| | | this.$nextTick(function() { |
| | | this.scrollTop = 0 |
| | | }); |
| | | }, |
| | | showDetail: -1, |
| | | operations: -1, |
| | | } |
| | | }, |
| | | computed: { |
| | | pageContentHeight: { |
| | | get() { |
| | | return (this.pagination_top - this.pageContent_top) |
| | | } |
| | | }, |
| | | }, |
| | | onShow() { |
| | | this.onSearchClickHandler() |
| | | }, |
| | | onPullDownRefresh() { |
| | | this.onSearchClickHandler() |
| | | }, |
| | | async onReady() { |
| | | // #ifndef MP-WEIXIN |
| | | let query = uni.createSelectorQuery().in(this) |
| | | query.select("#pagination") |
| | | .boundingClientRect((data) => { |
| | | if (data) { |
| | | this.pagination_top = data.top |
| | | } else { |
| | | console.log("未找到#pagination节点"); |
| | | } |
| | | }) |
| | | .exec(); |
| | | query.select("#pageContent") |
| | | .boundingClientRect((data) => { |
| | | if (data) { |
| | | this.pageContent_top = data.top |
| | | } else { |
| | | console.log("未找到#pageContent节点"); |
| | | } |
| | | }) |
| | | .exec(); |
| | | // #endif |
| | | }, |
| | | methods: { |
| | | pushBill(currTab, item) { |
| | | let Query = `?operationType=4&HBarCode=${item['器具编号']}` |
| | | if (currTab == 0) { |
| | | uni.navigateTo({ |
| | | url: '/pages/MJGL/mujubaoyangjiludan/Sc_MouldMaintainBill' + Query |
| | | }) |
| | | } |
| | | }, |
| | | goTop: function(e) { |
| | | // 解决view层不同步的问题 |
| | | this.scrollTop = this.old.scrollTop |
| | | this.$nextTick(function() { |
| | | this.scrollTop = 0 |
| | | }); |
| | | }, |
| | | |
| | | // 切换页签 |
| | | switchTab(index) { |
| | | this.activeTab = index |
| | | this.showDetail = -1 |
| | | this.operations = -1 |
| | | }, |
| | | // 切换页签 |
| | | switchTab(index) { |
| | | this.activeTab = index |
| | | this.showDetail = -1 |
| | | this.operations = -1 |
| | | }, |
| | | |
| | | onDateRangePickerChangeHandler({ |
| | | detail |
| | | }) { |
| | | this.enableCustomDateRange = false |
| | | this.curDateGap = this.dateRangePicker[detail.value] |
| | | let date = new Date() |
| | | switch (this.curDateGap) { |
| | | case "今天": |
| | | this.startDate = dayjs(date).format("YYYY-MM-DD") |
| | | break; |
| | | case "近一天": |
| | | this.startDate = dayjs(date).subtract(1, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近两天": |
| | | this.startDate = dayjs(date).subtract(2, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近三天": |
| | | this.startDate = dayjs(date).subtract(3, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近四天": |
| | | this.startDate = dayjs(date).subtract(4, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近五天": |
| | | this.startDate = dayjs(date).subtract(5, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近六天": |
| | | this.startDate = dayjs(date).subtract(6, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近七天": |
| | | this.startDate = dayjs(date).subtract(7, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近30天": |
| | | this.startDate = dayjs(date).subtract(30, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | } |
| | | if (this.curDateGap == '任意间隔') { |
| | | this.enableCustomDateRange = true |
| | | } |
| | | }, |
| | | onDateRangePickerChangeHandler({ |
| | | detail |
| | | }) { |
| | | this.enableCustomDateRange = false |
| | | this.curDateGap = this.dateRangePicker[detail.value] |
| | | let date = new Date() |
| | | switch (this.curDateGap) { |
| | | case "今天": |
| | | this.startDate = dayjs(date).format("YYYY-MM-DD") |
| | | break; |
| | | case "近一天": |
| | | this.startDate = dayjs(date).subtract(1, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近两天": |
| | | this.startDate = dayjs(date).subtract(2, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近三天": |
| | | this.startDate = dayjs(date).subtract(3, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近四天": |
| | | this.startDate = dayjs(date).subtract(4, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近五天": |
| | | this.startDate = dayjs(date).subtract(5, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近六天": |
| | | this.startDate = dayjs(date).subtract(6, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近七天": |
| | | this.startDate = dayjs(date).subtract(7, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近30天": |
| | | this.startDate = dayjs(date).subtract(30, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | } |
| | | if (this.curDateGap == '任意间隔') { |
| | | this.enableCustomDateRange = true |
| | | } |
| | | }, |
| | | |
| | | onSearchClickHandler() { |
| | | let sWhere = "" |
| | | // 获取当前激活的页签 |
| | | const currentTab = this.tabs[this.activeTab] |
| | | sWhere = { |
| | | HBeginDate: this.startDate, |
| | | HEndDate: this.endDate |
| | | } |
| | | this.get_DisplayPage(JSON.stringify(sWhere), currentTab.type) |
| | | }, |
| | | onSearchClickHandler() { |
| | | let sWhere = "" |
| | | // 获取当前激活的页签 |
| | | const currentTab = this.tabs[this.activeTab] |
| | | sWhere = { |
| | | HBeginDate: this.startDate, |
| | | HEndDate: this.endDate |
| | | } |
| | | this.get_DisplayPage(JSON.stringify(sWhere), currentTab.type) |
| | | }, |
| | | |
| | | clear() { |
| | | this.curDateGap = "今天" |
| | | this.enableCustomDateRange = false |
| | | this.startDate = dayjs(new Date()).format('YYYY-MM-DD') |
| | | this.endDate = dayjs(new Date()).format('YYYY-MM-DD') |
| | | this.HBillNo = '' |
| | | }, |
| | | clear() { |
| | | this.curDateGap = "近七天" |
| | | this.enableCustomDateRange = false |
| | | this.startDate = dayjs(new Date()).subtract(7, 'days').format('YYYY-MM-DD') |
| | | this.endDate = dayjs(new Date()).format('YYYY-MM-DD') |
| | | this.HBillNo = '' |
| | | }, |
| | | |
| | | async onResetClickHandler() { |
| | | this.clear() |
| | | await this.$nextTick() |
| | | this.onSearchClickHandler() |
| | | }, |
| | | async onResetClickHandler() { |
| | | this.clear() |
| | | await this.$nextTick() |
| | | this.onSearchClickHandler() |
| | | }, |
| | | |
| | | get_DisplayPage(sWhere, tabType) { |
| | | CommonUtils.doRequest2({ |
| | | url: '/Sb_EquipMaintainTaskReport/MaintainList_APP', |
| | | data: { |
| | | "sWhere": sWhere, |
| | | "user": getUserInfo()["Czymc"], |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | data, |
| | | Message, |
| | | count |
| | | } = res.data |
| | | console.log('res.data: ', res.data) |
| | | get_DisplayPage(sWhere, tabType) { |
| | | CommonUtils.doRequest2({ |
| | | url: '/Sc_MouldMaintainTaskReport/MaintainList_APP', |
| | | data: { |
| | | "sWhere": sWhere, |
| | | "user": getUserInfo()["Czymc"], |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | data, |
| | | Message, |
| | | count |
| | | } = res.data |
| | | console.log('res.data: ', res.data) |
| | | |
| | | if (data && data.h_p_Sb_EquipMaintainTaskReport_APP) { |
| | | // 更新待签到页签 |
| | | this.tabs[0].listData = data.h_p_Sb_EquipMaintainTaskReport_APP |
| | | this.tabs[0].pageMeta.total = data.h_p_Sb_EquipMaintainTaskReport_APP.length |
| | | this.tabs[0].count = data.h_p_Sb_EquipMaintainTaskReport_APP.length |
| | | } |
| | | if (data && data.h_p_Sc_MouldMaintainTaskReport_APP) { |
| | | // 更新待签到页签 |
| | | this.tabs[0].listData = data.h_p_Sc_MouldMaintainTaskReport_APP |
| | | this.tabs[0].pageMeta.total = data.h_p_Sc_MouldMaintainTaskReport_APP.length |
| | | this.tabs[0].count = data.h_p_Sc_MouldMaintainTaskReport_APP.length |
| | | } |
| | | |
| | | if (data && data.h_p_Sb_EquipMaintainTaskReport_APP1) { |
| | | // 更新待处理页签 |
| | | this.tabs[1].listData = data.h_p_Sb_EquipMaintainTaskReport_APP1 |
| | | this.tabs[1].pageMeta.total = data.h_p_Sb_EquipMaintainTaskReport_APP1.length |
| | | this.tabs[1].count = data.h_p_Sb_EquipMaintainTaskReport_APP1.length |
| | | } |
| | | if (data && data.h_p_Sc_MouldMaintainTaskReport_APP1) { |
| | | // 更新待处理页签 |
| | | this.tabs[1].listData = data.h_p_Sc_MouldMaintainTaskReport_APP1 |
| | | this.tabs[1].pageMeta.total = data.h_p_Sc_MouldMaintainTaskReport_APP1.length |
| | | this.tabs[1].count = data.h_p_Sc_MouldMaintainTaskReport_APP1.length |
| | | } |
| | | |
| | | if (data && data.h_p_Sb_EquipMaintainTaskReport_APP2) { |
| | | // 更新待验收页签 |
| | | this.tabs[2].listData = data.h_p_Sb_EquipMaintainTaskReport_APP2 |
| | | this.tabs[2].pageMeta.total = data.h_p_Sb_EquipMaintainTaskReport_APP2.length |
| | | this.tabs[2].count = data.h_p_Sb_EquipMaintainTaskReport_APP2.length |
| | | } |
| | | if (data && data.h_p_Sc_MouldMaintainTaskReport_APP2) { |
| | | // 更新待验收页签 |
| | | this.tabs[2].listData = data.h_p_Sc_MouldMaintainTaskReport_APP2 |
| | | this.tabs[2].pageMeta.total = data.h_p_Sc_MouldMaintainTaskReport_APP2.length |
| | | this.tabs[2].count = data.h_p_Sc_MouldMaintainTaskReport_APP2.length |
| | | } |
| | | |
| | | |
| | | uni.stopPullDownRefresh() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | onPageChangeHandler() { |
| | | this.onSearchClickHandler() |
| | | this.goTop() |
| | | }, |
| | | }, |
| | | } |
| | | uni.stopPullDownRefresh() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | onPageChangeHandler() { |
| | | this.onSearchClickHandler() |
| | | this.goTop() |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .page-header { |
| | | display: flex; |
| | | box-sizing: border-box; |
| | | padding: 20rpx; |
| | | flex-direction: column; |
| | | gap: 10rpx; |
| | | font-size: 32rpx; |
| | | .page-header { |
| | | display: flex; |
| | | box-sizing: border-box; |
| | | padding: 20rpx; |
| | | flex-direction: column; |
| | | gap: 10rpx; |
| | | font-size: 32rpx; |
| | | |
| | | .search-item { |
| | | display: flex; |
| | | flex-direction: row; |
| | | gap: 10rpx; |
| | | justify-content: center; |
| | | align-items: center; |
| | | .search-item { |
| | | display: flex; |
| | | flex-direction: row; |
| | | gap: 10rpx; |
| | | justify-content: center; |
| | | align-items: center; |
| | | |
| | | .left { |
| | | width: 4em; |
| | | } |
| | | .left { |
| | | width: 4em; |
| | | } |
| | | |
| | | .right { |
| | | flex: 1; |
| | | position: relative; |
| | | border-radius: 22rpx; |
| | | border: 1px solid #acacac; |
| | | display: flex; |
| | | padding: 4rpx 10rpx; |
| | | .right { |
| | | flex: 1; |
| | | position: relative; |
| | | border-radius: 22rpx; |
| | | border: 1px solid #acacac; |
| | | display: flex; |
| | | padding: 4rpx 10rpx; |
| | | |
| | | picker { |
| | | width: 100%; |
| | | } |
| | | } |
| | | } |
| | | picker { |
| | | width: 100%; |
| | | } |
| | | } |
| | | } |
| | | |
| | | input { |
| | | width: inherit; |
| | | padding: 8rpx 20rpx; |
| | | font-size: 30rpx; |
| | | } |
| | | input { |
| | | width: inherit; |
| | | padding: 8rpx 20rpx; |
| | | font-size: 30rpx; |
| | | } |
| | | |
| | | .datetime-picker-inner { |
| | | padding: 8rpx 20rpx; |
| | | font-size: 30rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | .datetime-picker-inner { |
| | | padding: 8rpx 20rpx; |
| | | font-size: 30rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .font__enable { |
| | | color: #000; |
| | | } |
| | | .font__enable { |
| | | color: #000; |
| | | } |
| | | |
| | | .font__disable { |
| | | color: #cccccc; |
| | | } |
| | | } |
| | | .font__disable { |
| | | color: #cccccc; |
| | | } |
| | | } |
| | | |
| | | .button-groups { |
| | | box-sizing: border-box; |
| | | padding: 10rpx 0 0 0; |
| | | display: flex; |
| | | flex-direction: row; |
| | | gap: 10rpx; |
| | | justify-content: space-between; |
| | | .button-groups { |
| | | box-sizing: border-box; |
| | | padding: 10rpx 0 0 0; |
| | | display: flex; |
| | | flex-direction: row; |
| | | gap: 10rpx; |
| | | justify-content: space-between; |
| | | |
| | | button { |
| | | border-radius: 50rpx; |
| | | width: 180rpx; |
| | | height: 66rpx; |
| | | line-height: 66rpx; |
| | | font-size: 28rpx; |
| | | } |
| | | button { |
| | | border-radius: 50rpx; |
| | | width: 180rpx; |
| | | height: 66rpx; |
| | | line-height: 66rpx; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .btn-a { |
| | | background-color: #acacac; |
| | | color: #fff; |
| | | } |
| | | .btn-a { |
| | | background-color: #acacac; |
| | | color: #fff; |
| | | } |
| | | |
| | | .btn-b { |
| | | background-color: #41a863; |
| | | color: #fff; |
| | | } |
| | | .btn-b { |
| | | background-color: #41a863; |
| | | color: #fff; |
| | | } |
| | | |
| | | .btn-c { |
| | | background-color: #3a78ff; |
| | | color: #fff; |
| | | } |
| | | } |
| | | .btn-c { |
| | | background-color: #3a78ff; |
| | | color: #fff; |
| | | } |
| | | } |
| | | |
| | | /* 页签样式 */ |
| | | .tab-container { |
| | | background-color: #fff; |
| | | } |
| | | /* 页签样式 */ |
| | | .tab-container { |
| | | background-color: #fff; |
| | | } |
| | | |
| | | .tab-list { |
| | | display: flex; |
| | | flex-direction: row; |
| | | border-bottom: 1px solid #e5e5e5; |
| | | } |
| | | .tab-list { |
| | | display: flex; |
| | | flex-direction: row; |
| | | border-bottom: 1px solid #e5e5e5; |
| | | } |
| | | |
| | | .tab-item { |
| | | flex: 1; |
| | | padding: 20rpx 0; |
| | | text-align: center; |
| | | font-size: 28rpx; |
| | | color: #666; |
| | | position: relative; |
| | | .tab-item { |
| | | flex: 1; |
| | | padding: 20rpx 0; |
| | | text-align: center; |
| | | font-size: 28rpx; |
| | | color: #666; |
| | | position: relative; |
| | | |
| | | &.active { |
| | | color: #3a78ff; |
| | | font-weight: bold; |
| | | &.active { |
| | | color: #3a78ff; |
| | | font-weight: bold; |
| | | |
| | | &::after { |
| | | content: ''; |
| | | position: absolute; |
| | | bottom: 0; |
| | | left: 50%; |
| | | transform: translateX(-50%); |
| | | width: 80rpx; |
| | | height: 4rpx; |
| | | background-color: #3a78ff; |
| | | } |
| | | } |
| | | &::after { |
| | | content: ''; |
| | | position: absolute; |
| | | bottom: 0; |
| | | left: 50%; |
| | | transform: translateX(-50%); |
| | | width: 80rpx; |
| | | height: 4rpx; |
| | | background-color: #3a78ff; |
| | | } |
| | | } |
| | | |
| | | .tab-count { |
| | | display: inline-block; |
| | | margin-left: 10rpx; |
| | | padding: 0 12rpx; |
| | | background-color: #ff6b6b; |
| | | color: #fff; |
| | | border-radius: 20rpx; |
| | | font-size: 20rpx; |
| | | min-width: 30rpx; |
| | | text-align: center; |
| | | } |
| | | } |
| | | .tab-count { |
| | | display: inline-block; |
| | | margin-left: 10rpx; |
| | | padding: 0 12rpx; |
| | | background-color: #ff6b6b; |
| | | color: #fff; |
| | | border-radius: 20rpx; |
| | | font-size: 20rpx; |
| | | min-width: 30rpx; |
| | | text-align: center; |
| | | } |
| | | } |
| | | |
| | | .page-content { |
| | | box-sizing: border-box; |
| | | padding: 10rpx 0; |
| | | .page-content { |
| | | box-sizing: border-box; |
| | | padding: 10rpx 0; |
| | | |
| | | .card-detail { |
| | | width: 100%; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | justify-content: space-between; |
| | | line-height: 120%; |
| | | .card-detail { |
| | | width: 100%; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | justify-content: space-between; |
| | | line-height: 120%; |
| | | |
| | | .detail { |
| | | font-size: 26rpx; |
| | | margin-bottom: 12rpx; |
| | | color: #555; |
| | | margin-right: 20rpx; |
| | | .detail { |
| | | font-size: 26rpx; |
| | | margin-bottom: 12rpx; |
| | | color: #555; |
| | | margin-right: 20rpx; |
| | | |
| | | text { |
| | | color: #999; |
| | | font-size: 26rpx; |
| | | } |
| | | } |
| | | } |
| | | text { |
| | | color: #999; |
| | | font-size: 26rpx; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .more { |
| | | color: #888; |
| | | font-size: 24rpx; |
| | | display: flex; |
| | | border-top: 1px solid #eee; |
| | | padding-top: 20rpx; |
| | | .more { |
| | | color: #888; |
| | | font-size: 24rpx; |
| | | display: flex; |
| | | border-top: 1px solid #eee; |
| | | padding-top: 20rpx; |
| | | |
| | | .part { |
| | | width: 50%; |
| | | text-align: center; |
| | | } |
| | | } |
| | | .part { |
| | | width: 50%; |
| | | text-align: center; |
| | | } |
| | | } |
| | | |
| | | .op { |
| | | display: flex; |
| | | justify-content: space-around; |
| | | margin-top: 20rpx; |
| | | .op { |
| | | display: flex; |
| | | justify-content: space-around; |
| | | margin-top: 20rpx; |
| | | |
| | | button { |
| | | padding: 0; |
| | | width: 150rpx; |
| | | font-size: 25rpx; |
| | | button { |
| | | padding: 0; |
| | | width: 150rpx; |
| | | font-size: 25rpx; |
| | | |
| | | &:disabled { |
| | | opacity: 0.5; |
| | | } |
| | | } |
| | | &:disabled { |
| | | opacity: 0.5; |
| | | } |
| | | } |
| | | |
| | | .op1 { |
| | | border: 1px solid #41a863; |
| | | color: #41a863; |
| | | } |
| | | .op1 { |
| | | border: 1px solid #41a863; |
| | | color: #41a863; |
| | | } |
| | | |
| | | .op2 { |
| | | border: 1px solid #d98d00; |
| | | color: #d98d00; |
| | | } |
| | | .op2 { |
| | | border: 1px solid #d98d00; |
| | | color: #d98d00; |
| | | } |
| | | |
| | | .op3 { |
| | | border: 1px solid #3a78ff; |
| | | color: #3a78ff; |
| | | } |
| | | .op3 { |
| | | border: 1px solid #3a78ff; |
| | | color: #3a78ff; |
| | | } |
| | | |
| | | .op4 { |
| | | border: 1px solid #da0000; |
| | | color: #da0000; |
| | | } |
| | | .op4 { |
| | | border: 1px solid #da0000; |
| | | color: #da0000; |
| | | } |
| | | |
| | | .op5 { |
| | | border: 1px solid #888; |
| | | color: #888; |
| | | } |
| | | } |
| | | } |
| | | .op5 { |
| | | border: 1px solid #888; |
| | | color: #888; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .over { |
| | | text-align: center; |
| | | padding: 40rpx; |
| | | color: #999; |
| | | font-size: 28rpx; |
| | | } |
| | | .over { |
| | | text-align: center; |
| | | padding: 40rpx; |
| | | color: #999; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .page-footer { |
| | | position: fixed; |
| | | bottom: 0; |
| | | width: 100%; |
| | | box-sizing: border-box; |
| | | padding: 32rpx 40rpx; |
| | | } |
| | | .page-footer { |
| | | position: fixed; |
| | | bottom: 0; |
| | | width: 100%; |
| | | box-sizing: border-box; |
| | | padding: 32rpx 40rpx; |
| | | } |
| | | </style> |
| | |
| | | <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="{ |
| | | <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="enableEdit?'right':'righton'"> |
| | | <input v-model="hform.HBarCode" :disabled="!enableEdit" |
| | | @confirm="GetMessageByBarCode(hform.HBarCode)" placeholder="请输入(或扫描)模具条码" /> |
| | | </view> |
| | | <view class="icon-wrapper"> |
| | | <uni-icons type="scan" size="20" @click="toScanCode"></uni-icons> |
| | | </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.HCheckResult == 'OK'" /> |
| | | <text>OK</text> |
| | | </view> |
| | | </label> |
| | | </label> |
| | | <view> |
| | | <radio value="NG" :checked="hform.HCheckResult == 'NG'" /> |
| | | <text>NG</text> |
| | | </view> |
| | | </label> |
| | | </radio-group> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">验收内容:</view> |
| | | <view class="right"> |
| | | <textarea v-model="hform.HRepairCheckMainContent" placeholder="请输入验收内容" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">源单类型</view> |
| | | <view class="right" v-show="showHMainSourceBillType"> |
| | | <picker :range="arrayHMainSourceBillType" @change="HMainSourceBillTypeChange"> |
| | | <view class="form-item"> |
| | | <view class="title">模具条码:</view> |
| | | <view :class="enableEdit?'right':'righton'"> |
| | | <input v-model="hform.HBarCode" :disabled="!enableEdit" |
| | | @confirm="GetMessageByBarCode(hform.HBarCode)" placeholder="请输入(或扫描)模具条码" /> |
| | | </view> |
| | | <view class="icon-wrapper"> |
| | | <uni-icons type="scan" size="20" @click="toScanCode"></uni-icons> |
| | | </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.HCheckResult == 'OK'" /> |
| | | <text>OK</text> |
| | | </view> |
| | | </label> |
| | | </label> |
| | | <view> |
| | | <radio value="NG" :checked="hform.HCheckResult == 'NG'" /> |
| | | <text>NG</text> |
| | | </view> |
| | | </label> |
| | | </radio-group> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">验收内容:</view> |
| | | <view class="right"> |
| | | <textarea v-model="hform.HRepairCheckMainContent" placeholder="请输入验收内容" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">源单类型</view> |
| | | <view class="right" v-show="showHMainSourceBillType"> |
| | | <picker :range="arrayHMainSourceBillType" @change="HMainSourceBillTypeChange"> |
| | | |
| | | <input disabled name="HMainSourceBillType" v-model="HMainSourceBillType" |
| | | placeholder="请选择源单类型" /> |
| | | <view class="picker-overlay"></view> |
| | | </picker> |
| | | </view> |
| | | <view class="righton" v-show="!showHMainSourceBillType"> |
| | | <input name="HMainSourceBillType" disabled v-model="HMainSourceBillType" |
| | | placeholder="请选择源单类型" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title required">故障登记单</view> |
| | | <view class="right" v-show="hform.HMainSourceBillType != 1"> |
| | | <input type="text" name="HBarCode" v-model="hform.HMainSourceBillNo" /> |
| | | </view> |
| | | <view class="icon-wrapper" v-show="hform.HMainSourceBillType != 1" |
| | | :disabled="hform.HMainSourceBillType == -1"> |
| | | <uni-icons type="search" size="20" @click="showBillList"></uni-icons> |
| | | </view> |
| | | <view class="righton" v-show="hform.HMainSourceBillType == 1"> |
| | | <input type="text" disabled name="HBarCode" v-model="hform.HMainSourceBillNo" /> |
| | | </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 required">部门:</view> |
| | | <zxz-uni-data-select required class="right" :localdata="HDeptList" dataKey="部门名称" |
| | | dataValue="HItemID" v-model="hform.HDeptID"> |
| | | <input disabled name="HMainSourceBillType" v-model="HMainSourceBillType" |
| | | placeholder="请选择源单类型" /> |
| | | <view class="picker-overlay"></view> |
| | | </picker> |
| | | </view> |
| | | <view class="righton" v-show="!showHMainSourceBillType"> |
| | | <input name="HMainSourceBillType" disabled v-model="HMainSourceBillType" |
| | | placeholder="请选择源单类型" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title required">故障登记单</view> |
| | | <view class="right" v-show="hform.HMainSourceBillType != 1"> |
| | | <input type="text" name="HBarCode" v-model="hform.HMainSourceBillNo" /> |
| | | </view> |
| | | <view class="icon-wrapper" v-show="hform.HMainSourceBillType != 1" |
| | | :disabled="hform.HMainSourceBillType == -1"> |
| | | <uni-icons type="search" size="20" @click="showBillList"></uni-icons> |
| | | </view> |
| | | <view class="righton" v-show="hform.HMainSourceBillType == 1"> |
| | | <input type="text" disabled name="HBarCode" v-model="hform.HMainSourceBillNo" /> |
| | | </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 required">部门:</view> |
| | | <zxz-uni-data-select required class="right" :localdata="HDeptList" dataKey="部门名称" |
| | | dataValue="HItemID" v-model="hform.HDeptID"> |
| | | |
| | | </zxz-uni-data-select> |
| | | </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.HEmpID"> |
| | | </zxz-uni-data-select> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title required">验收项目:</view> |
| | | <zxz-uni-data-select required class="right" :localdata="HRepairCheckList" dataKey="维修验收项目" |
| | | dataValue="hitemid" v-model="hform.HRepairCheckMainID"> |
| | | </zxz-uni-data-select> |
| | | </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.HManagerID"> |
| | | </zxz-uni-data-select> |
| | | </view> |
| | | <!-- 扫码带出维修记录 --> |
| | | <view class="form-item"> |
| | | <view class="title required">维修记录:</view> |
| | | <view class="right" v-show="hform.HMainSourceBillType != 1"> |
| | | <input type="text" v-model="hform.HMouldRepairWorkName" |
| | | :disabled="hform.HMainSourceBillType == -1" placeholder="请选择维修记录" /> |
| | | </view> |
| | | <view class="icon-wrapper" v-show="hform.HMainSourceBillType != 1" |
| | | :disabled="hform.HMainSourceBillType == -1"> |
| | | <uni-icons type="search" size="20" @click="showRepairRecordList"></uni-icons> |
| | | </view> |
| | | <view class="righton" v-show="hform.HMainSourceBillType == 1"> |
| | | <input type="text" disabled v-model="hform.HMouldRepairWorkName" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">模具名称:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HMouldName" disabled /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">模具规格:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HMouldSpec" disabled /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">模具型号:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HMouldModel" disabled /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <!-- 其他信息 --> |
| | | <template v-if="tabs == 2"> |
| | | <view class="form" :style="{ |
| | | </zxz-uni-data-select> |
| | | </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.HEmpID"> |
| | | </zxz-uni-data-select> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title required">验收项目:</view> |
| | | <zxz-uni-data-select required class="right" :localdata="HRepairCheckList" dataKey="维修验收项目" |
| | | dataValue="hitemid" v-model="hform.HRepairCheckMainID"> |
| | | </zxz-uni-data-select> |
| | | </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.HManagerID"> |
| | | </zxz-uni-data-select> |
| | | </view> |
| | | <!-- 扫码带出维修记录 --> |
| | | <view class="form-item"> |
| | | <view class="title required">维修记录:</view> |
| | | <view class="right" v-show="hform.HMainSourceBillType != 1"> |
| | | <input type="text" v-model="hform.HMouldRepairWorkName" |
| | | :disabled="hform.HMainSourceBillType == -1" placeholder="请选择维修记录" /> |
| | | </view> |
| | | <view class="icon-wrapper" v-show="hform.HMainSourceBillType != 1" |
| | | :disabled="hform.HMainSourceBillType == -1"> |
| | | <uni-icons type="search" size="20" @click="showRepairRecordList"></uni-icons> |
| | | </view> |
| | | <view class="righton" v-show="hform.HMainSourceBillType == 1"> |
| | | <input type="text" disabled v-model="hform.HMouldRepairWorkName" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">模具名称:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HMouldName" disabled /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">模具规格:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HMouldSpec" disabled /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">模具型号:</view> |
| | | <view class="righton"> |
| | | <input v-model="hform.HMouldModel" disabled /> |
| | | </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> |
| | | <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> |
| | | <!-- 弹出模具故障登记单的选择列表 --> |
| | | <BillListPopupMouldConkBookBillVue ref="billList" :HBillType="hform.HBillType" |
| | | :HSourceBillType="hform.HMainSourceBillType" :HStockOrgID="hform.HStockOrgID"> |
| | | </BillListPopupMouldConkBookBillVue> |
| | | <!-- 弹出模具维修记录单的选择列表 --> |
| | | <RepairRecordPopup ref="repairRecordList" :HBillType="hform.HBillType" :HStockOrgID="hform.HStockOrgID"> |
| | | </RepairRecordPopup> |
| | | </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> |
| | | <!-- 弹出模具故障登记单的选择列表 --> |
| | | <BillListPopupMouldConkBookBillVue ref="billList" :HBillType="hform.HBillType" |
| | | :HSourceBillType="hform.HMainSourceBillType" :HStockOrgID="hform.HStockOrgID"> |
| | | </BillListPopupMouldConkBookBillVue> |
| | | <!-- 弹出模具维修记录单的选择列表 --> |
| | | <RepairRecordPopup ref="repairRecordList" :HBillType="hform.HBillType" :HStockOrgID="hform.HStockOrgID"> |
| | | </RepairRecordPopup> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import dayjs from "dayjs"; |
| | | import { |
| | | CommonUtils |
| | | } from "@/utils/common"; |
| | | import { |
| | | MpaasScan |
| | | } from "@/utils/mpaasScan.js" |
| | | import { |
| | | getUserInfo |
| | | } from "../../../utils/auth"; |
| | | import BillListPopupMouldConkBookBillVue from '../../../components/BillListPopup/BillListPopupMouldConkBookBill.vue'; |
| | | import RepairRecordPopup from '../../../components/BillListPopup/BillListPopuMouldRepairRecordPopup.vue'; |
| | | import dayjs from "dayjs"; |
| | | import { |
| | | CommonUtils |
| | | } from "@/utils/common"; |
| | | import { |
| | | MpaasScan |
| | | } from "@/utils/mpaasScan.js" |
| | | import { |
| | | getUserInfo |
| | | } from "../../../utils/auth"; |
| | | import BillListPopupMouldConkBookBillVue from '../../../components/BillListPopup/BillListPopupMouldConkBookBill.vue'; |
| | | import RepairRecordPopup from '../../../components/BillListPopup/BillListPopuMouldRepairRecordPopup.vue'; |
| | | |
| | | export default { |
| | | components: { |
| | | BillListPopupMouldConkBookBillVue, |
| | | RepairRecordPopup |
| | | }, |
| | | name: 'Sc_MouldRepairCheckBill', |
| | | data() { |
| | | return { |
| | | tabs: 0, |
| | | btnTop: 0, |
| | | tabsBottom: 0, |
| | | HModName: "Sc_MouldRepairCheckBill", |
| | | HBillType: '3817', |
| | | operationType: 1, |
| | | enableEdit: true, |
| | | export default { |
| | | components: { |
| | | BillListPopupMouldConkBookBillVue, |
| | | RepairRecordPopup |
| | | }, |
| | | name: 'Sc_MouldRepairCheckBill', |
| | | data() { |
| | | return { |
| | | tabs: 0, |
| | | btnTop: 0, |
| | | tabsBottom: 0, |
| | | HModName: "Sc_MouldRepairCheckBill", |
| | | HBillType: '3817', |
| | | operationType: 1, |
| | | enableEdit: true, |
| | | |
| | | // 控制源单类型是否可编辑 |
| | | showHMainSourceBillType: true, |
| | | HMainSourceBillType: '模具故障登记单', |
| | | arrayHMainSourceBillType: ['模具故障登记单'], |
| | | arrayHMainSourceBillTypeID: ['3815'], |
| | | // 控制源单类型是否可编辑 |
| | | showHMainSourceBillType: true, |
| | | HMainSourceBillType: '模具故障登记单', |
| | | arrayHMainSourceBillType: ['模具故障登记单'], |
| | | arrayHMainSourceBillTypeID: ['3815'], |
| | | |
| | | HDeptList: [], |
| | | HRepairCheckList: [], |
| | | HEmpList: [], |
| | | HDeptList: [], |
| | | HRepairCheckList: [], |
| | | HEmpList: [], |
| | | |
| | | hform: { |
| | | "HBillType": 3817, |
| | | "HBarCode": "", |
| | | "HBillNo": "", |
| | | "HInterID": 0, |
| | | "HDate": dayjs(new Date()).format("YYYY-MM-DD"), |
| | | "HInnerBillNo": "", |
| | | "HMouldName": "", |
| | | "HMouldSpec": "", |
| | | "HMouldModel": "", |
| | | "HMouldID": 0, |
| | | "HMainSourceBillType": "3815", |
| | | "HMainSourceInterID": 0, |
| | | "HMainSourceEntryID": 0, |
| | | "HCheckResult": "OK", |
| | | "HEmpName": getUserInfo().HEmpName, |
| | | "HEmpID": getUserInfo().HEmpID, |
| | | "HCheckBeginDate": dayjs(new Date()).format("YYYY-MM-DD"), |
| | | "HDeptName": getUserInfo().HDeptName, |
| | | "HDeptID": getUserInfo().HDeptID, |
| | | "HMainSourceBillNo": "", |
| | | "HManagerName": getUserInfo().HManagerName, |
| | | "HManagerID": getUserInfo().HManagerID, |
| | | "HMouldRepairWorkName": "", |
| | | "HMouldRepairWorkID": 0, |
| | | "HExplanation": "", |
| | | "HRemark": "", |
| | | "HOrgID": uni.getStorageSync("OrganizationID"), |
| | | "HStockOrgID": uni.getStorageSync("OrganizationID"), |
| | | "HMaker": getUserInfo()["Czymc"], |
| | | "HChecker": "", |
| | | "HCloseMan": "", |
| | | "HUpDater": "", |
| | | "HMakeDate": dayjs(new Date()).format("YYYY-MM-DD"), |
| | | "HCheckDate": "", |
| | | "HCloseDate": "", |
| | | "HUpDateDate": "", |
| | | "HDeleteMan": "", |
| | | "HDeleteDate": "", |
| | | "HRepairCheckMainID": 0, |
| | | "HRepairCheckMainContent": "", |
| | | }, |
| | | HBillSub: [{ // 后端接口需要。否则数据不会显示在缓存中 |
| | | "HRepairCheckID": 0, |
| | | "HRepairCheckCode": "", |
| | | "HRepairCheckName": "", |
| | | "HRepairCheckContent": "", |
| | | "HManagerID": 0, |
| | | "HManagerCode": "", |
| | | "HManagerName": "", |
| | | "HRemark": "", |
| | | "LAY_TABLE_INDEX": 0 |
| | | }] |
| | | }; |
| | | }, |
| | | computed: { |
| | | containerHeight: { |
| | | get() { |
| | | return this.btnTop - this.tabsBottom - 5 |
| | | } |
| | | }, |
| | | }, |
| | | methods: { |
| | | // 提交数据有效性校验 |
| | | ValidCheck() { |
| | | if (this.hform.HEquipID == 0) { |
| | | return { |
| | | Message: "未录入模具信息,请先录入模具信息!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HDeptID == 0) { |
| | | return { |
| | | Message: "部门不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HEmpID == 0) { |
| | | return { |
| | | Message: "验收人不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HRepairCheckMainID == 0) { |
| | | return { |
| | | Message: "验证项目不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HManagerID == 0) { |
| | | return { |
| | | Message: "负责人不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | hform: { |
| | | "HBillType": 3817, |
| | | "HBarCode": "", |
| | | "HBillNo": "", |
| | | "HInterID": 0, |
| | | "HDate": dayjs(new Date()).format("YYYY-MM-DD"), |
| | | "HInnerBillNo": "", |
| | | "HMouldName": "", |
| | | "HMouldSpec": "", |
| | | "HMouldModel": "", |
| | | "HMouldID": 0, |
| | | "HMainSourceBillType": "3815", |
| | | "HMainSourceInterID": 0, |
| | | "HMainSourceEntryID": 0, |
| | | "HCheckResult": "OK", |
| | | "HEmpName": getUserInfo().HEmpName, |
| | | "HEmpID": getUserInfo().HEmpID, |
| | | "HCheckBeginDate": dayjs(new Date()).format("YYYY-MM-DD"), |
| | | "HDeptName": getUserInfo().HDeptName, |
| | | "HDeptID": getUserInfo().HDeptID, |
| | | "HMainSourceBillNo": "", |
| | | "HManagerName": getUserInfo().HManagerName, |
| | | "HManagerID": getUserInfo().HManagerID, |
| | | "HMouldRepairWorkName": "", |
| | | "HMouldRepairWorkID": 0, |
| | | "HExplanation": "", |
| | | "HRemark": "", |
| | | "HOrgID": uni.getStorageSync("OrganizationID"), |
| | | "HStockOrgID": uni.getStorageSync("OrganizationID"), |
| | | "HMaker": getUserInfo()["Czymc"], |
| | | "HChecker": "", |
| | | "HCloseMan": "", |
| | | "HUpDater": "", |
| | | "HMakeDate": dayjs(new Date()).format("YYYY-MM-DD"), |
| | | "HCheckDate": "", |
| | | "HCloseDate": "", |
| | | "HUpDateDate": "", |
| | | "HDeleteMan": "", |
| | | "HDeleteDate": "", |
| | | "HRepairCheckMainID": 0, |
| | | "HRepairCheckMainContent": "", |
| | | }, |
| | | HBillSub: [{ // 后端接口需要。否则数据不会显示在缓存中 |
| | | "HRepairCheckID": 0, |
| | | "HRepairCheckCode": "", |
| | | "HRepairCheckName": "", |
| | | "HRepairCheckContent": "", |
| | | "HManagerID": 0, |
| | | "HManagerCode": "", |
| | | "HManagerName": "", |
| | | "HRemark": "", |
| | | "LAY_TABLE_INDEX": 0 |
| | | }] |
| | | }; |
| | | }, |
| | | computed: { |
| | | containerHeight: { |
| | | get() { |
| | | return this.btnTop - this.tabsBottom - 5 |
| | | } |
| | | }, |
| | | }, |
| | | methods: { |
| | | // 提交数据有效性校验 |
| | | ValidCheck() { |
| | | if (this.hform.HEquipID == 0) { |
| | | return { |
| | | Message: "未录入模具信息,请先录入模具信息!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HDeptID == 0) { |
| | | return { |
| | | Message: "部门不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HEmpID == 0) { |
| | | return { |
| | | Message: "验收人不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HRepairCheckMainID == 0) { |
| | | return { |
| | | Message: "验证项目不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HManagerID == 0) { |
| | | return { |
| | | Message: "负责人不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | |
| | | return { |
| | | Message: "", |
| | | state: true |
| | | } |
| | | }, |
| | | addNew() { |
| | | uni.redirectTo({ |
| | | url: './Sc_MouldRepairCheckBill?operationType=1' |
| | | }) |
| | | }, |
| | | goBack() { |
| | | uni.navigateBack() |
| | | }, |
| | | showBillList() { |
| | | this.$refs.billList.showPopup() |
| | | }, |
| | | showRepairRecordList() { |
| | | if (this.hform.HMouldID === 0) { |
| | | CommonUtils.showTips({ |
| | | title: '提示', |
| | | message: '请先选择模具' |
| | | }); |
| | | return; |
| | | } |
| | | this.$refs.repairRecordList.showPopup(this.hform.HMouldID); |
| | | }, |
| | | //选择源单类型 |
| | | HMainSourceBillTypeChange(e) { |
| | | if (e.detail.value == -1 || e.detail.value == NaN) { |
| | | this.HMainSourceBillType = '手工录入' |
| | | this.hform.HMainSourceBillType = -1 |
| | | return |
| | | } |
| | | console.log(e.detail.value) |
| | | console.log(e) |
| | | this.HMainSourceBillType = this.arrayHMainSourceBillType[e.detail.value] |
| | | this.hform.HMainSourceBillType = this.arrayHMainSourceBillTypeID[e.detail.value] |
| | | const pages = getCurrentPages() |
| | | // 获取页面栈中的最后一个元素,也就是当前显示的页面 |
| | | const currentPage = pages[pages.length - 1] |
| | | // 选择源单类型后 缓存当前页面选择 |
| | | uni.setStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`, { |
| | | HSourceBillTypeName: this.HMainSourceBillType, |
| | | HSourceBillType: this.hform.HMainSourceBillType |
| | | }) |
| | | }, |
| | | checkBoxChangeHandler(index, e) { |
| | | let cr = e.detail.value |
| | | if (cr.length == 0) { |
| | | this.HCheckFileList[index]["HDotCheckResult"] = false |
| | | } else { |
| | | this.HCheckFileList[index]["HDotCheckResult"] = true |
| | | } |
| | | }, |
| | | //获取使用部门数据 |
| | | async getHDeptList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Gy_Department/list', |
| | | data: { |
| | | sWhere: ` and HUSEORGID = ${uni.getStorageSync('OrganizationID')}`, |
| | | user: uni.getStorageSync('HUserName'), |
| | | Organization: uni.getStorageSync('Organization') |
| | | } |
| | | }) |
| | | return { |
| | | Message: "", |
| | | state: true |
| | | } |
| | | }, |
| | | addNew() { |
| | | uni.redirectTo({ |
| | | url: './Sc_MouldRepairCheckBill?operationType=1' |
| | | }) |
| | | }, |
| | | goBack() { |
| | | uni.navigateBack() |
| | | }, |
| | | showBillList() { |
| | | this.$refs.billList.showPopup() |
| | | }, |
| | | showRepairRecordList() { |
| | | if (this.hform.HMouldID === 0) { |
| | | CommonUtils.showTips({ |
| | | title: '提示', |
| | | message: '请先选择模具' |
| | | }); |
| | | return; |
| | | } |
| | | this.$refs.repairRecordList.showPopup(this.hform.HMouldID); |
| | | }, |
| | | //选择源单类型 |
| | | HMainSourceBillTypeChange(e) { |
| | | if (e.detail.value == -1 || e.detail.value == NaN) { |
| | | this.HMainSourceBillType = '手工录入' |
| | | this.hform.HMainSourceBillType = -1 |
| | | return |
| | | } |
| | | console.log(e.detail.value) |
| | | console.log(e) |
| | | this.HMainSourceBillType = this.arrayHMainSourceBillType[e.detail.value] |
| | | this.hform.HMainSourceBillType = this.arrayHMainSourceBillTypeID[e.detail.value] |
| | | const pages = getCurrentPages() |
| | | // 获取页面栈中的最后一个元素,也就是当前显示的页面 |
| | | const currentPage = pages[pages.length - 1] |
| | | // 选择源单类型后 缓存当前页面选择 |
| | | uni.setStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`, { |
| | | HSourceBillTypeName: this.HMainSourceBillType, |
| | | HSourceBillType: this.hform.HMainSourceBillType |
| | | }) |
| | | }, |
| | | checkBoxChangeHandler(index, e) { |
| | | let cr = e.detail.value |
| | | if (cr.length == 0) { |
| | | this.HCheckFileList[index]["HDotCheckResult"] = false |
| | | } else { |
| | | this.HCheckFileList[index]["HDotCheckResult"] = true |
| | | } |
| | | }, |
| | | //获取使用部门数据 |
| | | async getHDeptList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Gy_Department/list', |
| | | data: { |
| | | sWhere: ` and HUSEORGID = ${uni.getStorageSync('OrganizationID')}`, |
| | | user: uni.getStorageSync('HUserName'), |
| | | Organization: uni.getStorageSync('Organization') |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HDeptList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | // 获取职员数据 |
| | | async getEmpList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/PublicPageMethod/UserList', |
| | | data: { |
| | | sWhere: " where 1=1", |
| | | } |
| | | }) |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HDeptList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | // 获取职员数据 |
| | | async getEmpList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/PublicPageMethod/UserList', |
| | | data: { |
| | | sWhere: " where 1=1", |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HEmpList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | // 获取验证项目数据 |
| | | async getCheckProjList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Gy_RepairCheck/GetRepairCheckList', |
| | | data: { |
| | | sWhere: "", |
| | | user: uni.getStorageSync('HUserName'), |
| | | } |
| | | }) |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HEmpList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | // 获取验证项目数据 |
| | | async getCheckProjList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Gy_RepairCheck/GetRepairCheckList', |
| | | data: { |
| | | sWhere: "", |
| | | user: uni.getStorageSync('HUserName'), |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HRepairCheckList = 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: "/Sc_PDA_MouldRepairCheckBill/txtHBarCode_KeyDown_List", |
| | | data: { |
| | | HBarCode: HBarCode, |
| | | }, |
| | | }) |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HRepairCheckList = 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: "/Sc_PDA_MouldRepairCheckBill/txtHBarCode_KeyDown_List", |
| | | data: { |
| | | HBarCode: HBarCode, |
| | | }, |
| | | }) |
| | | |
| | | |
| | | if (!res) { |
| | | return |
| | | } |
| | | if (!res) { |
| | | return |
| | | } |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | |
| | | if (count == 1) { |
| | | console.log('data: ', data); |
| | | this.hform.HMouldID = data[0].hmainid |
| | | this.hform.HMouldName = data[0].模具名称 |
| | | this.hform.HMouldSpec = data[0].模具品类 |
| | | this.hform.HMouldModel = data[0].模具型号 |
| | | this.hform.HQty = 1 |
| | | if (count == 1) { |
| | | console.log('data: ', data); |
| | | this.hform.HMouldID = data[0].hmainid |
| | | this.hform.HMouldName = data[0].模具名称 |
| | | this.hform.HMouldSpec = data[0].模具品类 |
| | | this.hform.HMouldModel = data[0].模具型号 |
| | | this.hform.HQty = 1 |
| | | |
| | | this.enableEdit = false |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: Message |
| | | }) |
| | | } |
| | | this.enableEdit = false |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: Message |
| | | }) |
| | | } |
| | | |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | radioChange({ |
| | | detail: { |
| | | value |
| | | } |
| | | }) { |
| | | this.hform.HCheckResult = value |
| | | }, |
| | | async getMaxNum() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Web/GetMAXNum", |
| | | data: { |
| | | "HBillType": this.HBillType |
| | | } |
| | | }) |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | 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 = 0 |
| | | this.hform.HBillNo = data[0]["HBillNo"] |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "获取单据信息异常: " + err |
| | | }) |
| | | } |
| | | }, |
| | | async submit() { |
| | | let valid = this.ValidCheck() |
| | | if (!valid.state) { |
| | | CommonUtils.showTips({ |
| | | message: valid.Message |
| | | }) |
| | | return |
| | | } |
| | | 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() { |
| | | let valid = this.ValidCheck() |
| | | if (!valid.state) { |
| | | CommonUtils.showTips({ |
| | | message: valid.Message |
| | | }) |
| | | return |
| | | } |
| | | |
| | | try { |
| | | let oMain = JSON.stringify(this.hform); |
| | | this.HBillSub[0].HRepairCheckID = this.hform.HRepairCheckMainID |
| | | this.HBillSub[0].HManagerID = this.hform.HManagerID |
| | | this.HBillSub[0].HRepairCheckContent = this.hform.HRepairCheckMainContent |
| | | let sSubStr = JSON.stringify(this.HBillSub); |
| | | let sMainSub = oMain + ';' + sSubStr + ';' + getUserInfo()['Czymc']; |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: "/Sc_MouldRepairCheckBill/SaveGetMouldRepairCheckBillList", |
| | | data: { |
| | | "msg": sMainSub |
| | | }, |
| | | method: "POST" |
| | | }) |
| | | try { |
| | | let oMain = JSON.stringify(this.hform); |
| | | this.HBillSub[0].HRepairCheckID = this.hform.HRepairCheckMainID |
| | | this.HBillSub[0].HManagerID = this.hform.HManagerID |
| | | this.HBillSub[0].HRepairCheckContent = this.hform.HRepairCheckMainContent |
| | | let sSubStr = JSON.stringify(this.HBillSub); |
| | | let sMainSub = oMain + ';' + sSubStr + ';' + getUserInfo()['Czymc']; |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: "/Sc_MouldRepairCheckBill/SaveGetMouldRepairCheckBillList", |
| | | data: { |
| | | "msg": sMainSub |
| | | }, |
| | | method: "POST" |
| | | }) |
| | | |
| | | if (!res) { |
| | | return |
| | | } |
| | | 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/Sb_EquipRepairCheck/Sb_EquipRepairCheckBill?operationType=1' |
| | | }) |
| | | } else if (res.cancel) { |
| | | console.log('用户点击取消'); |
| | | setTimeout(() => { |
| | | uni.navigateBack(); |
| | | }, 50) |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "提交单据失败: " + Message |
| | | }) |
| | | } |
| | | 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/Sb_EquipRepairCheck/Sb_EquipRepairCheckBill?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); |
| | | if (!e.operationType) { |
| | | this.operationType = 1 |
| | | } else { |
| | | this.operationType = e.operationType |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "提交单据失败: " + err |
| | | }) |
| | | } |
| | | }, |
| | | async getSourceBillInfo(HSourceBillType, HInterID, HBillNo) { |
| | | // 下推单据类型为设备故障登记单 |
| | | if(HSourceBillType == 3815) { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Sc_MouldConkBookBill/Sb_MouldConkBookBillListCheckDetai", |
| | | data: { |
| | | HID: HInterID |
| | | } |
| | | }) |
| | | |
| | | let {data,code, count, Message} = res.data |
| | | console.log('data: ',data); |
| | | if(code == 1) { |
| | | console.log('data: ',data.h_v_Sc_MouldConkBookBillList_Edit); |
| | | let data1 = data.h_v_Sc_MouldConkBookBillList_Edit[0] |
| | | this.hform.HMainSourceBillType = HSourceBillType |
| | | this.HMainSourceBillType = '器具故障登记单' |
| | | this.hform.HMainSourceBillNo = data1.单据号 |
| | | this.hform.HMainSourceInterID = data1.hmainid |
| | | this.hform.HMainSourceEntryID = data1.hsubid |
| | | this.hform.HMouldID = data1.HMouldID |
| | | this.hform.HManagerName = data1.负责人 |
| | | this.hform.HManagerID = data1.HManagerID |
| | | this.hform.HMouldName = data1.产品模具 |
| | | this.hform.HMouldModel = data1.产品模具型号 |
| | | this.hform.HMouldSpec = data1.产品模具规格 |
| | | } |
| | | else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `获取源单失败: ${Message}` |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | onLoad(e) { |
| | | console.log('e: ', e); |
| | | 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) { |
| | | // 编辑 |
| | | if (this.operationType == 1) { |
| | | // 新增 |
| | | this.getMaxNum() |
| | | } else if (this.operationType == 2) { |
| | | // 复制 |
| | | } else if (this.operationType == 3) { |
| | | // 编辑 |
| | | |
| | | } else if (this.operationType == 4) { |
| | | // 浏览 |
| | | } else if (this.operationType == 4) { |
| | | // 下推 |
| | | // 下推 |
| | | let { |
| | | HSourceBillType, |
| | | HInterID, |
| | | HBillNo |
| | | } = e |
| | | // 下推 |
| | | // this.enableEdit = false; |
| | | // this.enableSourceBillEdit = false; |
| | | // this.showHMainSourceBillType = false; |
| | | this.getMaxNum() |
| | | this.getSourceBillInfo(HSourceBillType, HInterID, HBillNo) |
| | | } |
| | | |
| | | } |
| | | |
| | | this.getHDeptList() |
| | | this.getEmpList() |
| | | this.getCheckProjList() |
| | | // 监听故障登记单选择完成事件 |
| | | uni.$on('BillSelectComplete', (e) => { |
| | | console.log("接收到的消息: ", e) |
| | | this.hform.HMainSourceInterID = e.HInterID |
| | | this.hform.HMainSourceBillNo = e.HBillNo |
| | | this.hform.HMainSourceEntryID = e.HEntryID |
| | | this.hform.HMouldID = e.HMouldID |
| | | this.hform.HMouldName = e.HMouldName |
| | | this.hform.HMouldSpec = e.HMouldSpec |
| | | this.hform.HMouldModel = e.HMouldModel |
| | | this.$refs.billList.exit() |
| | | }) |
| | | // 监听维修记录选择完成事件 |
| | | uni.$on('RepairRecordSelectComplete', (e) => { |
| | | console.log("接收到维修记录选择: ", e); |
| | | if (e.HInterID) { |
| | | this.hform.HMouldRepairWorkName = e.HBillNo; |
| | | this.hform.HMouldRepairWorkID = e.HInterID; |
| | | // 可以根据需要设置其他字段 |
| | | } |
| | | this.$refs.repairRecordList.exit(); |
| | | }); |
| | | }, |
| | | onUnload() { |
| | | uni.$off('BillSelectComplete'); |
| | | uni.$off('RepairRecordSelectComplete'); |
| | | }, |
| | | 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) |
| | | }) |
| | | } |
| | | } |
| | | this.getHDeptList() |
| | | this.getEmpList() |
| | | this.getCheckProjList() |
| | | // 监听故障登记单选择完成事件 |
| | | uni.$on('BillSelectComplete', (e) => { |
| | | console.log("接收到的消息: ", e) |
| | | this.hform.HMainSourceInterID = e.HInterID |
| | | this.hform.HMainSourceBillNo = e.HBillNo |
| | | this.hform.HMainSourceEntryID = e.HEntryID |
| | | this.hform.HMouldID = e.HMouldID |
| | | this.hform.HMouldName = e.HMouldName |
| | | this.hform.HMouldSpec = e.HMouldSpec |
| | | this.hform.HMouldModel = e.HMouldModel |
| | | this.$refs.billList.exit() |
| | | }) |
| | | // 监听维修记录选择完成事件 |
| | | uni.$on('RepairRecordSelectComplete', (e) => { |
| | | console.log("接收到维修记录选择: ", e); |
| | | if (e.HInterID) { |
| | | this.hform.HMouldRepairWorkName = e.HBillNo; |
| | | this.hform.HMouldRepairWorkID = e.HInterID; |
| | | // 可以根据需要设置其他字段 |
| | | } |
| | | this.$refs.repairRecordList.exit(); |
| | | }); |
| | | }, |
| | | onUnload() { |
| | | uni.$off('BillSelectComplete'); |
| | | uni.$off('RepairRecordSelectComplete'); |
| | | }, |
| | | 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" |
| | | @import "@/pages/MJGL/style/MJBillStyle.scss" |
| | | </style> |
| | |
| | | }) |
| | | return |
| | | } |
| | | |
| | | |
| | | try { |
| | | let oMain = JSON.stringify(this.hform); |
| | | this.HDetailList[0].HManagerID = this.hform.HManagerID |
| | |
| | | this.HDetailList[0].HSourceBillNo = this.hform.HMainSourceBillNo |
| | | |
| | | let sSubStr = JSON.stringify(this.HDetailList); |
| | | let sMainSub = oMain + ';' + sSubStr + `;-1;${this.operationType}` + ';' + getUserInfo()[ |
| | | 'Czymc']; |
| | | let sMainSub = oMain + ';' + sSubStr; |
| | | console.log('sMainSub: ',sMainSub); |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: "/Sb_PDA_EqpRepairWorkBill/SaveGetEqpRepairWorkBillList", |
| | | data: { |
| | |
| | | message: err |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | async getSourceBillInfo(HSourceBillType, HInterID, HBillNo) { |
| | | // 下推单据类型为设备故障登记单 |
| | | if(HSourceBillType == 3907) { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Sb_EqpRepairWorkBill/Sb_EqpConkBookBillListCheckDetai", |
| | | data: { |
| | | HID: HInterID |
| | | } |
| | | }) |
| | | |
| | | let {data,code, count, Message} = res.data |
| | | |
| | | if(code == 1) { |
| | | console.log('data: ',data.h_v_Sb_EquipConkBookBillList_Edit); |
| | | let data1 = data.h_v_Sb_EquipConkBookBillList_Edit[0] |
| | | this.hform.HMainSourceBillType = HSourceBillType |
| | | this.HMainSourceBillType = '设备故障登记单' |
| | | this.hform.HMainSourceBillNo = data1.单据号 |
| | | this.hform.HMainSourceInterID = data1.hmainid |
| | | this.hform.HMainSourceEntryID = data1.hsubid |
| | | this.hform.HEquipID = data1.HEquipID |
| | | this.hform.HManagerName = data1.负责人 |
| | | this.hform.HManagerID = data1.HManagerID |
| | | this.hform.HBarName = data1.设备名称 |
| | | this.hform.HBarModel = data1.设备型号 |
| | | this.hform.HBarSpec = data1.设备规格 |
| | | } |
| | | else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `获取源单失败: ${Message}` |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | onLoad(e) { |
| | | console.log('e: ', e); |
| | |
| | | let HEquipID = e.HEquipID |
| | | this.getMaxNum() |
| | | this.getEquipFileMain(HEquipID) |
| | | } |
| | | } else if(this.operationType == 5) { |
| | | let {HSourceBillType, HInterID, HBillNo} = e |
| | | // 下推 |
| | | this.getMaxNum() |
| | | this.getSourceBillInfo(HSourceBillType, HInterID, HBillNo) |
| | | } |
| | | |
| | | this.getHDeptList() |
| | | this.getEmpList() |
| | |
| | | // 编辑 |
| | | |
| | | } else if (this.operationType == 4) { |
| | | // 浏览 |
| | | |
| | | // 下推 |
| | | let HBarCode = e.HBarCode |
| | | this.getMaxNum() |
| | | this.GetMessageByBarCode(HBarCode) |
| | | } |
| | | |
| | | this.getHDeptList() |
| | |
| | | <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="{ |
| | | <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="enableEdit?'right':'righton'"> |
| | | <input v-model="hform.HBarCode" :disabled="!enableEdit" |
| | | @confirm="GetMessageByBarCode(hform.HBarCode)" placeholder="请输入(或扫描)设备条码" /> |
| | | </view> |
| | | <view class="icon-wrapper"> |
| | | <uni-icons type="scan" size="20" @click="toScanCode"></uni-icons> |
| | | </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.HCheckResult == 'OK'" /> |
| | | <text>OK</text> |
| | | </view> |
| | | </label> |
| | | </label> |
| | | <view> |
| | | <radio value="NG" :checked="hform.HCheckResult == 'NG'" /> |
| | | <text>NG</text> |
| | | </view> |
| | | </label> |
| | | </radio-group> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">验收内容:</view> |
| | | <view class="right"> |
| | | <textarea v-model="HDetailList[0].HRepairCheckContent" placeholder="请输入验收内容" /> |
| | | </view> |
| | | </view> |
| | | <!-- 维修记录(源单) --> |
| | | <view class="form-item"> |
| | | <view class="title required">维修记录:</view> |
| | | <view :class="enableSourceBillEdit?'right':'righton'"> |
| | | <input v-model="hform.HMainSourceBillNo" :disabled="!enableSourceBillEdit" |
| | | @confirm="GetMessageByHMainSourceBillNo(hform.HMainSourceBillNo)" |
| | | placeholder="请输入(或扫描)维修记录单号" /> |
| | | </view> |
| | | <!-- 放大镜图标 --> |
| | | <view class="icon-wrapper"> |
| | | <uni-icons type="search" size="20" @click="showBillList"></uni-icons> |
| | | </view> |
| | | <!-- 扫描图标 --> |
| | | <view class="icon-wrapper"> |
| | | <uni-icons type="scan" size="20" @click="toScanHMainSourceBillNo"></uni-icons> |
| | | </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 required">部门:</view> |
| | | <zxz-uni-data-select required class="right" :localdata="HDeptList" dataKey="部门名称" |
| | | dataValue="HItemID" v-model="hform.HDeptID"> |
| | | </zxz-uni-data-select> |
| | | </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.HEmpID"> |
| | | </zxz-uni-data-select> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title required">验收项目:</view> |
| | | <zxz-uni-data-select required class="right" :localdata="HRepairCheckList" dataKey="维修验收项目" |
| | | dataValue="hitemid" v-model="hform.HRepairCheckID"> |
| | | </zxz-uni-data-select> |
| | | </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.HManagerID"> |
| | | </zxz-uni-data-select> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">设备名称:</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> |
| | | </template> |
| | | <!-- 其他信息 --> |
| | | <template v-if="tabs == 2"> |
| | | <view class="form" :style="{ |
| | | <view class="form-item"> |
| | | <view class="title">设备条码:</view> |
| | | <view :class="enableEdit?'right':'righton'"> |
| | | <input v-model="hform.HBarCode" :disabled="!enableEdit" |
| | | @confirm="GetMessageByBarCode(hform.HBarCode)" placeholder="请输入(或扫描)设备条码" /> |
| | | </view> |
| | | <view class="icon-wrapper"> |
| | | <uni-icons type="scan" size="20" @click="toScanCode"></uni-icons> |
| | | </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.HCheckResult == 'OK'" /> |
| | | <text>OK</text> |
| | | </view> |
| | | </label> |
| | | </label> |
| | | <view> |
| | | <radio value="NG" :checked="hform.HCheckResult == 'NG'" /> |
| | | <text>NG</text> |
| | | </view> |
| | | </label> |
| | | </radio-group> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">验收内容:</view> |
| | | <view class="right"> |
| | | <textarea v-model="HDetailList[0].HRepairCheckContent" placeholder="请输入验收内容" /> |
| | | </view> |
| | | </view> |
| | | <!-- 维修记录(源单) --> |
| | | <view class="form-item"> |
| | | <view class="title required">维修记录:</view> |
| | | <view :class="enableSourceBillEdit?'right':'righton'"> |
| | | <input v-model="hform.HMainSourceBillNo" :disabled="!enableSourceBillEdit" |
| | | @confirm="GetMessageByHMainSourceBillNo(hform.HMainSourceBillNo)" |
| | | placeholder="请输入(或扫描)维修记录单号" /> |
| | | </view> |
| | | <!-- 放大镜图标 --> |
| | | <view class="icon-wrapper"> |
| | | <uni-icons type="search" size="20" @click="showBillList"></uni-icons> |
| | | </view> |
| | | <!-- 扫描图标 --> |
| | | <view class="icon-wrapper"> |
| | | <uni-icons type="scan" size="20" @click="toScanHMainSourceBillNo"></uni-icons> |
| | | </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 required">部门:</view> |
| | | <zxz-uni-data-select required class="right" :localdata="HDeptList" dataKey="部门名称" |
| | | dataValue="HItemID" v-model="hform.HDeptID"> |
| | | </zxz-uni-data-select> |
| | | </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.HEmpID"> |
| | | </zxz-uni-data-select> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title required">验收项目:</view> |
| | | <zxz-uni-data-select required class="right" :localdata="HRepairCheckList" dataKey="维修验收项目" |
| | | dataValue="hitemid" v-model="hform.HRepairCheckID"> |
| | | </zxz-uni-data-select> |
| | | </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.HManagerID"> |
| | | </zxz-uni-data-select> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">设备名称:</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> |
| | | </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 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> |
| | | </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> |
| | | |
| | | <!-- 源单单据列表弹窗 --> |
| | | <BillListPopupEquipConkBookBillVue ref="billList" :HBillType="hform.HBillType" :HSourceBillType="'设备维修记录单'" |
| | | :HStockOrgID="hform.HStockOrgID"> |
| | | </BillListPopupEquipConkBookBillVue> |
| | | </view> |
| | | <!-- 源单单据列表弹窗 --> |
| | | <BillListPopupEquipConkBookBillVue ref="billList" :HBillType="hform.HBillType" :HSourceBillType="'设备维修记录单'" |
| | | :HStockOrgID="hform.HStockOrgID"> |
| | | </BillListPopupEquipConkBookBillVue> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import dayjs from "dayjs"; |
| | | import { |
| | | CommonUtils |
| | | } from "@/utils/common"; |
| | | import { |
| | | MpaasScan |
| | | } from "@/utils/mpaasScan.js" |
| | | import { |
| | | getUserInfo |
| | | } from "../../../utils/auth"; |
| | | // 引入源单单据列表弹窗组件 |
| | | import BillListPopupEquipConkBookBillVue from '../../../components/BillListPopup/BillListPopupEquipConkBookBill.vue'; |
| | | import dayjs from "dayjs"; |
| | | import { |
| | | CommonUtils |
| | | } from "@/utils/common"; |
| | | import { |
| | | MpaasScan |
| | | } from "@/utils/mpaasScan.js" |
| | | import { |
| | | getUserInfo |
| | | } from "../../../utils/auth"; |
| | | // 引入源单单据列表弹窗组件 |
| | | import BillListPopupEquipConkBookBillVue from '../../../components/BillListPopup/BillListPopupEquipConkBookBill.vue'; |
| | | |
| | | export default { |
| | | name: 'sb_EquipRepairCheckBill', |
| | | components: { |
| | | BillListPopupEquipConkBookBillVue |
| | | }, |
| | | data() { |
| | | return { |
| | | tabs: 0, |
| | | btnTop: 0, |
| | | tabsBottom: 0, |
| | | HModName: "sb_EquipRepairCheckBill", |
| | | HBillType: '3911', |
| | | operationType: 1, |
| | | uploadOptions: {}, |
| | | enableEdit: true, |
| | | enableSourceBillEdit: true, // 新增:控制维修记录编辑状态 |
| | | export default { |
| | | name: 'sb_EquipRepairCheckBill', |
| | | components: { |
| | | BillListPopupEquipConkBookBillVue |
| | | }, |
| | | data() { |
| | | return { |
| | | tabs: 0, |
| | | btnTop: 0, |
| | | tabsBottom: 0, |
| | | HModName: "sb_EquipRepairCheckBill", |
| | | HBillType: '3911', |
| | | operationType: 1, |
| | | uploadOptions: {}, |
| | | enableEdit: true, |
| | | enableSourceBillEdit: true, // 新增:控制维修记录编辑状态 |
| | | |
| | | HDeptList: [], |
| | | HRepairCheckList: [], |
| | | HEmpList: [], |
| | | HDeptList: [], |
| | | HRepairCheckList: [], |
| | | HEmpList: [], |
| | | |
| | | hform: { |
| | | "HBillType": '3911', |
| | | "HBarCode": "", |
| | | "HCheckBeginDate": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"), |
| | | "HCheckResult": "OK", |
| | | "HRepairCheckContent": "", |
| | | "HBillNo": "", |
| | | "HInterID": 0, |
| | | "HDate": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"), |
| | | "HDeptName": getUserInfo().HDeptName, |
| | | "HDeptID": getUserInfo().HDeptID, |
| | | "HEmpName": getUserInfo().HEmpName, |
| | | "HEmpID": getUserInfo().HEmpID, |
| | | "HManagerName": getUserInfo().HManagerName, |
| | | "HManagerID": getUserInfo().HManagerID, |
| | | "HRepairCheckMainName": "", |
| | | "HRepairCheckID": 0, |
| | | "HBarName": "", |
| | | "HEquipID": 0, |
| | | "HBarSpec": "", |
| | | "HBarModel": "", |
| | | "HMaker": getUserInfo()["Czymc"], |
| | | "HMakeDate": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"), |
| | | "HUpDater": "", |
| | | "HUpDateDate": "", |
| | | "HChecker": "", |
| | | "HCheckDate": "", |
| | | "HDeleteMan": "", |
| | | "HDeleteDate": "", |
| | | "lngBillKey": "", |
| | | "lngBillSubKey": "", |
| | | // 新增:维修记录(源单)相关字段 |
| | | "HMainSourceBillNo": "", |
| | | "HMainSourceInterID": 0, |
| | | "HMainSourceEntryID": 0, |
| | | "HMouldRepairWorkName":"", |
| | | "HMouldRepairWorkID":0, |
| | | "HStockOrgID": uni.getStorageSync("OrganizationID"), |
| | | }, |
| | | HDetailList: [{ // 后端接口提交需要 明细信息 |
| | | "HRepairCheckID": 0, |
| | | "HRepairCode": "", |
| | | "HRepairName": "", |
| | | "HManagerID": 0, |
| | | "HManagerCode": "", |
| | | "HManagerName": "", |
| | | "HRepairCheckContent": "", |
| | | "HRemark": "", |
| | | "LAY_TABLE_INDEX": 0 |
| | | }] |
| | | }; |
| | | }, |
| | | computed: { |
| | | containerHeight: { |
| | | get() { |
| | | return this.btnTop - this.tabsBottom - 5 |
| | | } |
| | | }, |
| | | }, |
| | | methods: { |
| | | // 显示源单单据列表弹窗 |
| | | showBillList() { |
| | | this.$refs.billList.showPopup(); |
| | | }, |
| | | hform: { |
| | | "HBillType": '3911', |
| | | "HBarCode": "", |
| | | "HCheckBeginDate": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"), |
| | | "HCheckResult": "OK", |
| | | "HRepairCheckContent": "", |
| | | "HBillNo": "", |
| | | "HInterID": 0, |
| | | "HDate": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"), |
| | | "HDeptName": getUserInfo().HDeptName, |
| | | "HDeptID": getUserInfo().HDeptID, |
| | | "HEmpName": getUserInfo().HEmpName, |
| | | "HEmpID": getUserInfo().HEmpID, |
| | | "HManagerName": getUserInfo().HManagerName, |
| | | "HManagerID": getUserInfo().HManagerID, |
| | | "HRepairCheckMainName": "", |
| | | "HRepairCheckID": 0, |
| | | "HBarName": "", |
| | | "HEquipID": 0, |
| | | "HBarSpec": "", |
| | | "HBarModel": "", |
| | | "HMaker": getUserInfo()["Czymc"], |
| | | "HMakeDate": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"), |
| | | "HUpDater": "", |
| | | "HUpDateDate": "", |
| | | "HChecker": "", |
| | | "HCheckDate": "", |
| | | "HDeleteMan": "", |
| | | "HDeleteDate": "", |
| | | "lngBillKey": "", |
| | | "lngBillSubKey": "", |
| | | // 新增:维修记录(源单)相关字段 |
| | | "HMainSourceBillNo": "", |
| | | "HMainSourceInterID": 0, |
| | | "HMainSourceEntryID": 0, |
| | | "HMouldRepairWorkName": "", |
| | | "HMouldRepairWorkID": 0, |
| | | "HStockOrgID": uni.getStorageSync("OrganizationID"), |
| | | }, |
| | | HDetailList: [{ // 后端接口提交需要 明细信息 |
| | | "HRepairCheckID": 0, |
| | | "HRepairCode": "", |
| | | "HRepairName": "", |
| | | "HManagerID": 0, |
| | | "HManagerCode": "", |
| | | "HManagerName": "", |
| | | "HRepairCheckContent": "", |
| | | "HRemark": "", |
| | | "LAY_TABLE_INDEX": 0 |
| | | }] |
| | | }; |
| | | }, |
| | | computed: { |
| | | containerHeight: { |
| | | get() { |
| | | return this.btnTop - this.tabsBottom - 5 |
| | | } |
| | | }, |
| | | }, |
| | | methods: { |
| | | // 显示源单单据列表弹窗 |
| | | showBillList() { |
| | | this.$refs.billList.showPopup(); |
| | | }, |
| | | |
| | | // 扫描维修记录单号 |
| | | toScanHMainSourceBillNo() { |
| | | MpaasScan.scanCode(cb => { |
| | | this.hform.HMainSourceBillNo = cb; |
| | | this.GetMessageByHMainSourceBillNo(cb); |
| | | }); |
| | | }, |
| | | // 扫描维修记录单号 |
| | | toScanHMainSourceBillNo() { |
| | | MpaasScan.scanCode(cb => { |
| | | this.hform.HMainSourceBillNo = cb; |
| | | this.GetMessageByHMainSourceBillNo(cb); |
| | | }); |
| | | }, |
| | | |
| | | // 根据维修记录单号获取信息 |
| | | async GetMessageByHMainSourceBillNo(HSouceBillNo) { |
| | | try { |
| | | let url = "/Sb_EqpRepairWorkBill/GetEqpRepairWorkBillListPage"; |
| | | let dataField = { |
| | | sWhere: ` and 单据号 = '${HSouceBillNo}'`, |
| | | user: getUserInfo()["Czymc"], |
| | | page: 1, |
| | | size: 1, |
| | | }; |
| | | // 根据维修记录单号获取信息 |
| | | async GetMessageByHMainSourceBillNo(HSouceBillNo) { |
| | | try { |
| | | let url = "/Sb_EqpRepairWorkBill/GetEqpRepairWorkBillListPage"; |
| | | let dataField = { |
| | | sWhere: ` and 单据号 = '${HSouceBillNo}'`, |
| | | user: getUserInfo()["Czymc"], |
| | | page: 1, |
| | | size: 1, |
| | | }; |
| | | |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: url, |
| | | data: dataField |
| | | }); |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: url, |
| | | data: dataField |
| | | }); |
| | | |
| | | let { |
| | | count, |
| | | Message, |
| | | data |
| | | } = res.data; |
| | | if (count == 1) { |
| | | this.hform.HMainSourceBillNo = data[0]["单据号"]; |
| | | this.hform.HMainSourceInterID = data[0]["hmainid"]; |
| | | this.hform.HMainSourceEntryID = data[0]["hsubid"]; |
| | | let { |
| | | count, |
| | | Message, |
| | | data |
| | | } = res.data; |
| | | if (count == 1) { |
| | | this.hform.HMainSourceBillNo = data[0]["单据号"]; |
| | | this.hform.HMainSourceInterID = data[0]["hmainid"]; |
| | | this.hform.HMainSourceEntryID = data[0]["hsubid"]; |
| | | |
| | | // 如果源单有设备信息,可以自动填充 |
| | | if (data[0].HEquipID) { |
| | | this.hform.HEquipID = data[0].HEquipID; |
| | | this.getEquipFileMain(data[0].HEquipID); |
| | | } |
| | | // 如果源单有设备信息,可以自动填充 |
| | | if (data[0].HEquipID) { |
| | | this.hform.HEquipID = data[0].HEquipID; |
| | | this.getEquipFileMain(data[0].HEquipID); |
| | | } |
| | | |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `获取维修记录单失败: ${Message}` |
| | | }); |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `获取维修记录单失败: ${err}` |
| | | }); |
| | | } |
| | | }, |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `获取维修记录单失败: ${Message}` |
| | | }); |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `获取维修记录单失败: ${err}` |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // 根据设备ID获取设备信息 |
| | | async getEquipFileMain(HInterID) { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: "/Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown_ListByHEquipID", |
| | | data: { |
| | | HEquipID: HInterID, |
| | | }, |
| | | }); |
| | | // 根据设备ID获取设备信息 |
| | | async getEquipFileMain(HInterID) { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: "/Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown_ListByHEquipID", |
| | | data: { |
| | | HEquipID: HInterID, |
| | | }, |
| | | }); |
| | | |
| | | if (!res) { |
| | | return; |
| | | } |
| | | if (!res) { |
| | | return; |
| | | } |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data; |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data; |
| | | |
| | | if (count == 1) { |
| | | this.hform.HEquipID = data[0].hmainid; |
| | | this.hform.HBarName = data[0].设备名称; |
| | | this.hform.HBarSpec = data[0].设备规格; |
| | | this.hform.HBarModel = data[0].设备型号; |
| | | this.hform.HBarCode = data[0].设备条码 || ""; |
| | | this.enableEdit = false; |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: Message |
| | | }); |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: err |
| | | }); |
| | | } |
| | | }, |
| | | if (count == 1) { |
| | | this.hform.HEquipID = data[0].hmainid; |
| | | this.hform.HBarName = data[0].设备名称; |
| | | this.hform.HBarSpec = data[0].设备规格; |
| | | this.hform.HBarModel = data[0].设备型号; |
| | | this.hform.HBarCode = data[0].设备条码 || ""; |
| | | this.enableEdit = false; |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: Message |
| | | }); |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: err |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // 提交数据有效性校验 |
| | | ValidCheck() { |
| | | if (this.hform.HEquipID == 0) { |
| | | return { |
| | | Message: "未录入设备信息,请先录入设备信息!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HDeptID == 0) { |
| | | return { |
| | | Message: "部门不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HEmpID == 0) { |
| | | return { |
| | | Message: "验收人不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HRepairCheckID == 0) { |
| | | return { |
| | | Message: "验证项目不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HManagerID == 0) { |
| | | return { |
| | | Message: "负责人不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | // 新增:维修记录校验 |
| | | if (!this.hform.HMainSourceBillNo || this.hform.HMainSourceBillNo.trim() === '') { |
| | | return { |
| | | Message: "维修记录不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | // 提交数据有效性校验 |
| | | ValidCheck() { |
| | | if (this.hform.HEquipID == 0) { |
| | | return { |
| | | Message: "未录入设备信息,请先录入设备信息!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HDeptID == 0) { |
| | | return { |
| | | Message: "部门不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HEmpID == 0) { |
| | | return { |
| | | Message: "验收人不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HRepairCheckID == 0) { |
| | | return { |
| | | Message: "验证项目不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HManagerID == 0) { |
| | | return { |
| | | Message: "负责人不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | // 新增:维修记录校验 |
| | | if (!this.hform.HMainSourceBillNo || this.hform.HMainSourceBillNo.trim() === '') { |
| | | return { |
| | | Message: "维修记录不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | |
| | | return { |
| | | Message: "", |
| | | state: true |
| | | } |
| | | }, |
| | | addNew() { |
| | | uni.redirectTo({ |
| | | url: './Sb_EquipRepairCheckBill?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 |
| | | } |
| | | }, |
| | | uploadFile(index) { |
| | | console.log('filePath: ', this.attachmentInfo[index].filePath); |
| | | // 通过临时路径读取文件 |
| | | uni.uploadFile({ |
| | | url: CommonUtils.getServerUrl() + "/Sb_EquipDotCheckBill/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) |
| | | } |
| | | }, |
| | | }) |
| | | return { |
| | | Message: "", |
| | | state: true |
| | | } |
| | | }, |
| | | addNew() { |
| | | uni.redirectTo({ |
| | | url: './Sb_EquipRepairCheckBill?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 |
| | | } |
| | | }, |
| | | uploadFile(index) { |
| | | console.log('filePath: ', this.attachmentInfo[index].filePath); |
| | | // 通过临时路径读取文件 |
| | | uni.uploadFile({ |
| | | url: CommonUtils.getServerUrl() + "/Sb_EquipDotCheckBill/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 getShiftList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Web/GetGy_ShiftsList_Json', |
| | | data: { |
| | | Shifts: "", |
| | | } |
| | | }) |
| | | }, |
| | | 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 getShiftList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Web/GetGy_ShiftsList_Json', |
| | | data: { |
| | | Shifts: "", |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HShiftsList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | //获取使用部门数据 |
| | | async getHDeptList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Gy_Department/list', |
| | | data: { |
| | | sWhere: ` and HUSEORGID = ${uni.getStorageSync('OrganizationID')}`, |
| | | user: uni.getStorageSync('HUserName'), |
| | | Organization: uni.getStorageSync('Organization') |
| | | } |
| | | }) |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HShiftsList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | //获取使用部门数据 |
| | | async getHDeptList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Gy_Department/list', |
| | | data: { |
| | | sWhere: ` and HUSEORGID = ${uni.getStorageSync('OrganizationID')}`, |
| | | user: uni.getStorageSync('HUserName'), |
| | | Organization: uni.getStorageSync('Organization') |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HDeptList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | // 获取职员数据 |
| | | async getEmpList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/PublicPageMethod/UserList', |
| | | data: { |
| | | sWhere: " where 1=1", |
| | | } |
| | | }) |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HDeptList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | // 获取职员数据 |
| | | async getEmpList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/PublicPageMethod/UserList', |
| | | data: { |
| | | sWhere: " where 1=1", |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HEmpList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | // 获取验证项目数据 |
| | | async getCheckProjList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Gy_RepairCheck/GetRepairCheckList', |
| | | data: { |
| | | sWhere: "", |
| | | user: uni.getStorageSync('HUserName'), |
| | | } |
| | | }) |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HEmpList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | // 获取验证项目数据 |
| | | async getCheckProjList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Gy_RepairCheck/GetRepairCheckList', |
| | | data: { |
| | | sWhere: "", |
| | | user: uni.getStorageSync('HUserName'), |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HRepairCheckList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | toScanCode() { |
| | | MpaasScan.scanCode(cb => { |
| | | this.hform.HBarCode = cb; // 修复:原来是 hfrom 应该是 hform |
| | | this.GetMessageByBarCode(cb) |
| | | }) |
| | | }, |
| | | async GetMessageByBarCode(HBarCode) { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: "/Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown_List", |
| | | data: { |
| | | HBarCode: HBarCode, |
| | | }, |
| | | }) |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HRepairCheckList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | toScanCode() { |
| | | MpaasScan.scanCode(cb => { |
| | | this.hform.HBarCode = cb; // 修复:原来是 hfrom 应该是 hform |
| | | this.GetMessageByBarCode(cb) |
| | | }) |
| | | }, |
| | | async GetMessageByBarCode(HBarCode) { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: "/Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown_List", |
| | | data: { |
| | | HBarCode: HBarCode, |
| | | }, |
| | | }) |
| | | |
| | | if (!res) { |
| | | return |
| | | } |
| | | if (!res) { |
| | | return |
| | | } |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | |
| | | if (count == 1) { |
| | | console.log('data: ', data); |
| | | this.hform.HEquipID = data[0].hmainid |
| | | this.hform.HBarName = data[0].设备名称 |
| | | this.hform.HBarSpec = data[0].设备规格 |
| | | this.hform.HBarModel = data[0].设备型号 |
| | | this.hform.HBarCode = HBarCode; |
| | | this.hform.HQty = 1 |
| | | if (count == 1) { |
| | | console.log('data: ', data); |
| | | this.hform.HEquipID = data[0].hmainid |
| | | this.hform.HBarName = data[0].设备名称 |
| | | this.hform.HBarSpec = data[0].设备规格 |
| | | this.hform.HBarModel = data[0].设备型号 |
| | | this.hform.HBarCode = HBarCode; |
| | | this.hform.HQty = 1 |
| | | |
| | | this.enableEdit = false |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: Message |
| | | }) |
| | | } |
| | | this.enableEdit = false |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: Message |
| | | }) |
| | | } |
| | | |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | radioChange({ |
| | | detail: { |
| | | value |
| | | } |
| | | }) { |
| | | this.hform.HCheckResult = value |
| | | }, |
| | | async getMaxNum() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Web/GetMAXNum", |
| | | data: { |
| | | "HBillType": this.HBillType |
| | | } |
| | | }) |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | 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 = 0 |
| | | this.hform.HBillNo = data[0]["HBillNo"] |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "获取单据信息异常: " + err |
| | | }) |
| | | } |
| | | }, |
| | | async submit() { |
| | | let valid = this.ValidCheck() |
| | | if (!valid.state) { |
| | | CommonUtils.showTips({ |
| | | message: valid.Message |
| | | }) |
| | | return |
| | | } |
| | | 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 getSourceBillInfo(HSourceBillType, HInterID, HBillNo) { |
| | | // 下推单据类型为设备故障登记单 |
| | | if (HSourceBillType == 3907) { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Sb_EqpRepairWorkBill/GetEquipMatainanceBillBySourceInterID", |
| | | data: { |
| | | user: getUserInfo()["Czymc"], |
| | | HSourceInterID: HInterID |
| | | } |
| | | }) |
| | | |
| | | try { |
| | | let oMain = JSON.stringify(this.hform); |
| | | this.HDetailList[0].HManagerID = this.hform.HManagerID |
| | | this.HDetailList[0].HRepairCheckID = this.hform.HRepairCheckID |
| | | let sSubStr = JSON.stringify(this.HDetailList); |
| | | let sMainSub = oMain + ';' + sSubStr + ';' + getUserInfo()['Czymc']; |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: "/Sb_EqpRepairWorkBill/SaveGetEqpRepairCheckBillList", |
| | | data: { |
| | | "msg": sMainSub |
| | | }, |
| | | method: "POST" |
| | | }) |
| | | let { |
| | | data, |
| | | code, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | |
| | | if (!res) { |
| | | return |
| | | } |
| | | if (count == 1) { |
| | | console.log('data: ', data); |
| | | let data1 = data[0] |
| | | this.hform.HEquipID = data[0].HEquipID |
| | | this.hform.HBarName = data[0].设备名称 |
| | | this.hform.HBarModel = data[0].设备规格 |
| | | this.hform.HBarSpec = data[0].设备规格 |
| | | |
| | | this.hform.HMainSourceBillNo = data[0]["设备维修记录单"]; |
| | | this.hform.HMainSourceInterID = data[0]["HEquipRepairCheckBillInterID"]; |
| | | this.hform.HMainSourceEntryID = data[0]["HEquipRepairCheckBillEntryID"]; |
| | | |
| | | |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `获取源单失败: ${Message}` |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | async submit() { |
| | | let valid = this.ValidCheck() |
| | | if (!valid.state) { |
| | | CommonUtils.showTips({ |
| | | message: valid.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/Sb_EquipDotCheckBill/Sb_EquipDotCheckBill?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); |
| | | this.HDetailList[0].HManagerID = this.hform.HManagerID |
| | | this.HDetailList[0].HRepairCheckID = this.hform.HRepairCheckID |
| | | let sSubStr = JSON.stringify(this.HDetailList); |
| | | let sMainSub = oMain + ';' + sSubStr + ';' + getUserInfo()['Czymc']; |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: "/Sb_EqpRepairWorkBill/SaveGetEqpRepairCheckBillList", |
| | | data: { |
| | | "msg": sMainSub |
| | | }, |
| | | method: "POST" |
| | | }) |
| | | |
| | | } 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 (!res) { |
| | | return |
| | | } |
| | | |
| | | if (this.operationType == 1) { |
| | | // 新增 |
| | | this.getMaxNum() |
| | | this.enableEdit = true; |
| | | this.enableSourceBillEdit = true; |
| | | } else if (this.operationType == 2) { |
| | | // 复制 |
| | | } else if (this.operationType == 3) { |
| | | // 编辑 |
| | | } else if (this.operationType == 4) { |
| | | // 浏览 |
| | | this.enableEdit = false; |
| | | this.enableSourceBillEdit = false; |
| | | } |
| | | 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/Sb_EquipDotCheckBill/Sb_EquipDotCheckBill?operationType=1' |
| | | }) |
| | | } else if (res.cancel) { |
| | | console.log('用户点击取消'); |
| | | setTimeout(() => { |
| | | uni.navigateBack(); |
| | | }, 50) |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "提交单据失败: " + Message |
| | | }) |
| | | } |
| | | |
| | | this.getHDeptList() |
| | | this.getEmpList() |
| | | this.getCheckProjList() |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "提交单据失败: " + err |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | onLoad(e) { |
| | | console.log('e: ', e); |
| | | if (!e.operationType) { |
| | | this.operationType = 1 |
| | | } else { |
| | | this.operationType = e.operationType |
| | | } |
| | | |
| | | // 监听单据选择完成事件 |
| | | uni.$on('BillSelectComplete', (e) => { |
| | | console.log("接收到的消息: ", e) |
| | | this.hform.HMainSourceInterID = e.HInterID |
| | | this.hform.HMainSourceBillNo = e.HBillNo |
| | | this.hform.HMainSourceEntryID = e.HEntryID |
| | | this.hform.HMouldRepairWorkID = e.HInterID |
| | | this.hform.HMouldRepairWorkName = e.HBillNo |
| | | this.hform.HEquipID = e.HEquipID |
| | | this.hform.HBarName = e.HEquipName |
| | | this.hform.HBarSpec = e.HEquipSpec |
| | | this.hform.HBarModel = e.HEquipModel |
| | | this.hform.HBarCode = e.HEquipBarCode || "" |
| | | this.$refs.billList.exit() |
| | | }) |
| | | }, |
| | | onUnload() { |
| | | uni.$off('BillSelectComplete') |
| | | }, |
| | | 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) |
| | | }) |
| | | } |
| | | } |
| | | if (this.operationType == 1) { |
| | | // 新增 |
| | | this.getMaxNum() |
| | | this.enableEdit = true; |
| | | this.enableSourceBillEdit = true; |
| | | } else if (this.operationType == 2) { |
| | | // 复制 |
| | | } else if (this.operationType == 3) { |
| | | // 编辑 |
| | | } else if (this.operationType == 4) { |
| | | // 下推 |
| | | let { |
| | | HSourceBillType, |
| | | HInterID, |
| | | HBillNo |
| | | } = e |
| | | // 下推 |
| | | this.getMaxNum() |
| | | this.getSourceBillInfo(HSourceBillType, HInterID, HBillNo) |
| | | } |
| | | |
| | | this.getHDeptList() |
| | | this.getEmpList() |
| | | this.getCheckProjList() |
| | | |
| | | // 监听单据选择完成事件 |
| | | uni.$on('BillSelectComplete', (e) => { |
| | | console.log("接收到的消息: ", e) |
| | | this.hform.HMainSourceInterID = e.HInterID |
| | | this.hform.HMainSourceBillNo = e.HBillNo |
| | | this.hform.HMainSourceEntryID = e.HEntryID |
| | | this.hform.HMouldRepairWorkID = e.HInterID |
| | | this.hform.HMouldRepairWorkName = e.HBillNo |
| | | this.hform.HEquipID = e.HEquipID |
| | | this.hform.HBarName = e.HEquipName |
| | | this.hform.HBarSpec = e.HEquipSpec |
| | | this.hform.HBarModel = e.HEquipModel |
| | | this.hform.HBarCode = e.HEquipBarCode || "" |
| | | this.$refs.billList.exit() |
| | | }) |
| | | }, |
| | | onUnload() { |
| | | uni.$off('BillSelectComplete') |
| | | }, |
| | | 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" |
| | | @import "@/pages/MJGL/style/MJBillStyle.scss" |
| | | </style> |
| | |
| | | </view> |
| | | <!-- <xe-upload ref="XeUpload" :options="uploadOptions" @callback="handleUploadCallback"></xe-upload> --> |
| | | <!-- 源单单据列表弹窗 --> |
| | | <BillListPopupEquipConkBookBillVue ref="billList" :HBillType="hform.HBillType" |
| | | <BillListPopupEquipConkBookBillVue ref="billList" :HBillType="HBillType" |
| | | :HSourceBillType="hform.HMainSourceBillType" :HStockOrgID="hform.HStockOrgID"> |
| | | </BillListPopupEquipConkBookBillVue> |
| | | </view> |
| | |
| | | message: "提交单据失败: " + err |
| | | }) |
| | | } |
| | | }, |
| | | async getSourceBillInfo(HSourceBillType, HInterID, HBillNo) { |
| | | // 下推单据类型为设备故障登记单 |
| | | if(HSourceBillType == 3907) { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Sb_EqpRepairWorkBill/Sb_EqpConkBookBillListCheckDetai", |
| | | data: { |
| | | HID: HInterID |
| | | } |
| | | }) |
| | | |
| | | let {data,code, count, Message} = res.data |
| | | |
| | | if(code == 1) { |
| | | console.log('data: ',data.h_v_Sb_EquipConkBookBillList_Edit); |
| | | let data1 = data.h_v_Sb_EquipConkBookBillList_Edit[0] |
| | | this.hform.HMainSourceBillType = HSourceBillType |
| | | this.HMainSourceBillType = '设备故障登记单' |
| | | this.hform.HMainSourceBillNo = data1.单据号 |
| | | this.hform.HMainSourceInterID = data1.hmainid |
| | | this.hform.HMainSourceEntryID = data1.hsubid |
| | | this.hform.HEquipID = data1.HEquipID |
| | | this.hform.HManagerName = data1.负责人 |
| | | this.hform.HManagerID = data1.HManagerID |
| | | this.hform.HBarName = data1.设备名称 |
| | | this.hform.HBarModel = data1.设备型号 |
| | | this.hform.HBarSpec = data1.设备规格 |
| | | } |
| | | else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `获取源单失败: ${Message}` |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | onLoad(e) { |
| | |
| | | } else if (this.operationType == 3) { |
| | | // 编辑 |
| | | } else if (this.operationType == 4) { |
| | | // 浏览 |
| | | this.enableEdit = false; |
| | | this.enableSourceBillEdit = false; |
| | | this.showHMainSourceBillType = false; |
| | | let {HSourceBillType, HInterID, HBillNo} = e |
| | | // 下推 |
| | | // this.enableEdit = false; |
| | | // this.enableSourceBillEdit = false; |
| | | // this.showHMainSourceBillType = false; |
| | | this.getMaxNum() |
| | | this.getSourceBillInfo(HSourceBillType, HInterID, HBillNo) |
| | | } |
| | | |
| | | this.getHDeptList() |
| | |
| | | <template> |
| | | <view> |
| | | <view class="tabs" id="tabs"> |
| | | <view :class="tabs == 0 ? 'on':''" @tap="switchTab(0)">待维修</view> |
| | | <view :class="tabs == 1 ? 'on':''" @tap="switchTab(1)">已维修</view> |
| | | <view :class="tabs == 2 ? 'on':''" @tap="switchTab(2)">全部任务</view> |
| | | <view :class="tabs == 0 ? 'on':''" @tap="switchTab(0)">待派工</view> |
| | | <view :class="tabs == 1 ? 'on':''" @tap="switchTab(1)">待维修</view> |
| | | <view :class="tabs == 2 ? 'on':''" @tap="switchTab(2)">待验收</view> |
| | | </view> |
| | | |
| | | <!-- 设备维修任务列表列表 --> |
| | | <view class="list" v-for="(item,index) in reportBillsDisplay" :key="index"> |
| | | <uni-card :title="item.故障登记单号" :extra="`日期: ${dayjs(item.设备故障日期).format('YYYY-MM-DD')}`" style="margin: 10px;"> |
| | | <uni-card :title="item.故障登记单号" style="margin: 10px;" @tap="showDetail = showDetail==index?-1:index"> |
| | | <view class="card-detail"> |
| | | <view class="detail" v-for="(field, index) in CommonUtils.emptyValueFilter(item, HFieldList)" :key="index"> |
| | | <view class="detail" v-for="(field, index) in CommonUtils.emptyValueFilter(item, HFieldList)" |
| | | :key="index"> |
| | | <text>{{field.ColmCols}}:</text>{{item[field.ColmCols]}} |
| | | </view> |
| | | </view> |
| | | <view class="more" v-if="showDetail == index && operations != 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="operations = operations==index?-1:index"> |
| | | <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>操作 |
| | | </view> |
| | | </view> |
| | | <view class="more" v-if="showDetail != index && operations != 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="operations = operations==index?-1:index"> |
| | | <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>操作 |
| | | </view> |
| | | </view> |
| | | <view class="op" v-if="operations == index"> |
| | | <!-- <button class="op3" size="mini" plain @tap.stop="edit(item)">编辑</button> --> |
| | | <!-- <button class="op4" size="mini" plain @tap.stop="del(item)">删除</button> --> |
| | | <button class="op3" size="mini" v-if="tabs == 0" plain @tap.stop="pushBill(0, item)">下推派工单</button> |
| | | <button class="op3" size="mini" v-if="tabs == 1" plain @tap.stop="pushBill(1, item)">下推维修单</button> |
| | | <button class="op3" size="mini" v-if="tabs == 2" plain @tap.stop="pushBill(2, item)">下推验收单</button> |
| | | <button class="op5" size="mini" plain @tap.stop="operations = -1">取消操作</button> |
| | | </view> |
| | | </uni-card> |
| | | </view> |
| | |
| | | dayjs, |
| | | CommonUtils, |
| | | tabs: 0, |
| | | showDetail: -1, |
| | | operations: -1, |
| | | |
| | | reportBillsDisplay: [], |
| | | reportBillsAwaitRepair: [], // 待维修 |
| | | reportBillsRepaired: [], // 已维修 |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | pushBill(tab, item) { |
| | | console.log('item: ', item); |
| | | let Query = `&HBillNo=${item['故障登记单号']}&HInterID=${item['HInterID']}&HSourceBillType=3907` |
| | | if (tab == 0) { |
| | | uni.navigateTo({ |
| | | url: '/pages/MJGL/Sb_EquipRepairSendWork/Sb_EquipRepairSendWorkBill?operationType=4' + |
| | | Query |
| | | }) |
| | | } else if (tab == 1) { |
| | | uni.navigateTo({ |
| | | url: '/pages/MJGL/Sb_EqpMaintenance/Sb_EqpMaintenanceBill?operationType=5' + Query |
| | | }) |
| | | } else if (tab == 2) { |
| | | uni.navigateTo({ |
| | | url: '/pages/MJGL/Sb_EquipRepairCheckBill/Sb_EquipRepairCheckBill?operationType=4' + |
| | | Query |
| | | }) |
| | | } |
| | | }, |
| | | switchTab(tabIndex) { |
| | | this.tabs = tabIndex |
| | | switch (tabIndex) { |
| | |
| | | async getRepairList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: 'Sb_EquipRepairTaskReport/RepairList', |
| | | url: '/Sb_EquipRepairCheckTaskReport/RepairCheckList2', |
| | | data: { |
| | | user: getUserInfo()["Czymc"] |
| | | } |
| | |
| | | if (count == 1) { |
| | | console.log('data: ', data); |
| | | |
| | | this.reportBillsAwaitRepair = data.h_p_Sb_EquipRepairTaskReport |
| | | this.reportBillsRepaired = data.h_p_Sb_EquipRepairTaskReport1 |
| | | this.reportBillsAll = data.h_p_Sb_EquipRepairTaskReport2 |
| | | |
| | | this.reportBillsAwaitRepair = data.h_p_Sb_EquipRepairCheckTaskReport_2 |
| | | this.reportBillsRepaired = data.h_p_Sb_EquipRepairCheckTaskReport_21 |
| | | this.reportBillsAll = data.h_p_Sb_EquipRepairCheckTaskReport_22 |
| | | |
| | | let fieldList = CommonUtils.fieldListFilterRole({ |
| | | ExcludeKeys: ['故障登记单号', '设备故障日期'], |
| | | ExcludeKeys: ['故障登记单号'], |
| | | FieldList: list |
| | | }) |
| | | |
| | | |
| | | if (fieldList.status == false) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `获取表单结构失败: ${fieldList.Message}` |
| | | }) |
| | | } |
| | | |
| | | |
| | | this.HFieldList = fieldList.data |
| | | |
| | | this.switchTab(0) |
| | |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | @import "@/pages/MJGL/style/MJBillStyle.scss" |
| | | @import "@/pages/MJGL/style/MJBillStyle.scss"; |
| | | |
| | | .more { |
| | | color: #888; |
| | | font-size: 26rpx; |
| | | display: flex; |
| | | border-top: 1px solid #eee; |
| | | padding-top: 20rpx; |
| | | |
| | | .part { |
| | | width: 50%; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | } |
| | | |
| | | .op { |
| | | display: flex; |
| | | justify-content: space-around; |
| | | margin-top: 20rpx; |
| | | |
| | | button { |
| | | padding: 0; |
| | | width: 150rpx; |
| | | font-size: 25rpx; |
| | | } |
| | | |
| | | .op1 { |
| | | border: 1px solid #41a863; |
| | | color: #41a863; |
| | | } |
| | | |
| | | .op2 { |
| | | border: 1px solid #d98d00; |
| | | color: #d98d00; |
| | | } |
| | | |
| | | .op3 { |
| | | border: 1px solid #3a78ff; |
| | | color: #3a78ff; |
| | | } |
| | | |
| | | .op4 { |
| | | border: 1px solid #da0000; |
| | | color: #da0000; |
| | | } |
| | | |
| | | .op5 { |
| | | border: 1px solid #888; |
| | | color: #888; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | }, |
| | | async onLoad(e) { |
| | | console.log(e, this.userInfo) |
| | | this.OperationType = e.OperationType |
| | | if (e.HInterID) { |
| | | this.HInterID_Temp = e.HInterID |
| | | this.RoadBillMain(e.HInterID) |
| | | this.barCodeFocus = true |
| | | } else { |
| | | this.getNewData() |
| | | this.HSourceBillNoFocus = true |
| | | this.refreshBarCodeState() |
| | | this.OperationType = e.OperationType || 1 |
| | | if(operationType == 1) { |
| | | if (e.HInterID) { |
| | | this.HInterID_Temp = e.HInterID |
| | | this.RoadBillMain(e.HInterID) |
| | | this.barCodeFocus = true |
| | | } else { |
| | | this.getNewData() |
| | | this.HSourceBillNoFocus = true |
| | | this.refreshBarCodeState() |
| | | } |
| | | |
| | | }else if(operationType == 5) { |
| | | // 单据下推 |
| | | let {HSourceBillType, HInterID, HBillNo} = e |
| | | this.getMaxNum() |
| | | this.getSourceBillInfo(HSourceBillType, HInterID, HBillNo) |
| | | } |
| | | |
| | | |
| | | this.InitConkType() |
| | | this.InitConkReason() |
| | | this.InitDept() |
| | |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | async getSourceBillInfo(HSourceBillType, HInterID, HBillNo) { |
| | | // 下推单据类型为设备故障登记单 |
| | | if(HSourceBillType == 3815) { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Sc_MouldConkBookBill/Sb_MouldConkBookBillListCheckDetai", |
| | | data: { |
| | | HID: HInterID |
| | | } |
| | | }) |
| | | |
| | | let {data,code, count, Message} = res.data |
| | | console.log('data: ',data); |
| | | if(code == 1) { |
| | | console.log('data: ',data.h_v_Sc_MouldConkBookBillList_Edit); |
| | | let data1 = data.h_v_Sc_MouldConkBookBillList_Edit[0] |
| | | this.hform.HMainSourceBillType = HSourceBillType |
| | | this.HMainSourceBillType = '器具故障登记单' |
| | | this.hform.HMainSourceBillNo = data1.单据号 |
| | | this.hform.HMainSourceInterID = data1.hmainid |
| | | this.hform.HMainSourceEntryID = data1.hsubid |
| | | this.hform.HMouldID = data1.HMouldID |
| | | this.hform.HManagerName = data1.负责人 |
| | | this.hform.HManagerID = data1.HManagerID |
| | | this.hform.HMouldName = data1.产品模具 |
| | | this.hform.HMouldModel = data1.产品模具型号 |
| | | this.hform.HMouldSpec = data1.产品模具规格 |
| | | } |
| | | else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `获取源单失败: ${Message}` |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | message: "提交单据失败: " + err |
| | | }) |
| | | } |
| | | }, |
| | | async getSourceBillInfo(HSourceBillType, HInterID, HBillNo) { |
| | | // 下推单据类型为设备故障登记单 |
| | | if(HSourceBillType == 3815) { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Sc_MouldConkBookBill/Sb_MouldConkBookBillListCheckDetai", |
| | | data: { |
| | | HID: HInterID |
| | | } |
| | | }) |
| | | |
| | | let {data,code, count, Message} = res.data |
| | | console.log('data: ',data); |
| | | if(code == 1) { |
| | | console.log('data: ',data.h_v_Sc_MouldConkBookBillList_Edit); |
| | | let data1 = data.h_v_Sc_MouldConkBookBillList_Edit[0] |
| | | this.hform.HMainSourceBillType = HSourceBillType |
| | | this.HMainSourceBillType = '器具故障登记单' |
| | | this.hform.HMainSourceBillNo = data1.单据号 |
| | | this.hform.HMainSourceInterID = data1.hmainid |
| | | this.hform.HMainSourceEntryID = data1.hsubid |
| | | this.hform.HMouldID = data1.HMouldID |
| | | this.hform.HManagerName = data1.负责人 |
| | | this.hform.HManagerID = data1.HManagerID |
| | | this.hform.HMouldName = data1.产品模具 |
| | | this.hform.HMouldModel = data1.产品模具型号 |
| | | this.hform.HMouldSpec = data1.产品模具规格 |
| | | } |
| | | else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `获取源单失败: ${Message}` |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | onLoad(e) { |
| | |
| | | // 编辑 |
| | | |
| | | } else if (this.operationType == 4) { |
| | | // 浏览 |
| | | // 下推 |
| | | let {HSourceBillType, HInterID, HBillNo} = e |
| | | // 下推 |
| | | // this.enableEdit = false; |
| | | // this.enableSourceBillEdit = false; |
| | | // this.showHMainSourceBillType = false; |
| | | this.getMaxNum() |
| | | this.getSourceBillInfo(HSourceBillType, HInterID, HBillNo) |
| | | |
| | | } |
| | | |
| | |
| | | <template> |
| | | <view> |
| | | <view class="tabs" id="tabs"> |
| | | <view :class="tabs == 0 ? 'on':''" @tap="switchTab(0)">待维修</view> |
| | | <view :class="tabs == 1 ? 'on':''" @tap="switchTab(1)">已维修</view> |
| | | <view :class="tabs == 2 ? 'on':''" @tap="switchTab(2)">全部任务</view> |
| | | <view :class="tabs == 0 ? 'on':''" @tap="switchTab(0)">待派工</view> |
| | | <view :class="tabs == 1 ? 'on':''" @tap="switchTab(1)">待维修</view> |
| | | <view :class="tabs == 2 ? 'on':''" @tap="switchTab(2)">待验收</view> |
| | | </view> |
| | | |
| | | <!-- 设备维修任务列表列表 --> |
| | | <view class="list" v-for="(item,index) in reportBillsDisplay" :key="index"> |
| | | <uni-card :title="item.故障登记单号" :extra="`日期: ${dayjs(item.器具故障日期).format('YYYY-MM-DD')}`" style="margin: 10px;"> |
| | | <uni-card :title="item.故障登记单号" :extra="`日期: ${dayjs(item.器具故障日期).format('YYYY-MM-DD')}`" |
| | | style="margin: 10px;"> |
| | | <view class="card-detail"> |
| | | <view class="detail" v-for="(field, index) in CommonUtils.emptyValueFilter(item, HFieldList)" :key="index"> |
| | | <view class="detail" v-for="(field, index) in CommonUtils.emptyValueFilter(item, HFieldList)" |
| | | :key="index"> |
| | | <text>{{field.ColmCols}}:</text>{{item[field.ColmCols]}} |
| | | </view> |
| | | </view> |
| | | <view class="more" v-if="showDetail == index && operations != 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="operations = operations==index?-1:index"> |
| | | <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>操作 |
| | | </view> |
| | | </view> |
| | | <view class="more" v-if="showDetail != index && operations != 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="operations = operations==index?-1:index"> |
| | | <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>操作 |
| | | </view> |
| | | </view> |
| | | <view class="op" v-if="operations == index"> |
| | | <!-- <button class="op3" size="mini" plain @tap.stop="edit(item)">编辑</button> --> |
| | | <!-- <button class="op4" size="mini" plain @tap.stop="del(item)">删除</button> --> |
| | | <button class="op3" size="mini" v-if="tabs == 0" plain @tap.stop="pushBill(0, item)">下推派工单</button> |
| | | <button class="op3" size="mini" v-if="tabs == 1" plain @tap.stop="pushBill(1, item)">下推维修单</button> |
| | | <button class="op3" size="mini" v-if="tabs == 2" plain @tap.stop="pushBill(2, item)">下推验收单</button> |
| | | <button class="op5" size="mini" plain @tap.stop="operations = -1">取消操作</button> |
| | | </view> |
| | | </uni-card> |
| | | </view> |
| | |
| | | dayjs, |
| | | CommonUtils, |
| | | tabs: 0, |
| | | showDetail: -1, |
| | | operations: -1, |
| | | |
| | | reportBillsDisplay: [], |
| | | reportBillsAwaitRepair: [], // 待维修 |
| | | reportBillsRepaired: [], // 已维修 |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | pushBill(tab, item) { |
| | | console.log('item: ',item); |
| | | let Query = `&HBillNo=${item['故障登记单号']}&HInterID=${item['HInterID']}&HSourceBillType=3815` |
| | | if(tab == 0) { |
| | | uni.navigateTo({ |
| | | url: '/pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBill?operationType=4' + Query |
| | | }) |
| | | }else if(tab == 1) { |
| | | uni.navigateTo({ |
| | | url: '/pages/MJGL/Sc_MouldRepairWorkBill/Sc_MouldRepairWorkBill?operationType=5' + Query |
| | | }) |
| | | }else if(tab == 2) { |
| | | uni.navigateTo({ |
| | | url: '/pages/MJGL/SC_MouldRepairCheck/Sc_MouldRepairCheckBill?operationType=4' + Query |
| | | }) |
| | | } |
| | | }, |
| | | switchTab(tabIndex) { |
| | | this.tabs = tabIndex |
| | | switch (tabIndex) { |
| | |
| | | async getRepairList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: 'Sc_MouldRepairTaskReport/RepairList', |
| | | url: 'Sc_MouldRepairCheckTaskReport/RepairCheckList2', |
| | | data: { |
| | | user: getUserInfo()["Czymc"] |
| | | } |
| | |
| | | if (count == 1) { |
| | | console.log('data: ', data); |
| | | |
| | | this.reportBillsAwaitRepair = data.h_p_Sc_MouldRepairTaskReport |
| | | this.reportBillsRepaired = data.h_p_Sc_MouldRepairTaskReport1 |
| | | this.reportBillsAll = data.h_p_Sc_MouldRepairTaskReport2 |
| | | |
| | | this.reportBillsAwaitRepair = data.h_p_Sc_MouldRepairTaskReport_2 |
| | | this.reportBillsRepaired = data.h_p_Sc_MouldRepairTaskReport_21 |
| | | this.reportBillsAll = data.h_p_Sc_MouldRepairTaskReport_22 |
| | | |
| | | let fieldList = CommonUtils.fieldListFilterRole({ |
| | | ExcludeKeys: ['故障登记单号', '器具故障日期'], |
| | | FieldList: list |
| | | }) |
| | | |
| | | |
| | | if (fieldList.status == false) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `获取表单结构失败: ${fieldList.Message}` |
| | | }) |
| | | } |
| | | |
| | | |
| | | this.HFieldList = fieldList.data |
| | | |
| | | this.switchTab(0) |
| | |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | @import "@/pages/MJGL/style/MJBillStyle.scss" |
| | | @import "@/pages/MJGL/style/MJBillStyle.scss"; |
| | | |
| | | .more { |
| | | color: #888; |
| | | font-size: 26rpx; |
| | | display: flex; |
| | | border-top: 1px solid #eee; |
| | | padding-top: 20rpx; |
| | | |
| | | .part { |
| | | width: 50%; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | } |
| | | |
| | | .op { |
| | | display: flex; |
| | | justify-content: space-around; |
| | | margin-top: 20rpx; |
| | | |
| | | button { |
| | | padding: 0; |
| | | width: 150rpx; |
| | | font-size: 25rpx; |
| | | } |
| | | |
| | | .op1 { |
| | | border: 1px solid #41a863; |
| | | color: #41a863; |
| | | } |
| | | |
| | | .op2 { |
| | | border: 1px solid #d98d00; |
| | | color: #d98d00; |
| | | } |
| | | |
| | | .op3 { |
| | | border: 1px solid #3a78ff; |
| | | color: #3a78ff; |
| | | } |
| | | |
| | | .op4 { |
| | | border: 1px solid #da0000; |
| | | color: #da0000; |
| | | } |
| | | |
| | | .op5 { |
| | | border: 1px solid #888; |
| | | color: #888; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <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"> |
| | | <uni-icons type="scan" size="20" @click="toScanCode"></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">模具名称:</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"> |
| | | <uni-icons type="search" size="20" @click="toCheckFile"></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"> |
| | | <uni-icons type="scan" size="20" @click="toScanCode"></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">模具名称:</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"> |
| | | <uni-icons type="search" size="20" @click="toCheckFile"></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> |
| | | </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> |
| | | </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 HH:mm:ss"), |
| | | HEndDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"), |
| | | HQty: 1, |
| | | HBillNo: "", |
| | | HInterID: 0, |
| | | HDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"), |
| | | 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: { |
| | | hform: { |
| | | HBarCode: "", |
| | | HBeginDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"), |
| | | HEndDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"), |
| | | HQty: 1, |
| | | HBillNo: "", |
| | | HInterID: 0, |
| | | HDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"), |
| | | 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" |
| | | }) |
| | | 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) |
| | | } |
| | | }, |
| | | }) |
| | | 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 |
| | | // 获取检验规程 |
| | | 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.单据号, // 需确认是否正确 |
| | | 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 : ata.保养计划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 : ata.保养计划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.默认结论 == 1 ? 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.默认结论 == 1 ? 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() { |
| | | 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() { |
| | | 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 |
| | | } |
| | | 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 |
| | | }) |
| | | } |
| | | 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 |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | 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) { |
| | | // 浏览 |
| | | 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) |
| | | } |
| | | |
| | | } |
| | | }, |
| | | 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"> |
| | |
| | | }, |
| | | //仓库监听事件 |
| | | HWHNameChange(e) { |
| | | console.log('e: ',e); |
| | | for (var i = 0; i < this.HWHNameList.length; i++) { |
| | | if (this.HWHNameList[i]["HName"] == e) { |
| | | this.hform.HWHName = this.HWHNameList[i]["HName"] |
| | |
| | | for (var i = 0; i < data.length; i++) { |
| | | this.arrayHWHName[i] = data[i]["HName"] |
| | | } |
| | | this.HWHNameChange(data[0]['HName']) |
| | | } |
| | | }, |
| | | ) |
| | |
| | | "杭州凯贝奈特外网": 'http://erp.hzcabinet.cn:9090/API/', |
| | | "翁涛涛本地测试": 'http://localhost:81/API/', |
| | | "陈镐哲本地测试": 'http://192.168.0.121:81/API/', |
| | | "陈镐哲本地测试2": 'http://192.168.89.27:81/API/', |
| | | "陈镐哲本地测试2": 'http://192.168.88.82:81/API/', |
| | | "张瑞广本地测试": 'http://localhost:8082/API/', |
| | | "余思杰本地测试": 'http://localhost:8082/LuBaoAPI/', |
| | | // 小卫内外网 |
| | |
| | | |
| | | tabs: 0, |
| | | HMainSourceBillType: '手工录入', |
| | | arrayHMainSourceBillType: ['入库申请单', '手工录入'], |
| | | arrayHMainSourceBillValue: [1241, -1], |
| | | // arrayHMainSourceBillType: ['入库申请单', '手工录入'], |
| | | // arrayHMainSourceBillValue: [1241, -1], |
| | | arrayHMainSourceBillType: ['手工录入'], |
| | | arrayHMainSourceBillValue: [-1], |
| | | linterid: '', |
| | | HBillNo: '', |
| | | btnType: 0, //0新增,1修改,2审核,3反审核 |