Quellcode durchsuchen

Merge remote-tracking branch 'origin/master'

韩帛霖 vor 1 Jahr
Ursprung
Commit
7997847695

+ 5 - 5
zkqy-ui/src/views/bussiness/processMange.vue

@@ -180,21 +180,21 @@
             :value="jsonData"
           /> -->
 
-         <!--  <component
+          <component
             :is="myForm"
             :formData="formData"
             :row="row"
             ref="myFormRef"
             v-if="myForm"
-          ></component> -->
+          ></component>
 
           <!-- <Loading :formData="formData" :row="row" ref="myFormRef"></Loading> -->
           <!--  <Processing :formData="formData" :row="row" ref="myFormRef"></Processing> -->
           <!--  <Assemble :formData="formData" :row="row" ref="myFormRef"></Assemble> -->
-           <Detection :formData="formData" :row="row" ref="myFormRef"></Detection>
-         <!--  <WareHousing :formData="formData" :row="row" ref="myFormRef"></WareHousing> -->
+          <!-- <Detection :formData="formData" :row="row" ref="myFormRef"></Detection> -->
+          <!--  <WareHousing :formData="formData" :row="row" ref="myFormRef"></WareHousing> -->
 
-          <!-- <QRCode :formData="formData" :row="row" ref="myFormRef" /> -->    
+          <!-- <QRCode :formData="formData" :row="row" ref="myFormRef" /> -->
           <span slot="footer" class="dialog-footer">
             <el-button @click="closeExecuteNode">取消</el-button>
             <el-button type="primary" @click="executeNode">确认运行</el-button>

+ 17 - 3
zkqy-ui/src/views/orderMange/approve.vue

@@ -175,13 +175,27 @@
         class-name="small-padding fixed-width"
       >
         <template slot-scope="scope">
-          <el-button
+          <!-- <el-button
             type="info"
             size="default"
             @click="handleEdit(scope.$index, scope.row)"
             >审批</el-button
-          >
-
+          > -->
+          <el-dropdown>
+            <el-button type="warning" plain size="small">
+              处理<i class="el-icon-arrow-down el-icon--right"></i>
+            </el-button>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item>
+                <el-button
+                  type="text"
+                  size="mini"
+                  @click="handleEdit(scope.$index, scope.row)"
+                  >审批</el-button
+                >
+              </el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
           <Menu
             :row="scope.row"
             v-for="btnObj in excuteBtnArr"

+ 52 - 16
zkqy-ui/src/views/orderMange/index.vue

@@ -87,7 +87,7 @@
           icon="el-icon-delete"
           size="mini"
           :disabled="multiple"
-          @click="batchDelete"
+          @click="myDeleteHandler"
           >删除
         </el-button>
       </el-col>
@@ -136,7 +136,7 @@
       ref="tableRef"
       :cell-style="cellStyle"
       :reserve-selection="true"
-      :row-key="getRowKey"
+      row-key="saleOrderId"
     >
       <el-table-column
         type="selection"
@@ -440,11 +440,6 @@
             </el-table-column>
             <el-table-column prop="productAmounts" label="金额">
               <template slot-scope="scope">
-                <!-- <el-input
-                  v-model="scope.row.productAmounts"
-                  size="small"
-                  clearable
-                ></el-input> -->
                 {{ scope.row.productAmounts }}
               </template>
             </el-table-column>
@@ -725,6 +720,7 @@ import {
   getStatisticList,
   getTableList1,
   checkOrderNo,
+  delOrder,
 } from "@/api/tablelist/commonTable";
 import { listData } from "@/api/system/tenant/data";
 import { getToken } from "@/utils/auth";
@@ -745,6 +741,7 @@ export default {
   components: { Queryfrom, Menu, DialogTemplate },
   data() {
     return {
+      myDelIds: [], //新增接口 删除的id
       // 详情弹窗数据
       detailShow: false,
       printDomData: "",
@@ -1212,7 +1209,8 @@ export default {
               btnName: "编辑",
               btnType: "myEdit",
               btnIcon: "",
-              btnShowCondition: "",
+              btnShowCondition:
+                '[{"fieldName":"sale_order.status","mark":"6","refValue":"1"}]',
               children: [],
             },
             {
@@ -1221,6 +1219,14 @@ export default {
               btnIcon: "",
               btnShowCondition: "",
               children: [],
+            },
+            {
+              btnName: "删除",
+              btnType: "myDelete",
+              btnIcon: "",
+              btnShowCondition:
+                '[{"fieldName":"sale_order.status","mark":"6","refValue":"1"}]',
+              children: [],
             }
           );
           // }
@@ -1273,9 +1279,9 @@ export default {
             // });
             this.tableList = await this.setFieldStyleData(tempTableList);
             this.total = res.total;
-            // this.$nextTick(() => {
-            //   this.$refs.tableRef?.clearSelection();
-            // });
+            this.$nextTick(() => {
+              this.$refs.tableRef?.clearSelection();
+            });
             this.loading = false;
           });
 
@@ -1331,6 +1337,7 @@ export default {
         if (valid) {
           console.log(valid);
           let {
+            id,
             //订单表数据
             saleNo,
             saleCustomNo,
@@ -1451,7 +1458,8 @@ export default {
             Object.keys(craftValue).map((k) => {
               craftData.commMap[k] = craftValue[k];
             });
-            saleData.conditionMap.saleNo = saleValue.saleNo;
+            // saleData.conditionMap.saleNo = saleValue.saleNo;
+            saleData.conditionMap.id = this.formData.id;
             craftData.conditionMap.saleCraftNo = craftValue.saleCraftNo;
             // for(let i = 0;i<this.)
             let deletPayload = {
@@ -1720,6 +1728,8 @@ export default {
       //       )
       //     ]
       // );
+      this.myDelIds = selection.map((item) => item.saleOrderId);
+      console.log(this.myDelIds);
       this.ids = selection.map((item) => item.saleOrderSaleNo);
       this.single = selection.length != 1;
       this.multiple = !selection.length;
@@ -2071,11 +2081,11 @@ export default {
     },
     /** 导出按钮操作 */
     handleExport() {
-      let primary = camelCase(this.templateInfo.template?.primaryKey);
-      let realyKey = camelCase(this.tableName + "_" + primary);
-      if (this.ids.length > 0) {
+      let primary = "saleOrderId";
+      let realyKey = "saleOrderId";
+      if (this.myDelIds.length > 0) {
         this.queryParams["execlMap"] = [];
-        this.ids.forEach((item) => {
+        this.myDelIds.forEach((item) => {
           this.queryParams.execlMap.push(
             this.tableList.find((ttem) => {
               return ttem[realyKey] === item;
@@ -2743,6 +2753,30 @@ export default {
         //         </tr>
       }
     },
+    // 自定义删除按钮
+    async myDeleteHandler(row) {
+      console.log(row);
+      await this.$confirm("是否确认删除选中的数据?", "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      });
+      let payLoad = row.saleOrderId ? [row.saleOrderId] : this.myDelIds;
+      console.log(payLoad);
+      try {
+        let res = await delOrder(payLoad);
+        if (res.code === 200) {
+          this.$message.success("删除成功");
+          this.getList();
+          this.myDelIds = [];
+          // this.$nextTick(() => {
+          //   this.$refs.tableRef?.clearSelection();
+          // });
+        } else {
+          this.$message.error(res.msg);
+        }
+      } catch (error) {}
+    },
 
     // 操作列回调
     excuteHandler(btnData, row) {
@@ -2780,6 +2814,8 @@ export default {
         case "myDetail":
           this.handleDetail(row);
           break;
+        case "myDelete":
+          this.myDeleteHandler(row, btnData);
         default:
           break;
       }