ソースを参照

超节损搜索

zck 1 年間 前
コミット
b6cf2f19ae
1 ファイル変更30 行追加32 行削除
  1. 30 32
      src/view/performance/12-orderAccounting/index.vue

+ 30 - 32
src/view/performance/12-orderAccounting/index.vue

@@ -10,28 +10,10 @@
             class="demo-form-inline"
             @submit.native.prevent>
             <el-form-item>
-              <el-input
-                v-model="searchInfo"
-                placeholder="搜索产品编号或产品名称"
-                clearable
-                style="width: 180px"
-              />
-              <el-button
-                type="primary"
-                icon="search"
-                class="search"
-                @click="handleSearch"
-              />
+              <el-input v-model="searchInfo" placeholder="搜索产品编号或产品名称 " clearable  style="width: 180px"/>
+              <el-button type="primary" icon="search" class="search"  @click="handleSearch"/>
               <el-button
-                type="primary"
-                icon="edit"
-                class="bt"
-                @click="
-                  () => {
-                    dialogDetail = true;
-                  }
-                "
-              ><i class="el-icon-edit" />查改
+                type="primary"icon="edit"class="bt"@click=" () => { dialogDetail = true; } "><i class="el-icon-edit" />查改
               </el-button>
               <!--                <el-button type="primary" disabled icon="edit" @click="" style="margin-left: 10px">工艺方案复制</el-button>-->
               <el-button
@@ -567,12 +549,28 @@ const showOrderSuperLossGy = async() => {
   }
 }
 // 定位
-const handleSearch = () => {
-  if (searchInfo.value) {
-    tableData1.value = tableData1.value.filter((item) => {
-      return item['Gd_gdbh'] === searchInfo.value ?? item
-    })
-  }
+const  handleSearch = async() => {
+  console.log(searchInfo.value)
+  //调用搜索接口
+  const res = await getTable({ search:searchInfo.value,limit:999,page:1})
+  console.log(res)
+  tableData1.value = res.data.data.map((item) => ({
+      ...item,
+      csgd:
+        parseFloat(item['target_rate']) - parseFloat(item['real_rate']) > 0
+          ? '√'
+          : '',
+      date: date,
+    }))
+
+
+
+
+  // if (searchInfo.value) {
+  //   tableData1.value = tableData1.value.filter((item) => {
+  //     return item['Gd_gdbh'] === searchInfo.value ?? item
+  //   })
+  // }
 }
 
 /* const rowClassName = ({ row, rowIndex }) => {
@@ -582,12 +580,12 @@ const handleSearch = () => {
   return ''
 }*/
 
-const cellClassName = ({ row, column, rowIndex, columnIndex }) => {
-  if ([7, 11, 13, 21].includes(columnIndex)) {
-    return 'red-cell'
+  function cellClassName({ row, column, rowIndex, columnIndex }) {
+    if ([7, 11, 13, 21].includes(columnIndex)) {
+      return 'red-cell'
+    }
+    return ''
   }
-  return ''
-}
 
 const printPageRef = ref()
 function handleGddy() {