|
|
@@ -2,7 +2,7 @@
|
|
|
<view class="main">
|
|
|
<uni-nav-bar fixed="true" statusBar="true" left-icon="back" right-icon="scan" title="申请备品备件" @clickLeft="goHome"
|
|
|
></uni-nav-bar>
|
|
|
- <KdTabs v-model="active" :list="['基本信息','备品备件信息']" />
|
|
|
+ <KdTabs v-model="active" :list="['基本信息','设备信息','备品备件信息']" />
|
|
|
<view v-show="active==0">
|
|
|
<Cell cellType="more" title="编号">
|
|
|
<view class="cell-tip-right" slot="more">
|
|
|
@@ -21,10 +21,9 @@
|
|
|
{{ addForm.repairName }}
|
|
|
</view>
|
|
|
</Cell>
|
|
|
- <Cell cellType="more" title="设备编号">
|
|
|
+ <!-- <Cell cellType="more" title="设备编号">
|
|
|
<view class="cell-tip-right" slot="more">
|
|
|
- <!-- <input type="text" placeholder="请输入" v-model="form.equiCode"
|
|
|
- placeholder-style="color:#999" style="font-size: 28rpx; text-align: right" /> -->
|
|
|
+
|
|
|
{{ addForm.deviceCode }}
|
|
|
</view>
|
|
|
</Cell>
|
|
|
@@ -42,7 +41,7 @@
|
|
|
<view class="cell-tip-right" slot="more">
|
|
|
{{ addForm.fixCode }}
|
|
|
</view>
|
|
|
- </Cell>
|
|
|
+ </Cell> -->
|
|
|
|
|
|
<Cell cellType="more" title="领用部门">
|
|
|
<view class="cell-tip-right" slot="more">
|
|
|
@@ -71,8 +70,43 @@
|
|
|
|
|
|
</Cell>
|
|
|
</view>
|
|
|
+ <view v-show="active==1" class="kd-equipment">
|
|
|
|
|
|
- <view v-show="active==1">
|
|
|
+ <!-- <u-button v-if="type=='add'" type="success" size="small" class="u-reset-button" @click="addDevice()"
|
|
|
+ text="添加物品"></u-button> -->
|
|
|
+ <view class="kd-list-container">
|
|
|
+ <u-list >
|
|
|
+ <u-list-item v-for="(item, index) in deviceList" :key="index">
|
|
|
+ <view class="kd-card">
|
|
|
+ <view class="kd-card-wrapper">
|
|
|
+ <uni-icons @click="del(item.id,1)" v-if="type=='add'" custom-prefix="iconfont"
|
|
|
+ type="icon-shanchu" size="20" color="#fa3534"></uni-icons>
|
|
|
+ <view class="kd-cell">
|
|
|
+
|
|
|
+ <text class="kd-label">设备编码</text>
|
|
|
+ {{ item.code }}
|
|
|
+ </view>
|
|
|
+ <view class="kd-cell">
|
|
|
+ <text class="kd-label">设备名称</text>
|
|
|
+ {{ item.name }}
|
|
|
+ </view>
|
|
|
+ <view class="kd-cell">
|
|
|
+ <text class="kd-label">设备型号</text>
|
|
|
+ {{ item.category&&item.category.modelType||item.model }}
|
|
|
+ </view>
|
|
|
+ <!-- <view class="kd-cell">
|
|
|
+ <text class="kd-label">设备位置</text>
|
|
|
+ {{ item.deviceLocationName.pathName }}
|
|
|
+ </view> -->
|
|
|
+
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ </u-list-item>
|
|
|
+ </u-list>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view v-show="active==2">
|
|
|
|
|
|
<u-button v-if="type=='add'" type="success" size="small" class="u-reset-button" @click="addPicking()"
|
|
|
text="添加物品"></u-button>
|
|
|
@@ -187,7 +221,8 @@
|
|
|
deviceId:''
|
|
|
},
|
|
|
tableList: [],
|
|
|
- sparePartsApplyList: [],
|
|
|
+ deviceList:[],
|
|
|
+ // sparePartsApplyList: [],
|
|
|
type: 'add',
|
|
|
showTime: '请选择时间',
|
|
|
|
|
|
@@ -204,25 +239,35 @@
|
|
|
const obj = JSON.parse(data.data)
|
|
|
this.type = obj.pageType
|
|
|
if (this.type == 'add') {
|
|
|
- this.addForm.repairCode = obj.repairCode;
|
|
|
- this.addForm.repairName = obj.repairName;
|
|
|
- this.addForm.repairId = obj.repairId;
|
|
|
- if (!obj.sparePartsApplyList) {
|
|
|
- this.addForm.deviceName = obj.deviceName;
|
|
|
- this.addForm.fixCode = obj.fixCode;
|
|
|
- this.addForm.deviceCode = obj.deviceCode;
|
|
|
- } else {
|
|
|
- this.sparePartsApplyList = obj.sparePartsApplyList;
|
|
|
- }
|
|
|
+ this.addForm.repairCode = obj.code;
|
|
|
+ this.addForm.repairName = obj.planName;
|
|
|
+ this.addForm.repairId = obj.id;
|
|
|
+ this.deviceList = obj.deviceList;
|
|
|
+
|
|
|
+ // if (!obj.sparePartsApplyList) {
|
|
|
+ // this.addForm.deviceName = obj.deviceName;
|
|
|
+ // this.addForm.fixCode = obj.fixCode;
|
|
|
+ // this.addForm.deviceCode = obj.deviceCode;
|
|
|
+ // } else {
|
|
|
+ // this.sparePartsApplyList = obj.sparePartsApplyList;
|
|
|
+ // }
|
|
|
|
|
|
} else {
|
|
|
const form = await detailsId(obj.id)
|
|
|
this.tableList = form.detailList
|
|
|
+ this.deviceList = form.deviceList
|
|
|
this.addForm = form
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- del(id) {
|
|
|
+ del(id,type) {
|
|
|
+ if(this.type!='add'){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(type==1){
|
|
|
+ this.deviceList = this.deviceList.filter((item) => item.id != id);
|
|
|
+ return
|
|
|
+ }
|
|
|
this.tableList = this.tableList.filter((item) => item.id != id);
|
|
|
},
|
|
|
sparePartsApplyChange(value) {
|
|
|
@@ -252,7 +297,7 @@
|
|
|
},
|
|
|
// 提交新增
|
|
|
submitAdd() {
|
|
|
- if (!this.addForm.deviceName) {
|
|
|
+ if (this.deviceList.length==0) {
|
|
|
uni.showToast({
|
|
|
title: '请选择设备!',
|
|
|
icon: 'none'
|
|
|
@@ -279,6 +324,7 @@
|
|
|
})
|
|
|
|
|
|
this.addForm.detailList = this.tableList
|
|
|
+ this.addForm.deviceList = this.deviceList
|
|
|
applySpareParts(this.addForm)
|
|
|
.then(res => {
|
|
|
uni.showToast({
|
|
|
@@ -404,4 +450,121 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .kd-equipment {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ overflow: hidden;
|
|
|
+
|
|
|
+ .kd-type-box {
|
|
|
+ text-align: center;
|
|
|
+ padding: 26rpx 0;
|
|
|
+
|
|
|
+ view {
|
|
|
+ position: relative;
|
|
|
+ display: inline-block;
|
|
|
+ width: 120rpx;
|
|
|
+ padding: 4rpx 0;
|
|
|
+ color: #747474;
|
|
|
+ margin: 0 20rpx;
|
|
|
+ background-color: rgba(215, 215, 215, 0.5);
|
|
|
+
|
|
|
+ &.type—active {
|
|
|
+ background-color: #1e7f35;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .count {
|
|
|
+ position: absolute;
|
|
|
+ top: -9px;
|
|
|
+ right: -9px;
|
|
|
+ width: 18px;
|
|
|
+ height: 18px;
|
|
|
+ border-radius: 50%;
|
|
|
+ font-size: 12px;
|
|
|
+ background-color: red;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .kd-list-container {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ overflow: hidden;
|
|
|
+ padding: 12rpx 18rpx;
|
|
|
+ background-color: $page-bg;
|
|
|
+
|
|
|
+ .u-list {
|
|
|
+ flex: 1;
|
|
|
+ height: 100% !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .kd-card {
|
|
|
+ background-color: #fff;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ padding: 8rpx 0;
|
|
|
+ font-size: 28rpx;
|
|
|
+ word-break: break-all;
|
|
|
+
|
|
|
+ .kd-card-wrapper {
|
|
|
+ padding: 0 30rpx;
|
|
|
+ border-bottom: 1px solid #dadada;
|
|
|
+ }
|
|
|
+
|
|
|
+ .kd-cell {
|
|
|
+ line-height: 60rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .kd-cell:last-of-type {
|
|
|
+ border-bottom: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .status-box {
|
|
|
+ margin-right: 16rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .card-footer {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+ align-items: center;
|
|
|
+ padding: 8rpx 0 20rpx;
|
|
|
+
|
|
|
+ button {
|
|
|
+ width: 180rpx;
|
|
|
+ height: 56rpx;
|
|
|
+ line-height: 56rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
+ margin: 0 8rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .primary-btn {
|
|
|
+ background-color: $j-primary-border-green;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .kd-cell {
|
|
|
+ min-height: 90rpx;
|
|
|
+ border-bottom: 1px dashed #dadada;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .kd-label {
|
|
|
+ display: inline-block;
|
|
|
+ width: 7em;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+
|
|
|
+ .kd-content {
|
|
|
+ flex: 1;
|
|
|
+ word-break: break-all;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .kd-baseInfo {
|
|
|
+ padding: 0 32rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
+ }
|
|
|
</style>
|