12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- const _Http = getApp().globalData.http;
- Component({
- properties: {
- data: {
- value: '',
- type: {}
- },
- changeQty: {
- value: false,
- type: Boolean
- },
- model: {
- type: String,
- value: 1
- },
- changeItem: Function,
- delete: Function
- },
- methods: {
- onIconTap() {
- this.triggerEvent("delete", this.data.data);
- },
- inputChange(e) {
- this.data.data.qty = e.detail.value
- this.triggerEvent("input", this.data.data);
- },
- onBlur(e) {
- let {
- value
- } = e.detail,
- data = this.data.data,
- name = e.currentTarget.dataset.name;
- if (data[name] == value) return;
- if (name == 'qty' && value <= 0) {
- wx.showToast({
- title: '数量不符合规则,已重置为1',
- })
- data[name] = 1
- } else {
- data[name] = value
- }
- _Http.basic({
- "id": "20230215201903",
- "content": {
- "sa_workorderid": data.sa_workorderid,
- "iteminfos": [data]
- }
- }).then(res => {
- console.log("产品修改", res)
- if (res.msg != '成功') return wx.showToast({
- title: res.msg,
- icon: "none"
- });
- this.triggerEvent("changeItem", data)
- });
- }
- }
- })
|