From d7d4c848b8cb9acda57ee3583ab1dc7eadb18e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Thu, 6 Jan 2022 15:08:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=91=E6=8D=A2=E7=A0=81=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/edit/edit.js | 87 +++++++++++++++++++---------- src/pages/exchangecode/list/list.js | 16 +++--- src/pages/plan/key/list.js | 25 +-------- 3 files changed, 70 insertions(+), 58 deletions(-) diff --git a/src/pages/exchangecode/edit/edit.js b/src/pages/exchangecode/edit/edit.js index 07565fef..b20f9eed 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -103,39 +103,70 @@ export default class exchangedit extends React.Component{ this.setState({new_product:new_ids}) - - this.setState({codeInfo:codeInfo}) - this.setState({isload:true}); - let table = _.map(codeInfo.range,(res)=>{ - res.checked = true; - return res - }); + let delete_product = req.delete_product + let payment_direction = req.payment_direction + getCodesDetail(code_batch_id).then(res=>{ + handelResponse(res,(req,msg)=>{ + codeInfo.stock = req.stock; + + + + + + this.setState({codeInfo:codeInfo}) + this.setState({isload:true}); + let table = _.map(codeInfo.range,(res)=>{ + let obj = req.code_batch_stock.find(o=>o.product_id == res.product_id); + res.usage = obj ? obj.usage : 0; + res.stock =obj ? obj.stock : res.quantity - res.usage; + res.checked = true; + return res + }); + + + this.setState({deleteProduct:delete_product}) + + this.setState({tempdata:codeInfo.range}) + + let arr = []; + + _.map(codeInfo.range,(res)=>{ + let obj = {}; + obj.key = res.product_id; + obj.text= res.product_name; + this.state.oldProduct.push(res.product_id); + arr.push(obj) + return obj; + }) + + this.setState({rankoptions:arr}) + this.setState({rank:arr}) + + + if(payment_direction) + { + let index = this.state.payment_direction.indexOf(payment_direction) + this.setState({paytype: index+1}) + } + + },(err)=>{ + + }) + }).catch(err=>{ + }); - this.setState({deleteProduct:req.delete_product}) - this.setState({tempdata:codeInfo.range}) - - let arr = []; - - _.map(codeInfo.range,(res)=>{ - let obj = {}; - obj.key = res.product_id; - obj.text= res.product_name; - this.state.oldProduct.push(res.product_id); - arr.push(obj) - return obj; - }) - - this.setState({rankoptions:arr}) - this.setState({rank:arr}) + + + + + + + + - if(req.payment_direction) - { - let index = this.state.payment_direction.indexOf(req.payment_direction) - this.setState({paytype: index+1}) - } },(err)=>{ diff --git a/src/pages/exchangecode/list/list.js b/src/pages/exchangecode/list/list.js index 97097e66..f946e846 100644 --- a/src/pages/exchangecode/list/list.js +++ b/src/pages/exchangecode/list/list.js @@ -62,6 +62,12 @@ const Column = [ type: "slot", width:'auto', + },{ + title: '状态', + name: 'status', + type: "slot", + prop:'status', + width:'auto', }, { title: '券总数(已发放)', @@ -99,13 +105,7 @@ const Column = [ type: "normal", prop:'invalid', width:'auto', - },{ - title: '状态', - name: 'status', - type: "slot", - prop:'status', - width:'auto', - }, + } ]; @@ -117,7 +117,7 @@ export default class acclist extends React.Component{ total:0, page:1, limit:10, - tabList:[{title:"全部",index:0},{title:"未开始",index:3},{title:"进行中",index:1},{title:"暂停中",index:2},{title:"已完结",index:4},{title:"已作废",index:5},{title:"创建中",index:-1},{title:"审核中",index:6},{title:"审核驳回",index:7}], + tabList:[{title:"全部",index:0},{title:"创建中",index:-1},{title:"未开始",index:3},{title:"审核中",index:6},{title:"审核驳回",index:7},{title:"进行中",index:1},{title:"暂停中",index:2},{title:"已结束",index:4},{title:"已作废",index:5}], combinedValue:[], DateTime:'',//数据更新时间 key_word:'', diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index f451aa35..f4e69a43 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -631,6 +631,7 @@ linkTo(row){ let str = "" let str2 = 编辑 + 复制 { keysIsSend(rowData.id).then((res)=>{ @@ -681,28 +682,8 @@ linkTo(row){ - - if(rowData.status >= 6 ) - { - str2 =
编辑 - - -
{ - }}> 更多
-
- - - - -
-
- } - - - - - return rowData.status >= 6 ? str2 : str + return rowData.status == 7 || rowData.status == 6 ? str2 : str } }} /> @@ -714,7 +695,7 @@ linkTo(row){ this.state.audit_visible ? (
-
+
{this.cancel(e)}} />