From ea87c908fb6cdfc3e227a584a53e6730efb8262a Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 26 十月 2023 13:41:12 +0800
Subject: [PATCH] 小程序代码
---
minipro_standard/pages_adjust/pages/spotCheck/spotCheck.vue | 168 +++++++++++++++++++++++++++++++------------------------
1 files changed, 94 insertions(+), 74 deletions(-)
diff --git a/minipro_standard/pages_adjust/pages/spotCheck/spotCheck.vue b/minipro_standard/pages_adjust/pages/spotCheck/spotCheck.vue
index 9646e39..d798f56 100644
--- a/minipro_standard/pages_adjust/pages/spotCheck/spotCheck.vue
+++ b/minipro_standard/pages_adjust/pages/spotCheck/spotCheck.vue
@@ -21,11 +21,11 @@
<div class="tl_list_item_go">
<span
:style="item.attributeName ? 'color: #000;' : ''">{{ item.attributeName ? item.attributeName : '璇烽�夋嫨'}}</span>
- <u-icon name="arrow-right" color="#999999" size="20"></u-icon>
+ <van-icon name="arrow" color="#999999" />
</div>
</div>
<div class="tl_list_item" v-if="item.type === ''">
- <div class="tl_list_item_label">灞炴�у��1</div>
+ <div class="tl_list_item_label">灞炴�у��</div>
<div class="tl_list_item_go">
<input type="text" v-model="item.num" placeholder="璇疯緭鍏�" />
</div>
@@ -34,10 +34,14 @@
<div class="tl_list_item_label">灞炴�у��</div>
<div class="tl_list_item_go">
<u-radio-group v-model="item.num" placement="row" @change="radioSelect">
- <u-radio v-for="(item1, i) in item.data" :key="i" activeColor="#4275FC" :name="item1"
- :label="item1">
+ <u-radio v-for="(item1, i) in item.data" :key="i" activeColor="#4275FC" :name="item1" :label="item1">
</u-radio>
</u-radio-group>
+ <!-- <van-radio-group v-model="item.num" direction="horizontal">
+ <van-radio :name="item1" checked-color="#4275FC" v-for="(item1, i) in item.data" :key="i">
+ {{item1}}
+ </van-radio>
+ </van-radio-group> -->
</div>
</div>
<div class="tl_list_item" v-else-if="item.type === 1">
@@ -49,30 +53,80 @@
</u-checkbox-group>
</div>
</div>
- <div class="tl_list_item" v-else-if="item.type === 2">
+ <div class="tl_list_item" v-else-if="item.type === 2 || item.type === 3">
<div class="tl_list_item_label">灞炴�у��</div>
<div class="tl_list_item_go">
<input type="text" v-model="item.num" :placeholder="item.tips" />
- </div>
- </div>
- <div class="tl_list_item" v-else-if="item.type === 3">
- <div class="tl_list_item_label">灞炴�у��</div>
- <div class="tl_list_item_go">
- <input v-model="item.num" type="digit" :placeholder="item.tips" />
- <!-- <u--input v-model="item.num" :placeholder="item.tips" type="digit"
- border="surround"></u--input> -->
</div>
</div>
<div class="tl_list_item" @click="openTimer(index)" v-else-if="item.type === 4">
<div class="tl_list_item_label">灞炴�у��</div>
<div class="tl_list_item_go">
<span :style="item.num ? 'color: #000;' : ''">{{item.num ? item.num : item.tips}}</span>
- <u-icon name="arrow-right" color="#999999" size="20"></u-icon>
+ <u-icon name="arrow" color="#999999" />
</div>
</div>
</div>
</u-swipe-action-item>
</u-swipe-action>
+ <!-- <van-swipe-cell v-for="(item, index) in formList" :key="index">
+ <div class="tl_list">
+ <div class="tl_list_item" @click="open(index)">
+ <div class="tl_list_item_label">鐢熶骇灞炴��</div>
+ <div class="tl_list_item_go">
+ <span
+ :style="item.attributeName ? 'color: #000;' : ''">{{ item.attributeName ? item.attributeName : '璇烽�夋嫨'}}</span>
+ <van-icon name="arrow" color="#999999" />
+ </div>
+ </div>
+ <div class="tl_list_item" v-if="item.type === ''">
+ <div class="tl_list_item_label">灞炴�у��</div>
+ <div class="tl_list_item_go">
+ <input type="text" v-model="item.num" placeholder="璇疯緭鍏�" />
+ </div>
+ </div>
+ <div class="tl_list_item" v-else-if="item.type === 0">
+ <div class="tl_list_item_label">灞炴�у��</div>
+ <div class="tl_list_item_go">
+ <u-radio-group v-model="item.num" placement="row">
+ <u-radio v-for="(item1, i) in item.data" :key="i" activeColor="#4275FC" :label="item1">
+ </u-radio>
+ </u-radio-group>
+ </div>
+ </div>
+ <div class="tl_list_item" v-else-if="item.type === 1">
+ <div class="tl_list_item_label">灞炴�у��</div>
+ <div class="tl_list_item_go">
+ <u-checkbox-group v-model="item.num" placement="row">
+ <u-checkbox v-for="(item1, i) in item.data" :key="i" :label="item1" :name="item1">
+ </u-checkbox>
+ </u-checkbox-group>
+ </div>
+ </div>
+ <div class="tl_list_item" v-else-if="item.type === 2">
+ <div class="tl_list_item_label">灞炴�у��</div>
+ <div class="tl_list_item_go">
+ <input type="text" v-model="item.num" :placeholder="item.tips" />
+ </div>
+ </div>
+ <div class="tl_list_item" v-else-if="item.type === 3">
+ <div class="tl_list_item_label">灞炴�у��</div>
+ <div class="tl_list_item_go">
+ <input type="text" v-model="item.num" :placeholder="item.tips" />
+ </div>
+ </div>
+ <div class="tl_list_item" @click="openTimer(index)" v-else-if="item.type === 4">
+ <div class="tl_list_item_label">灞炴�у��</div>
+ <div class="tl_list_item_go">
+ <span :style="item.num ? 'color: #000;' : ''">{{item.num ? item.num : item.tips}}</span>
+ <u-icon name="arrow" color="#999999" />
+ </div>
+ </div>
+ </div>
+ <template #right>
+ <van-button square style="height: 100%;" type="danger" text="鍒犻櫎" @click="dele(index)" />
+ </template>
+ </van-swipe-cell> -->
<div class="tl_zw"></div>
<div class="tl_footer">
@@ -80,8 +134,6 @@
</div>
<u-picker :show="show" :columns="[gzqjData]" title="閫夋嫨鐢熶骇灞炴��" @confirm="gzqjConfirm" @cancel="show=false">
</u-picker>
- <u-datetime-picker :show="timer" v-model="value1" @cancel="timer=false" @confirm="onConfirm" mode="datetime">
- </u-datetime-picker>
</view>
</template>
@@ -102,14 +154,9 @@
data() {
return {
options1: [{
- text: '鍒犻櫎',
- style: {
- backgroundColor: '#f00',
- }
+ text: '鍒犻櫎'
}],
- value1: Number(new Date()),
show: false,
- timer: false,
index: '',
workOrderId: '',
info: {},
@@ -171,11 +218,6 @@
this.index = index
this.show = true
},
- // 鎵撳紑鏃ユ湡鎻掍欢
- openTimer(index) {
- this.index = index
- this.timer = true
- },
gzqjConfirm({
value
}) {
@@ -223,44 +265,35 @@
return
}
this.formList.splice(index, 1)
- },
- onConfirm(value) {
- console.log(value);
- this.formList.forEach((item, index) => {
- if (this.index === index) {
- item.num = setTimeO(new Date(value.value), '-')
- }
- })
- this.timer = false;
- },
- radioSelect(v) {
- console.log(v);
+ },
+ radioSelect(v) {
+ console.log(v);
},
submit() {
- let isOpen = true
- let attrList = []
-
- this.formList.forEach(item => {
+ let isOpen = true
+ let attrList = []
+
+ this.formList.forEach(item => {
console.log('-------', item);
- if (item.type === 1) {
+ if (item.type === 1) {
if (item.attribute === '' || item.num.length === 0) {
- isOpen = false
+ isOpen = false
return
- } else {
- attrList.push({
- val: item.num.join(' '),
- attrId: item.attribute
- })
+ } else {
+ attrList.push({
+ val: item.num.join(' '),
+ attrId: item.attribute
+ })
}
- } else {
+ } else {
if (item.attribute === '' || item.num === '') {
- isOpen = false
+ isOpen = false
return
- } else {
- attrList.push({
- val: item.num,
- attrId: item.attribute
- })
+ } else {
+ attrList.push({
+ val: item.num,
+ attrId: item.attribute
+ })
}
}
})
@@ -268,13 +301,13 @@
uni.$u.toast('璇峰皢淇℃伅濉啓瀹屾暣')
return
}
-
+
createDJ({
attrList: attrList,
id: this.workOrderId
}).then(res => {
- if (res.code === 200) {
- uni.$emit('spotAdd')
+ if (res.code === 200) {
+ uni.$emit('spotAdd')
uni.$u.toast('鍒涘缓鎴愬姛')
setTimeout(() => {
uni.navigateBack()
@@ -341,7 +374,7 @@
flex-direction: column;
background: white;
padding: 0 30rpx;
- // margin-bottom: 20rpx;
+ margin-bottom: 20rpx;
.tl_list_item {
min-height: 98rpx;
@@ -357,15 +390,12 @@
.tl_list_item_label {
font-size: 30rpx;
font-weight: 400;
- flex-shrink: 1;
color: #222222;
}
.tl_list_item_go {
display: flex;
align-items: center;
- flex: 1;
- justify-content: flex-end;
input {
text-align: right;
@@ -417,15 +447,5 @@
justify-content: center;
}
}
- }
-
- /deep/ .u-checkbox-group {
- flex-wrap: wrap;
- max-width: 100%;
- }
-
- /deep/ .u-radio-group {
- flex-wrap: wrap;
- max-width: 100%;
}
</style>
--
Gitblit v1.9.3