123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- Component({
- properties: {
- list: Array,
- deleteItem: Function,
- changeProduct: Function, //修改队列
- disabled: Boolean
- },
- options: {
- addGlobalClass: true
- },
- methods: {
- toProductDetail(e) {
- const {
- item
- } = e.currentTarget.dataset;
- },
- onBlur(e) {
- let {
- data,
- name
- } = e.currentTarget.dataset;
- this.triggerEvent("changeProduct", {
- "sa_aftersalesmag_itemsid":data.sa_aftersalesmag_itemsid,
- "sa_orderitemsid": data.sa_orderitemsid,
- "itemid": data.itemid,
- "qty": name == 'qty' ? e.detail.value : data.qty,
- "price": name == 'price' ? e.detail.value : data.price,
- "reason": name == 'reason' ? e.detail.value : data.reason,
- })
- },
- deleteProduct(e) {
- if (this.data.disabled) return wx.showToast({
- title: '当前状态不可删除!',
- icon: "none"
- })
- let {
- item
- } = e.currentTarget.dataset;
- this.triggerEvent("deleteItem", item)
- },
- isEdit() {
- if (this.data.disabled) wx.showToast({
- title: '当前状态不可编辑!',
- icon: "none"
- })
- }
- }
- })
|