|
...
|
...
|
@@ -93,6 +93,91 @@ |
|
93
|
93
|
</view>
|
|
94
|
94
|
</view>
|
|
95
|
95
|
|
|
|
96
|
+ <view v-else-if="mode === 'approve'" class="section">
|
|
|
97
|
+ <view v-for="(item, idx) in items" :key="'a-' + idx" class="block">
|
|
|
98
|
+ <view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view>
|
|
|
99
|
+ <view class="row"><text class="label">品质</text><text class="value">{{ item.quality }}</text></view>
|
|
|
100
|
+ <view class="row"><text class="label">牌号</text><text class="value">{{ item.brand }}</text></view>
|
|
|
101
|
+
|
|
|
102
|
+ <view v-show="!item.collapsed">
|
|
|
103
|
+ <!-- 厚(公差) * 宽(公差) * 长(公差) -->
|
|
|
104
|
+ <view class="row row-spec"><text class="label">规格(mm)</text>
|
|
|
105
|
+ <view class="value value-spec">
|
|
|
106
|
+ <view v-if="item.thickness" class="value-spec_val">{{ item.thickness }}</view>
|
|
|
107
|
+ <view v-if="item.thickness" class="value-spec_box">
|
|
|
108
|
+ <view v-if="item.thicknessTolPos" class="value-spec_box_1">+{{ item.thicknessTolPos }}
|
|
|
109
|
+ </view>
|
|
|
110
|
+ <view v-if="item.thicknessTolNeg" class="value-spec_box_2">-{{ item.thicknessTolNeg }}
|
|
|
111
|
+ </view>
|
|
|
112
|
+ </view>
|
|
|
113
|
+ <view v-if="item.width" class="value-spec_val p12">*</view>
|
|
|
114
|
+ <view v-if="item.width" class="value-spec_val">{{ item.width }}</view>
|
|
|
115
|
+ <view v-if="item.width" class="value-spec_box">
|
|
|
116
|
+ <view v-if="item.widthTolPos" class="value-spec_box_1">{{ item.widthTolPos > 0 ? '+' + item.widthTolPos : item.widthTolPos }}</view>
|
|
|
117
|
+ <view v-if="item.widthTolNeg" class="value-spec_box_2">{{ item.widthTolNeg > 0 ? '+' + item.widthTolNeg : item.widthTolNeg }}</view>
|
|
|
118
|
+ </view>
|
|
|
119
|
+ <view v-if="item.length" class="value-spec_val p12">*</view>
|
|
|
120
|
+ <view v-if="item.length" class="value-spec_val">{{ item.length }}</view>
|
|
|
121
|
+ <view v-if="item.length" class="value-spec_box">
|
|
|
122
|
+ <view v-if="item.lengthTolPos" class="value-spec_box_1">{{ item.lengthTolPos > 0 ? '+' + item.lengthTolPos : item.lengthTolPos }}</view>
|
|
|
123
|
+ <view v-if="item.lengthTolNeg" class="value-spec_box_2">{{ item.lengthTolNeg > 0 ? '+' + item.lengthTolNeg : item.lengthTolNeg }}</view>
|
|
|
124
|
+ </view>
|
|
|
125
|
+ </view>
|
|
|
126
|
+ </view>
|
|
|
127
|
+ <view class="row"><text class="label">状态</text><text class="value">{{ item.status }}</text></view>
|
|
|
128
|
+ <view class="row" :class="{ 'noneStyle': !item.showSalesPrice }"><text
|
|
|
129
|
+ class="label">数量kg</text><text class="value">{{ item.quantity }}</text>
|
|
|
130
|
+ </view>
|
|
|
131
|
+ <view class="row" :class="{ 'noneStyle': item.showSalesPrice }" v-if="item.showSalesPrice"><text
|
|
|
132
|
+ class="label">销售价格</text><text class="value">{{
|
|
|
133
|
+ item.salesPrice }}</text></view>
|
|
|
134
|
+ <uni-list class="edit-list">
|
|
|
135
|
+ <uni-list-item class="amount-item">
|
|
|
136
|
+ <template v-slot:body>
|
|
|
137
|
+ <view class="item-title"><text>包装费</text></view>
|
|
|
138
|
+ </template>
|
|
|
139
|
+ <template v-slot:footer>
|
|
|
140
|
+ <view class="amount-row">
|
|
|
141
|
+ <uni-easyinput type="digit" v-model="item.packagingFee" placeholder="0.00"
|
|
|
142
|
+ :inputBorder="false"
|
|
|
143
|
+ @input="onNonNegativeNumberInput($event, item, idx, 'packagingFee')"
|
|
|
144
|
+ @blur="onNonNegativeNumberBlur(item, idx, 'packagingFee')" />
|
|
|
145
|
+ <text class="unit">元</text>
|
|
|
146
|
+ </view>
|
|
|
147
|
+ </template>
|
|
|
148
|
+ </uni-list-item>
|
|
|
149
|
+ <uni-list-item title="发货日期">
|
|
|
150
|
+ <template v-slot:footer>
|
|
|
151
|
+ <uni-datetime-picker type="date" v-model="item.deliveryDate" :start="minDeliveryDate"
|
|
|
152
|
+ @change="onDeliveryChange($event, item, idx)" />
|
|
|
153
|
+ </template>
|
|
|
154
|
+ </uni-list-item>
|
|
|
155
|
+ <uni-list-item title="考核超协">
|
|
|
156
|
+ <template v-slot:footer>
|
|
|
157
|
+ <uni-easyinput :disabled="pageType === 'modify'"
|
|
|
158
|
+ v-model="item.assessmentExceedsAgreement"
|
|
|
159
|
+ :placeholder="pageType === 'modify' ? '' : '请输入考核超协'" :inputBorder="false" />
|
|
|
160
|
+ </template>
|
|
|
161
|
+ </uni-list-item>
|
|
|
162
|
+ <uni-list-item class="select-item" :class="String(item.sampleOrder) ? 'is-filled' : 'is-empty'" clickable
|
|
|
163
|
+ @click="openSheet(idx)" :rightText="(item.sampleOrder ? '是' : '否') || '请选择'" showArrow>
|
|
|
164
|
+ <template v-slot:body>
|
|
|
165
|
+ <view class="item-title"><text>是否为试样订单</text></view>
|
|
|
166
|
+ </template>
|
|
|
167
|
+ </uni-list-item>
|
|
|
168
|
+ </uni-list>
|
|
|
169
|
+ </view>
|
|
|
170
|
+
|
|
|
171
|
+ <view class="block-ops">
|
|
|
172
|
+ <div class="toggle" @click="toggleItem(idx)">
|
|
|
173
|
+ <image :src="item.collapsed ? '/static/images/up.png' : '/static/images/down.png'"
|
|
|
174
|
+ class="icon" />
|
|
|
175
|
+ {{ item.collapsed ? '展开' : '收起' }}
|
|
|
176
|
+ </div>
|
|
|
177
|
+ </view>
|
|
|
178
|
+ </view>
|
|
|
179
|
+ </view>
|
|
|
180
|
+
|
|
96
|
181
|
<view v-else-if="mode === 'view'" class="view-list" v-show="!collapsedView">
|
|
97
|
182
|
<view v-for="(item, idx) in items" :key="'v-' + idx" class="card">
|
|
98
|
183
|
<view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view>
|
|
...
|
...
|
@@ -135,6 +220,7 @@ |
|
135
|
220
|
</view>
|
|
136
|
221
|
<view class="row"><text class="label">考核超协</text><text class="value">{{ item.assessmentExceedsAgreement
|
|
137
|
222
|
}}</text></view>
|
|
|
223
|
+ <view class="row"><text class="label">是否为试样订单</text><text class="value">{{ item.sampleOrder ? '是' : '否' }}</text></view>
|
|
138
|
224
|
</view>
|
|
139
|
225
|
<view class="view-total">
|
|
140
|
226
|
<view class="head">合计</view>
|
|
...
|
...
|
@@ -144,12 +230,16 @@ |
|
144
|
230
|
</view>
|
|
145
|
231
|
</view>
|
|
146
|
232
|
|
|
|
233
|
+ <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value"
|
|
|
234
|
+ @confirm="onSheetConfirm" />
|
|
147
|
235
|
</view>
|
|
148
|
236
|
</template>
|
|
149
|
237
|
<script>
|
|
150
|
238
|
import { uuid } from '@/utils/uuid.js'
|
|
|
239
|
+import SingleSelectSheet from '@/components/single-select/index.vue'
|
|
151
|
240
|
export default {
|
|
152
|
241
|
name: 'Product',
|
|
|
242
|
+ components: { SingleSelectSheet },
|
|
153
|
243
|
props: {
|
|
154
|
244
|
title: { type: String, default: '' },
|
|
155
|
245
|
mode: { type: String, default: 'add' },
|
|
...
|
...
|
@@ -163,6 +253,7 @@ export default { |
|
163
|
253
|
return {
|
|
164
|
254
|
items: [],
|
|
165
|
255
|
collapsedView: false,
|
|
|
256
|
+ sheet: { visible: false, title: '请选择', options: [], value: '', field: '' }
|
|
166
|
257
|
}
|
|
167
|
258
|
},
|
|
168
|
259
|
computed: {
|
|
...
|
...
|
@@ -265,7 +356,22 @@ export default { |
|
265
|
356
|
const num = Number(v)
|
|
266
|
357
|
if (isNaN(num) || num < 0) item[field] = '0'
|
|
267
|
358
|
if (typeof idx === 'number') this.$set(this.items, idx, { ...item })
|
|
268
|
|
- }
|
|
|
359
|
+ },
|
|
|
360
|
+ openSheet(idx) {
|
|
|
361
|
+ const item = this.items[idx]
|
|
|
362
|
+ const options = [{ label: '是', value: true }, { label: '否', value: false }]
|
|
|
363
|
+ const current = item.sampleOrder
|
|
|
364
|
+ this.sheet = { visible: true, title: '是否为试样订单', options, idx, value: current }
|
|
|
365
|
+ },
|
|
|
366
|
+ onSheetConfirm({ value }) {
|
|
|
367
|
+ const idx = this.sheet.idx
|
|
|
368
|
+ if (idx > -1 && this.items[idx]) {
|
|
|
369
|
+ const item = this.items[idx]
|
|
|
370
|
+ item.sampleOrder = value
|
|
|
371
|
+ this.$set(this.items, idx, { ...item })
|
|
|
372
|
+ }
|
|
|
373
|
+ this.sheet.visible = false
|
|
|
374
|
+ },
|
|
269
|
375
|
}
|
|
270
|
376
|
}
|
|
271
|
377
|
</script>
|
...
|
...
|
|