Showing
1 changed file
with
0 additions
and
42 deletions
| @@ -6,7 +6,6 @@ | @@ -6,7 +6,6 @@ | ||
| 6 | <image class="opCollapse" src="/static/images/title.png" /> | 6 | <image class="opCollapse" src="/static/images/title.png" /> |
| 7 | <text class="title">产品</text> | 7 | <text class="title">产品</text> |
| 8 | <view class="ops"> | 8 | <view class="ops"> |
| 9 | - <!-- <image v-if="mode === 'add'" class="opAdd" @click="onAdd" src="/static/images/plus.png" /> --> | ||
| 10 | <view v-if="mode === 'view'" class="op1" @click="toggleViewCollapse"> | 9 | <view v-if="mode === 'view'" class="op1" @click="toggleViewCollapse"> |
| 11 | <image class="opAdd" :src="collapsedView ? '/static/images/down.png' : '/static/images/up.png'" /> | 10 | <image class="opAdd" :src="collapsedView ? '/static/images/down.png' : '/static/images/up.png'" /> |
| 12 | <text class="op">{{ collapsedView ? '展开' : '收起' }} </text> | 11 | <text class="op">{{ collapsedView ? '展开' : '收起' }} </text> |
| @@ -199,47 +198,6 @@ export default { | @@ -199,47 +198,6 @@ export default { | ||
| 199 | return { ...it, sexName: m ? (m.label || '') : it.sexName } | 198 | return { ...it, sexName: m ? (m.label || '') : it.sexName } |
| 200 | }) | 199 | }) |
| 201 | }, | 200 | }, |
| 202 | - openProductSheet(idx) { | ||
| 203 | - const opts = this.selectOptions | ||
| 204 | - const current = this.items[idx] && this.items[idx].sex | ||
| 205 | - const match = opts.find(o => o.value === current) | ||
| 206 | - this.sheet = { ...this.sheet, visible: true, title: '请选择性别', options: opts, idx, value: match ? match.value : '' } | ||
| 207 | - }, | ||
| 208 | - onProductConfirm({ value, label }) { | ||
| 209 | - const idx = this.sheet.idx | ||
| 210 | - const it = this.items[idx] | ||
| 211 | - if (!it) { this.sheet.visible = false; return } | ||
| 212 | - it.sex = value | ||
| 213 | - it.sexName = label || '' | ||
| 214 | - this.$set(this.items, idx, it) | ||
| 215 | - this.sheet.visible = false | ||
| 216 | - this.emitChange() | ||
| 217 | - }, | ||
| 218 | - onAdd() { | ||
| 219 | - if (this.items.length >= this.max) return uni.showToast({ title: `最多添加${this.max}个`, icon: 'none' }) | ||
| 220 | - const obj = this.defaultItem() | ||
| 221 | - obj.collapsed = true | ||
| 222 | - this.items.push(obj) | ||
| 223 | - this.emitChange() | ||
| 224 | - }, | ||
| 225 | - onRemove(id) { | ||
| 226 | - if (!id) return | ||
| 227 | - uni.showModal({ | ||
| 228 | - title: '系统提示', | ||
| 229 | - content: '是否确定删除选中的产品?', | ||
| 230 | - confirmText: '确定', | ||
| 231 | - cancelText: '取消', | ||
| 232 | - success: (res) => { | ||
| 233 | - if (res && res.confirm) { | ||
| 234 | - const i = this.items.findIndex(it => String(it.personId) === String(id)) | ||
| 235 | - if (i >= 0) { | ||
| 236 | - this.items.splice(i, 1) | ||
| 237 | - this.emitChange() | ||
| 238 | - } | ||
| 239 | - } | ||
| 240 | - } | ||
| 241 | - }) | ||
| 242 | - }, | ||
| 243 | toggleItem(idx) { | 201 | toggleItem(idx) { |
| 244 | const it = this.items[idx] | 202 | const it = this.items[idx] |
| 245 | if (!it) return | 203 | if (!it) return |