12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- Component({
- properties: {
- list: {
- type: Array
- },
- deleteItem: {
- type: Function
- },
- changeProduct: {
- type: Function
- }, //修改队列
- disabled: {
- type: Boolean
- }
- },
- options: {
- addGlobalClass: true
- },
- lifetimes: {
- attached: function () {
- getApp().globalData.Language.getLanguagePackage(this)
- }
- },
- 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) getApp().globalData.Language.showToast('当前状态不可删除!')
- let {
- item
- } = e.currentTarget.dataset;
- this.triggerEvent("deleteItem", item)
- },
- isEdit() {
- if (this.data.disabled) getApp().globalData.Language.showToast('当前状态不可编辑!')
- }
- }
- })
|