zhangqi 2 سال پیش
والد
کامیت
7e3e1b4853
2فایلهای تغییر یافته به همراه7 افزوده شده و 13 حذف شده
  1. 1 1
      src/customized/cucu/orderManage/detail/index.vue
  2. 6 12
      src/template/selectProduct/index.vue

+ 1 - 1
src/customized/cucu/orderManage/detail/index.vue

@@ -60,7 +60,7 @@
               <a-button :disabled="utils.isDisabled(orderData.status,['确认','提交','审核','关闭'])" :type="isEditDisabled?'primary':'dashed'" @click="editRowProd">{{isEditDisabled?'行编辑':'保存'}}</a-button>
               <tableImport :disabled="utils.isDisabled(orderData.status,['确认','提交','审核','关闭'])" :bindData="{ownerid:router.currentRoute.value.query.id,ownertable:'sa_order',usetype:'default'}" :failedData="failedData" :modeParam="{id:20230227194703,content:{}}" @uploadSuccess="importSuccess">
               </tableImport>
-              <select-product :columns="utils.TBLayout('orderAddTable')" :tableid="utils.TBLayoutID('orderAddTable')" :disabled="utils.isDisabled(orderData.status,['确认','提交','审核','关闭'])"  :param="{id:20221109153502,content:{sa_orderid:orderData.sa_orderid,pageNumber:1,pageSize:20,where:{condition:''}}}" @onSelectChange="addProductToBody">
+              <select-product :columns="utils.TBLayout('orderAddTable')" :tableid="utils.TBLayoutID('orderAddTable')" :disabled="utils.isDisabled(orderData.status,['确认','提交','审核','关闭'])"  :param="{id:20221109153502,content:{sa_orderid:orderData.sa_orderid,pageNumber:1,pageSize:20,where:{condition:'',tablefilter:{}}}}" @onSelectChange="addProductToBody">
                 <template #tb_cell="{data}">
                   <template v-if="data.column.dataIndex === 'qty'">
                     <a-input-number style="width:100%" id="inputNumber" :precision="2" v-model:value="data.record.qty" :min="data.record.orderminqty" :step="data.record.orderaddqty"/>

+ 6 - 12
src/template/selectProduct/index.vue

@@ -29,7 +29,7 @@
         :row-class-name="(_record, index) => (index % 2 === 1 ? 'table-striped' : null)">
         <template #headerCell="{ column }">
           <div style="min-width:100px;" v-if="column.filter == 1 || column.filter == 2">
-            <a-input v-model:value="column.value" :placeholder="column.title" @change="setSearchParam(column.dataIndex,column.value)" @pressEnter="listData(column.dataIndex,column.value)"></a-input>
+            <a-input v-model:value="column.value" :placeholder="column.title" @pressEnter="listData(column.dataIndex,column.value)"></a-input>
           </div>
           <span v-else style="display:inline-block;padding:0 10px;">{{column.title}}</span>
         </template>
@@ -140,13 +140,12 @@
     listData()
   }
   const listData = async (dataIndex,value)=> {
-    if (dataIndex && value) {
-      console.log()
-      setSearchParam(dataIndex, value)
-    }
+    props.param.content.where.tablefilter = {}
+    console.log(propsColumns.value)
+    propsColumns.value.forEach((e)=>{
+      e.value?props.param.content.where.tablefilter[e.dataIndex] = e.value:''
+    })
     props.param.content.tableid = props.tableid
-    console.log(props.param)
-
     const res = await Api.requested(props.param)
     res.data.forEach(element => {
       element.qty = element.qty ? element.qty:element.orderminqty
@@ -154,11 +153,6 @@
     data.value = res.data
     total.value = res.total
   }
-  const setSearchParam = (dataIndex,value)=>{
-    props.param.content.pageNumber = 1
-    props.param.content.where.tablefilter = props.param.content.where.tablefilter ? props.param.content.where.tablefilter : {}
-    props.param.content.where.tablefilter[dataIndex] = value
-  }
   const onSelect = async (record, selected, selectedRows, nativeEvent)=>{
     if (!selected) {
       tableRecord.value = tableRecord.value.filter(e=>e.itemid !== record.itemid)