|
|
@@ -33,7 +33,15 @@ Component({
|
|
|
list: [],
|
|
|
showSearch: false,
|
|
|
focus: false,
|
|
|
- condition: ""
|
|
|
+ condition: "",
|
|
|
+ actionShow: false,
|
|
|
+ actions: [{
|
|
|
+ name: getApp().globalData.Language.getMapText('自服务申请单添加'),
|
|
|
+ value: "自服务申请单添加",
|
|
|
+ }, {
|
|
|
+ name: getApp().globalData.Language.getMapText('自产品档案添加'),
|
|
|
+ value: "自产品档案添加"
|
|
|
+ }]
|
|
|
},
|
|
|
methods: {
|
|
|
getList(id, init = false) {
|
|
|
@@ -124,6 +132,115 @@ Component({
|
|
|
})
|
|
|
}, 300)
|
|
|
},
|
|
|
+ deleteItem(e) {
|
|
|
+ const {
|
|
|
+ item
|
|
|
+ } = e.currentTarget.dataset,
|
|
|
+ that = this;
|
|
|
+ wx.showModal({
|
|
|
+ content: getApp().globalData.Language.getMapText(`是否确定删除该产品`),
|
|
|
+ complete: ({
|
|
|
+ confirm
|
|
|
+ }) => {
|
|
|
+ if (confirm) _Http.basic({
|
|
|
+ "id": "20230215202003",
|
|
|
+ "content": {
|
|
|
+ "sa_workorder_node_itemsids": [item.sa_workorder_node_itemsid]
|
|
|
+ },
|
|
|
+ }).then(res => {
|
|
|
+ wx.showToast({
|
|
|
+ title: res.code == 1 ? getApp().globalData.Language.getMapText(`删除成功`) : res.msg,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ if (res.code == 1) {
|
|
|
+ that.getList('', true)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ selectorMode(e) {
|
|
|
+ let {
|
|
|
+ value
|
|
|
+ } = e.detail;
|
|
|
+ wx.navigateTo({
|
|
|
+ url: `/E-service/serviceBillList/product/select?params=${JSON.stringify({
|
|
|
+ "content": {
|
|
|
+ "sa_workorderid":this.data.sa_workorderid,
|
|
|
+ "type": value == '自产品档案添加'?1:2,//1档案,2:申请单
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }},
|
|
|
+ "id": "2026022710102502",
|
|
|
+ })}`
|
|
|
+ });
|
|
|
+ getApp().globalData.handleSelect = this.handleSelect.bind(this)
|
|
|
+ this.cancelSelector()
|
|
|
+ },
|
|
|
+ /* 处理新增产品 */
|
|
|
+ handleSelect(detail) {
|
|
|
+ let that = this;
|
|
|
+ wx.showModal({
|
|
|
+ cancelText: getApp().globalData.Language.getMapText('取消'),
|
|
|
+ confirmText: getApp().globalData.Language.getMapText('确定'),
|
|
|
+ title: getApp().globalData.Language.getMapText('提示'),
|
|
|
+ content: getApp().globalData.Language.joint([{
|
|
|
+ v: '是否确认添加',
|
|
|
+ t: 1
|
|
|
+ }, {
|
|
|
+ v: detail.result.length,
|
|
|
+ t: 1,
|
|
|
+ r: ' ',
|
|
|
+ f: " "
|
|
|
+ }, {
|
|
|
+ v: '件商品',
|
|
|
+ t: 1,
|
|
|
+ r: '?',
|
|
|
+ }]),
|
|
|
+ complete: (res) => {
|
|
|
+ if (res.confirm) _Http.basic({
|
|
|
+ "id": "20230215201903",
|
|
|
+ "content": {
|
|
|
+ "sa_workorder_nodeid": 0,
|
|
|
+ sa_workorderid: this.data.sa_workorderid,
|
|
|
+ "iteminfos": detail.list.map(v => {
|
|
|
+ return {
|
|
|
+ "sa_workorder_node_itemsid": 0,
|
|
|
+ "problem_description": "",
|
|
|
+ "processing": "",
|
|
|
+ "result": "",
|
|
|
+ "reason": "",
|
|
|
+ "qty": 1,
|
|
|
+ "itemid": v.itemid
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ }).then(s => {
|
|
|
+ console.log('新增产品', s)
|
|
|
+ wx.showToast({
|
|
|
+ title: s.code == '1' ? getApp().globalData.Language.getMapText('添加成功') : s.msg,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ if (s.code == '1') setTimeout(() => {
|
|
|
+ that.getList('', true);
|
|
|
+ wx.navigateBack();
|
|
|
+ }, 300)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ addProduct() {
|
|
|
+ this.setData({
|
|
|
+ actionShow: true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ cancelSelector() {
|
|
|
+ this.setData({
|
|
|
+ actionShow: false
|
|
|
+ })
|
|
|
+ },
|
|
|
onChange({
|
|
|
detail
|
|
|
}) {
|