Kaynağa Gözat

Merge branch 'master' of https://a.leanwo.com:3000/prodog-client-2023/pc-component-v3

YangZhiJie 1 yıl önce
ebeveyn
işleme
76cf54817f

+ 495 - 0
examples/info/DocGeneratorExample.vue

@@ -0,0 +1,495 @@
+<template>
+  <div class="container-box">
+    <div class="grid-item-1">
+      <Navbar :title="title" :is-go-back="false" />
+    </div>
+    <div class="grid-item-2" style="margin-bottom: 5px">
+      <div class="btn-group">
+        <button class="btn btn-primary" @click="generate()">确定</button>
+        <button class="btn btn-warning" @click="back()">撤销</button>
+      </div>
+    </div>
+    <div class="grid-item-3">
+      <DocGenerator
+        ref="docGenerator"
+        :info-window-no="infoWindowNo"
+        :generate-ids="generateIds"
+        :add-sql="addSql"
+        @show-title="title = $event"
+      />
+    </div>
+  </div>
+</template>
+  
+<script>
+import Common from '../../packages/common/Common.js';
+import DocGenerator from '../../packages/info/src/DocGenerator.vue';
+import Notify from '../../packages/common/Notify';
+import IFrameUtil from '../../packages/common/IFrameUtil.js';
+import Navbar from '../../packages/navbar/src/Navbar.vue';
+export default {
+  components: { DocGenerator, Navbar },
+  data: function () {
+    return {
+      uuid: '',
+      infoWindowNo: '',
+      type: '',
+      title: '',
+      generateIds: [],
+      addSql: undefined,
+      modelData: undefined,
+      userId: null,
+    };
+  },
+
+  mounted: function () {
+    // 测试请手动设置路由
+    this.uuid = this.$route.params.uuid;
+    this.infoWindowNo = this.$route.params.infoWindowNo;
+    this.type = this.$route.params.type;
+    // 测试请手动设置localStorage
+    const item = `${this.uuid}#GenerateDocumentTool`;
+    this.modelData = JSON.parse(localStorage.getItem(item));
+    // 正式使用
+    // this.modelData = window.opener.getModelData();
+    const loginInfo = localStorage.getItem('#LoginInfo');
+    if (loginInfo) {
+      this.userId = JSON.parse(loginInfo).userId;
+    } else {
+      this.userId = -1;
+    }
+    if (this.type == 'currentStock') {
+      if (this.modelData.data.warehouse.id != null) {
+        this.addSql = 'c.id = ' + this.modelData.data.warehouse.id;
+      } else {
+        this.addSql = 'c.id = -1 ';
+      }
+    } else if (this.type == 'currentStockWork') {
+      if (this.modelData.data.warehouse.id != null) {
+        this.addSql = 'c.id = ' + this.modelData.data.warehouse.id;
+      } else {
+        this.addSql = 'c.id = -1 ';
+      }
+    } else if (this.type == 'currentStockProject') {
+      if (this.modelData.data.warehouse.id != null) {
+        this.addSql = 'c.id = ' + this.modelData.data.warehouse.id;
+      } else {
+        this.addSql = 'c.id = -1 ';
+      }
+    } else if (this.type == 'inventoryOut') {
+      //必选先选择仓库
+      if (this.modelData.data.warehouse.id != null) {
+        //分配状态为责任人变更
+        if (
+          this.modelData.data.inventoryOutType != null &&
+          this.modelData.data.inventoryOutType.displayValue[0] != null &&
+          this.modelData.data.inventoryOutType.displayValue[0] ==
+            'Change_Of_Responsible_Person'
+        ) {
+          this.addSql =
+            `c.id = ${this.modelData.data.warehouse.id} AND (csk.inventoryItemStatus = 'Assigned') ` +
+            ` AND (csk.responsibilityUserId = ${this.userId}) `;
+        }
+        //分配状态为退回/归还
+        else if (
+          this.modelData.data.inventoryOutType != null &&
+          this.modelData.data.inventoryOutType.displayValue[0] == 'Send_Back'
+        ) {
+          this.addSql =
+            `c.id = ${this.modelData.data.warehouse.id} AND (csk.inventoryItemStatus = 'Assigned') ` +
+            ` AND (u.id = ${this.userId}) `;
+        }
+        //分配状态为领用/借用
+        else if (
+          this.modelData.data.inventoryOutType != null &&
+          this.modelData.data.inventoryOutType.displayValue[0] ==
+            'Requisition_Borrowing'
+        ) {
+          this.addSql = `c.id = ${this.modelData.data.warehouse.id} AND (csk.inventoryItemStatus = 'Assignable' OR csk.inventoryItemStatus = 'Returning_Distributable_Funds') `;
+        }
+        //管理员分配
+        else if (this.modelData.data.inventoryOutType == null) {
+          this.addSql = `c.id = ${this.modelData.data.warehouse.id} AND (csk.inventoryItemStatus = 'Assignable' OR csk.inventoryItemStatus = 'Returning_Distributable_Funds') `;
+        } else {
+          this.addSql = 'c.id = -1 ';
+        }
+      } else {
+        this.addSql = 'c.id = -1 ';
+      }
+    } else if (this.type == 'stockOutProject') {
+      //当选择出库类型是正常报废出库的时候,从报废申请明细中生成出库明细
+      //下面的查询窗口代码是根据报废申请明细查询库存数据
+      if (
+        this.modelData.data.stockOutProjectType.displayValue[0] ==
+        'Normal_Scrapping'
+      ) {
+        this.infoWindowNo = '20240201_161916';
+      } else if (
+        this.modelData.data.stockOutProjectType.displayValue[0] ==
+        'Systematic_Differences'
+      ) {
+        this.infoWindowNo = '20240415_201354';
+      }
+      if (this.modelData.data.warehouse.id != null) {
+        this.addSql = 'c.id = ' + this.modelData.data.warehouse.id;
+      } else {
+        this.addSql = 'c.id = -1 ';
+      }
+    } else if (this.type == 'scrapApply') {
+      if (this.modelData.data.warehouse.id != null) {
+        //报废申请查询的物料库存数据只能查询责任人是当前登录人的
+        this.addSql = `c.id = ${this.modelData.data.warehouse.id} AND u.id = ${this.userId}`;
+      } else {
+        this.addSql = 'c.id = -1 ';
+      }
+    } else if (this.type == 'syncStockOutPrepareProject') {
+      if (this.modelData.data.warehouse.id != null) {
+        this.addSql = `cwh.id = ${this.modelData.data.warehouse.id}`;
+      } else {
+        this.addSql = 'cwh.id = -1 ';
+      }
+    } else if (this.type == 'IdleManagement') {
+      if (this.modelData.data.warehouse.id != null) {
+        this.addSql = 'w.id = ' + this.modelData.data.warehouse.id;
+      } else {
+        this.addSql = 'w.id = -1 ';
+      }
+    } else if (this.type == 'IdleManagementWork') {
+      if (this.modelData.data.warehouse.id != null) {
+        this.addSql = 'w.id = ' + this.modelData.data.warehouse.id;
+      } else {
+        this.addSql = 'w.id = -1 ';
+      }
+    }
+  },
+
+  methods: {
+    generate: function () {
+      var _self = this;
+
+      var selectedDatas = _self.$refs.docGenerator.getSelectedData();
+      if (
+        selectedDatas === undefined ||
+        selectedDatas === null ||
+        selectedDatas.length === 0
+      ) {
+        Notify.error('提示', '未选择任何数据。', false);
+        return;
+      }
+      let modelData = IFrameUtil.getCurdModelData();
+      let url = null;
+
+      if (_self.type == 'purchaseRequest') {
+        url = 'PurchaseOrderResource/generatePurchaseOrderModelData';
+      } else if (_self.type == 'purchaseOrder') {
+        url =
+          'purchaseOrderArrivalResource/generatePurchaseOrderArrivalModelData';
+      } else if (_self.type == 'purchaseOrderArrival') {
+        url =
+          'incomingInspectionRequestResource/generateInspectRequestModelData';
+      } else if (_self.type == 'inspectionRequest') {
+        if (selectedDatas.length > 1) {
+          Notify.error('数据选择错误', '只能选择一条报检单明细数据', false);
+          return;
+        } else {
+          url = 'incomingInspectionResource/generateInspectionModelData';
+        }
+      } else if (_self.type == 'inspectionReject') {
+        if (selectedDatas.length > 1) {
+          Notify.error('数据选择错误', '只能选择一条检验单数据', false);
+          return;
+        } else {
+          url =
+            'incomingInspectionRejectResource/generateInspectionRejectModelData';
+        }
+      } else if (_self.type == 'inspectionStockIn') {
+        url = 'stockInResource/generateStockInModelDataByInspection';
+      } else if (_self.type == 'purchaseOrderArrivalStockIn') {
+        url = 'stockInResource/generateStockInModelDataByArrival';
+      } else if (_self.type == 'purchaseStockIn') {
+        url = 'StockOutResource/generateMaterialStockOutModelData';
+      } else if (_self.type == 'purchaseOrderReturn') {
+        url =
+          'purchaseOrderReturnResource/generatePurchaseOrderReturnModelData';
+      } else if (_self.type == 'materialStockOut') {
+        url = 'StockOutResource/generateRedStockOutModelData';
+      } else if (_self.type == 'redPurchaseStockIn') {
+        url = 'stockInResource/generateRedStockInModelData';
+      } else if (_self.type == 'stockInPrepareLine') {
+        url = 'stockInResource/generateRedStockInPrepareModelData';
+      } else if (_self.type == 'generateStockInByOrder') {
+        url = 'stockInResource/generateStockInByOrder';
+      } else if (_self.type == 'newPurchaseRequest') {
+        //仓库模块-采购订单
+        url = 'PurchaseOrderResource/generateModelData';
+      } else if (_self.type == 'newPurchaseOrder') {
+        //仓库模块-采购到货单
+        url = 'purchaseOrderArrivalResource/generateModelData';
+      } else if (_self.type == 'newArrivalStockIn') {
+        //仓库模块-(到货单生成)入库单
+        url = 'stockInResource/generateArrivalStockInModelData';
+      } else if (_self.type == 'newArrivalInspectionRequest') {
+        //仓库模块-来料报检单
+        url = 'incomingInspectionRequestResource/generateModelData';
+      } else if (_self.type == 'newInspectionRequest') {
+        //仓库模块-来料检验单
+        if (selectedDatas.length > 1) {
+          Notify.error('数据选择错误', '只能选择一条报检单数据', false);
+          return;
+        } else {
+          url = 'incomingInspectionResource/generateModelData';
+        }
+      } else if (_self.type == 'newInspectionReject') {
+        //仓库模块-不良品处理单
+        if (selectedDatas.length > 1) {
+          Notify.error('数据选择错误', '只能选择一条检验单数据', false);
+          return;
+        } else {
+          url = 'incomingInspectionRejectResource/generateModelData';
+        }
+      } else if (_self.type == 'newCurrentStock') {
+        //仓库模块-(仓库库存生成)出库单
+        url = 'StockOutResource/generateModelData';
+      } else if (_self.type == 'newRedStockOut') {
+        //仓库模块-红字出库单
+        url = 'StockOutResource/generateRedModelData';
+      } else if (_self.type == 'newPurchaseOrderReturn') {
+        //仓库模块-采购退货单
+        url = 'purchaseOrderReturnResource/generateModelData';
+      } else if (_self.type == 'newStockOut') {
+        //仓库模块-红字出库单
+        url = 'StockOutResource/generateRedModelData';
+      } else if (_self.type == 'newRedStockIn') {
+        //仓库模块-红字入库单
+        url = 'stockInResource/generateRedModelData';
+      } else if (_self.type == 'invStockIn') {
+        //仓库模块-(物料批量)入库单
+        url = 'stockInResource/generateModelDataByInventory';
+      } else if (_self.type == 'orderToIn') {
+        //仓库模块-(订单生成)入库单
+        url = 'stockInResource/generateOrderToInModelData';
+      } else if (_self.type == 'saleOrderToIn') {
+        //仓库模块-销售订单生成入库单
+        url = 'stockInResource/generateSaleOrderToInModelData';
+      } else if (_self.type == 'saleOrderToOut') {
+        //仓库模块-销售订单生成出库单
+        url = 'StockOutResource/generateSaleOrderToOutModelData';
+      } else if (_self.type == 'saleOrderToPrepare') {
+        //仓库模块-销售订单生成领料单
+        url = 'stockOutPrepareResource/generateSaleOrderToPrepareModelData';
+      } else if (_self.type == 'prepareToOut') {
+        //仓库模块-领料单生成出库单
+        url = 'StockOutResource/generatePrepareToOutModelData';
+      } else if (_self.type == 'saleOrderToStockUp') {
+        //销售订单生成备货单
+        url = 'StockUpResource/generateSaleOrderToStockUpModelData';
+      } else if (_self.type == 'applyToStockUp') {
+        //布草管理-出库申请单生成仓库备货单
+        url = 'StockUpResource/generateApplyToUpModelData';
+      } else if (_self.type == 'purchaseOrderToStockOut') {
+        //布草管理-采购订单详单生成工厂出库单
+        url = 'StockOutResource/generateStockOutByPurchaseOrder';
+      } else if (_self.type == 'newAssetCheck') {
+        //资产采购单生成验收单
+        url = 'assetCheckResource/generateModelData';
+      } else if (_self.type == 'newPurchaseBill') {
+        //采购单生成采购丁单发票
+        url = 'purchaseOrderBillResource/generateModelData';
+      } else if (_self.type == 'newPurchaseOrderPayment') {
+        //采购订单生成付款单
+        url = 'purchaseOrderPaymentResource/generateModelData';
+      } else if (_self.type == 'newSaleOrderReceivables') {
+        //销售订单生成收款单
+        url = 'SaleOrderReceiptResource/generateModelData';
+      } else if (_self.type == 'newSaleOrderBill') {
+        //销售订单生成销售订单发票
+        url = 'saleOrderBillResource/generateModelData';
+      } else if (_self.type == 'newSaleOrderReceipt') {
+        //销售订单生成收款单
+        url = 'SaleOrderReceiptResource/generateModelData';
+      } else if (_self.type == 'generatePurchaseRequest') {
+        //申购单生成采购订单
+        url = 'PurchaseOrderResource/generateModelData';
+      } else if (_self.type == 'generatePurchaseOrder') {
+        //采购订单生成采购到货
+        url = 'PurchaseOrderArrivalResource/generateModelData';
+      } else if (_self.type == 'syncStockOutPrepare') {
+        //领料申请生成入库单
+        url = 'stockInResource/generateModelDataBySyncStockOutPrepare';
+      } else if (_self.type == 'syncStockOutPrepareWork') {
+        //领料申请生成入库单-办公劳保
+        url = 'StockInWorkResource/generateModelDataBySyncStockOutPrepareWork';
+      } else if (_self.type == 'syncStockOutPrepareProject') {
+        //调拨申请生成入库单-工程设备仓
+        url =
+          'StockInProjectResource/generateModelDataBySyncStockOutPrepareProject';
+      } else if (_self.type == 'currentStock') {
+        //库存查询生成领料叫料
+        url = 'StockOutResource/generateModelDataByCurrentStock';
+      } else if (_self.type == 'currentStockWork') {
+        //库存查询生成领料叫料-办公劳保
+        url = 'StockOutWorkResource/generateModelDataByCurrentStockWork';
+      } else if (_self.type == 'inventoryOut') {
+        //库存查询生成物料分配明细-工程设备仓
+        url = 'InventoryOutResource/generateModelDataByCurrentStockProject';
+      } else if (_self.type == 'scrapApply') {
+        //库存查询生成物料报废明细-工程设备仓
+        url = 'ScrapApplyResource/generateModelDataByCurrentStockProject';
+      } else if (_self.type == 'stockOutProject') {
+        //库存查询生成物料出库明细-工程设备仓
+        url = 'StockOutProjectResource/generateModelDataByCurrentStockProject';
+      } else if (_self.type == 'stockReturn') {
+        //领料生成退库
+        url = 'StockOutResource/generateModelDataByStockReturn';
+      } else if (_self.type == 'stockWorkReturn') {
+        //领料生成退库-办公劳保
+        url = 'StockOutWorkResource/generateModelDataByStockReturn';
+      } else if (_self.type == 'IdleManagement') {
+        //库存查询生成闲置
+        url = 'IdleManagementResource/generateModelDataByCurrentStock';
+      } else if (_self.type == 'IdleManagementWork') {
+        //库存查询生成闲置-办公劳保
+        url = 'IdleManagementWorkResource/generateModelDataByCurrentStock';
+      } else {
+        Notify.error('提示', '不识别的生单地址。' + _self.type, false);
+        return;
+      }
+      let generateDocumentModelData = {
+        windowNo: modelData.windowNo,
+        tabIndex: modelData.tabIndex,
+        modelData: modelData,
+        inputDatas: selectedDatas,
+      };
+
+      $.ajax({
+        url: Common.getApiURL(url),
+        type: 'post',
+        contentType: 'application/json',
+        data: JSON.stringify(generateDocumentModelData),
+        beforeSend: function (request) {
+          Common.addTokenToRequest(request);
+        },
+        success: function (modelData) {
+          if (modelData != undefined) {
+            if (modelData.saveDatas != undefined) {
+              modelData.saveDatas.forEach(function (item) {
+                if (item.editMode == null) {
+                  item.editMode = true;
+                }
+                item.tabIndex = 1;
+              });
+            }
+            // IFrameUtil.setCurdModelData(modelData);
+            window.opener.modelDataChanged(modelData);
+            _self.back();
+          }
+        },
+        error: function (XMLHttpRequest, textStatus, errorThrown) {
+          Common.processException(XMLHttpRequest, textStatus, errorThrown);
+        },
+      });
+    },
+
+    isShowVendorDialogA: function (data) {
+      var _self = this;
+      var messageStr = '';
+      data.forEach(function (item, index) {
+        if (index == data.length - 1) {
+          messageStr += item.name;
+        } else {
+          messageStr += item.name + ',';
+        }
+      });
+      Notify.show({
+        title: '项目确认',
+        message: '您选择的请购订单明细中存在不同项目【' + messageStr + '】',
+        buttons: [
+          {
+            label: '取消',
+            action: function (dialogItself) {
+              dialogItself.close();
+            },
+          },
+        ],
+      });
+    },
+
+    isShowVendorDialog: function (data) {
+      var _self = this;
+      var messageStr = '';
+      data.forEach(function (item, index) {
+        if (index == data.length - 1) {
+          messageStr += item.vendorName;
+        } else {
+          messageStr += item.vendorName + ',';
+        }
+      });
+      Notify.show({
+        title: '供应商确认',
+        message:
+          '您选择的请购订单明细中存在不同供应商【' +
+          messageStr +
+          '】,如果点击\\"确定\\"按钮,将从供应商【' +
+          data[data.length - 1].vendorName +
+          '】下订单,否则点击\\"取消\\"按钮',
+        buttons: [
+          {
+            label: '确定',
+            cssClass: 'btn-primary',
+            action: function (dialogItself) {
+              dialogItself.close();
+              var url = 'PurchaseOrderResource/generatePurchaseOrderModelData';
+              _self.responseReceiveData(_self.obj);
+            },
+          },
+          {
+            label: '取消',
+            action: function (dialogItself) {
+              dialogItself.close();
+            },
+          },
+        ],
+      });
+    },
+    /**
+     * 返回,关闭模态框
+     */
+    back: function () {
+      IFrameUtil.close();
+    },
+  },
+};
+</script>
+  
+  <style scoped>
+.grid-container {
+  display: grid;
+  grid-template-columns: 100%;
+  grid-template-rows: min-content min-content auto;
+  height: calc(100vh - 35px);
+  width: 100%;
+  padding: 10px;
+}
+
+.grid-item-1 {
+  grid-row: 1 / 2;
+  grid-column: 1 / 2;
+}
+
+.grid-item-2 {
+  grid-row: 2 / 3;
+  grid-column: 1 / 2;
+}
+
+.grid-item-3 {
+  overflow: auto;
+  grid-row: 3/4;
+  grid-column: 1 / 2;
+  height: 100%;
+}
+.container-box {
+  padding: 20px;
+  height: calc(100vh - 20px);
+}
+</style>
+  

+ 3 - 0
examples/route/index.js

@@ -29,6 +29,7 @@ const DocGeneratorSelected = () => import(/* webpackChunkName: "doc-generator-se
 const SearchInput = () => import(/* webpackChunkName: "doc-generator-selected" */ '../../packages/info/src/SearchInput.vue');
 const SearchInputExample = () => import(/* webpackChunkName: "doc-generator-selected" */ '../search-input/SearchInputExample.vue');
 const WriteEpcExample = () => import('../print/src/WriteEpcExample.vue');
+const DocGeneratorExample = () => import('../info/DocGeneratorExample.vue');
 
 export default {
   routes: [
@@ -116,6 +117,8 @@ export default {
         // 搜寻筛选输入选择框
         { path: 'searchInput', component: SearchInput },
         { path: 'search-input-example', component: SearchInputExample },
+        // 生单例子
+        { path: 'generate-document/:type/:infoWindowNo/:uuid', component: DocGeneratorExample },
       ],
 
     },

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "pc-component-v3",
-  "version": "1.0.83",
+  "version": "1.0.86",
   "description": "",
   "main": "dist/pc-component-v3.js",
   "scripts": {

+ 204 - 116
packages/info/src/DocGenerator.vue

@@ -1,38 +1,46 @@
 <template>
+  <ul class="nav nav-tabs m-row" role="tablist">
+    <li role="presentation" :class="{ active: tabIndex === 1 }">
+      <a
+        @click="
+          tabIndex = 1;
+          isGenerator = false;
+        "
+      >{{ $t("lang.QueryCondition.simpleQuery") }}</a>
+    </li>
+    <li role="presentation" :class="{ active: tabIndex === 2 }">
+      <a
+        @click="
+          tabIndex = 2;
+          isComplex = true;
+          isGenerator = true;
+        "
+      >{{ $t("lang.QueryCondition.advancedQuery") }}</a>
+    </li>
+    <li role="presentation" :class="{ active: tabIndex === 3 }">
+      <a @click="openSelect">{{ $t("lang.DocGenerator.selectedDatas") }}</a>
+    </li>
+  </ul>
   <div class="grid-container-2">
     <div class="grid-header-2">
       <QueryCondition
         ref="queryCondition"
         :info-filter-fields="infoFilterFields"
-        :show-button="true"
         :is-search-widget="true"
+        :show-button="true"
         :info-window-no="infoWindowDto.no"
-        @simple-search="simpleSearch()"
-        @complex-search="complexSearch()"
+        :is-complex="isComplex"
+        :is-generator="isGenerator"
+        @open-complex="openComplex"
+        @simple-search="simpleSearch"
+        @complex-search="complexSearch"
         @refresh-search="queryInfoWindowData"
-        @change-search="tabIndex = 1;"
-      >
-        <template #header>
-          <li
-            role="presentation"
-            :class="{'active': tabIndex === 2}"
-          >
-            <a @click="$refs.queryCondition.changeSearch(1); tabIndex = 2;">{{ $t('lang.DocGenerator.selectedDatas') }}</a>
-          </li>
-        </template>
-        <template #body>
-          <div
-            class="tab-pane"
-            :class="{'active': tabIndex === 2}"
-          />
-        </template>
-      </QueryCondition>
+        @change-search="tabIndex = 1"
+      />
     </div>
-
     <div class="grid-content-2">
       <DocGeneratorGrid
-        v-show="tabIndex === 1" 
-                
+        v-show="tabIndex !== 3"
         ref="docGeneratorGrid"
         :info-window-no="infoWindowNo"
         :info-grid-fields="infoGridFields"
@@ -42,14 +50,16 @@
         @select-changed="selectChanged"
       />
 
-      <DocGeneratorSelected 
-        v-show="tabIndex === 2"
+      <DocGeneratorSelected
+        v-show="tabIndex === 3"
         ref="docGeneratorSelected"
         :info-window-no="infoWindowNo"
         :info-grid-fields="infoGridFields"
-        @select-changed="queryInfoWindowData"
+        @select-changed="deleteChange"
+        @update-datas="updateDatas"
       />
     </div>
+
     <Loading v-if="loading" />
   </div>
 </template>
@@ -65,13 +75,22 @@ export default {
   name: 'DocGenerator',
 
   components: {
-    QueryCondition, Loading,  
+    QueryCondition,
+    Loading,
     DocGeneratorSelected,
     DocGeneratorGrid,
   },
-    
+
   props: {
-    infoWindowNo : {
+    infoWindowNo: {
+      type: String,
+      default: null,
+    },
+    addSql: {
+      type: String,
+      default: null,
+    },
+    whereClauseSource:{
       type: String,
       default: null,
     },
@@ -80,46 +99,53 @@ export default {
   data: function () {
     return {
       infoWindowDto: {},
-      infoFilterFields: [],   // 过滤字段
-      infoGridFields: [],     // 表格字段
+      infoFilterFields: [], // 过滤字段
+      infoGridFields: [], // 表格字段
       infoWindowData: [],
       tabIndex: 1,
+      activeKey: 1,
       loading: false,
+      isComplex: false,
+      isGenerator: false,
+      searchType:'simple',
     };
   },
 
   watch: {
-    infoWindowNo: function(newValue, oldValue){
+    infoWindowNo: function (newValue, oldValue) {
       this.init();
     },
   },
 
-  mounted: function(){
+  mounted: function () {
     this.init();
   },
 
   methods: {
-        
     /**
-         * 加载查询窗口的定义
-         * @author YangZhiJie 20210909
-         */
+     * 加载查询窗口的定义
+     * @author YangZhiJie 20210909
+     */
     init: function () {
       var _self = this;
-      if (_self.infoWindowNo === undefined || _self.infoWindowNo === null || _self.infoWindowNo === '') {
+      if (
+        _self.infoWindowNo === undefined ||
+        _self.infoWindowNo === null ||
+        _self.infoWindowNo === ''
+      ) {
         return;
       }
-      _self.loading=true;
+      _self.loading = true;
       $.ajax({
         url: Common.getApiURL('InfoWindowResource/uniqueByNo'),
         type: 'GET',
         dataType: 'json',
-        data: { 'infoWindowNo': _self.infoWindowNo },
+        data: { infoWindowNo: _self.infoWindowNo },
         beforeSend: function (request) {
           Common.addTokenToRequest(request);
         },
         success: function (data) {
-          _self.loading=true;
+          _self.loading = true;
           _self.infoWindowDto = data;
           _self.$emit('showTitle', data.name);
           _self.$nextTick(function () {
@@ -127,72 +153,102 @@ export default {
           });
         },
         error: function (XMLHttpRequest, textStatus, errorThrown) {
-          _self.loading=true;
+          _self.loading = true;
           Common.processException(XMLHttpRequest, textStatus, errorThrown);
         },
       });
     },
-
+    openSelect: function () {
+      this.$refs.queryCondition.changeSearch(true);
+      this.tabIndex = 3;
+      this.isGenerator = true;
+    },
     /**
-         * 根据用户配置更新查询窗口的定义
-         * @author YangZhiJie 20210909
-         */
+     * 根据用户配置更新查询窗口的定义
+     * @author YangZhiJie 20210909
+     */
     initQueryPage: function () {
       var _self = this;
       if (_self.infoWindowDto === undefined || _self.infoWindowDto === null) {
         return;
       }
-            
+
       _self.infoWindowDto.infoGridFields.forEach(function (item) {
         item.width = 150;
       });
 
       _self.infoWindowDto.infoFilterFields.forEach(function (item) {
         item.value = {
-          'infoFilterFieldId': item.id,
-          'value1': '',
-          'value2': '',
+          infoFilterFieldId: item.id,
+          value1: '',
+          value2: '',
         };
       });
 
-            
-      InfoUtil.restoreInfoFilterFields(_self.infoWindowDto.no, _self.infoWindowDto.infoFilterFields);
-      InfoUtil.restoreInfoGridFields(_self.infoWindowDto.no, _self.infoWindowDto.infoGridFields);
+      InfoUtil.restoreInfoFilterFields(
+        _self.infoWindowDto.no,
+        _self.infoWindowDto.infoFilterFields,
+      );
+      InfoUtil.restoreInfoGridFields(
+        _self.infoWindowDto.no,
+        _self.infoWindowDto.infoGridFields,
+      );
 
       _self.infoFilterFields = _self.infoWindowDto.infoFilterFields;
       _self.infoGridFields = _self.infoWindowDto.infoGridFields;
 
-
       _self.$nextTick(function () {
         _self.queryInfoWindowData();
       });
     },
 
     /**
-         * 重新开始简单查询
-         * @author YangZhiJie 20210909
-         */
-    simpleSearch: function () {
+     * 重新开始简单查询
+     * @author YangZhiJie 20210909
+     */
+    simpleSearch: function (value) {
+      this.searchType = value;
       this.$refs.docGeneratorGrid.resetPagination();
       this.queryInfoWindowDataSimple();
     },
 
     /**
-         * 从新开始复杂查询
-         * @author YangZhiJie 20210909
-         */
-    complexSearch: function () {
+     * 从新开始复杂查询
+     * @author YangZhiJie 20210909
+     */
+    complexSearch: function (value) {
+      this.searchType = value;
       this.$refs.docGeneratorGrid.resetPagination();
       this.queryInfoWindowDataComplex();
     },
+    // 已选择值改变时主表数据同步改变
+    updateDatas: function (datas) {
+      const windowDatas = JSON.parse(JSON.stringify(this.infoWindowData));
+      windowDatas.forEach((i, index) => {
+        datas.forEach(j => {
+          if (i.id === j.id) {
+            windowDatas[index] = j;
+          }
+        });
+      });
+      this.infoWindowData = windowDatas;
+    },
 
+    // 当已选择删除时保证未删除的数据不变
+    deleteChange: function (datas) {
+      if (this.searchType === 'simple') {
+        this.queryInfoWindowDataSimple(true, datas);
+      } else {
+        this.queryInfoWindowDataComplex(true, datas);
+      }
+    },
     /**
-         * 查询窗口数据查询
-         * @author YangZhiJie 20210909
-         */
+     * 查询窗口数据查询
+     * @author YangZhiJie 20210909
+     */
     queryInfoWindowData: function () {
-      var isSimpleSearch = this.$refs.queryCondition.isSimpleQuery();
-      if (isSimpleSearch) {
+      // var isSimpleSearch = this.$refs.queryCondition.isSimpleQuery();
+      if (this.searchType === 'simple') {
         this.queryInfoWindowDataSimple();
       } else {
         this.queryInfoWindowDataComplex();
@@ -200,15 +256,16 @@ export default {
     },
 
     /**
-         * 简单数据查询
-         * @author YangZhiJie 20210909
-         */
-    queryInfoWindowDataSimple: function () {
+     * 简单数据查询
+     * @author YangZhiJie 20210909
+     */
+    queryInfoWindowDataSimple: function (isDelete, deleteData) {
       var _self = this;
-
       var infoQueryParam = this.$refs.docGeneratorGrid.getQueryParam();
-      infoQueryParam.infoFilterFieldValues = _self.$refs.queryCondition.getQueryCondition();            
-      _self.loading=true;
+      infoQueryParam.infoFilterFieldValues =
+        _self.$refs.queryCondition.getQueryCondition();
+      infoQueryParam.addSql = _self.addSql;
+      _self.loading = true;
       $.ajax({
         url: Common.getApiURL('InfoWindowResource/queryInfoWindowDataSimple'),
         type: 'post',
@@ -219,31 +276,47 @@ export default {
         contentType: 'application/json',
         data: JSON.stringify(infoQueryParam),
         success: function (data) {
-          _self.loading=false;
-          console.log(data);
+          _self.loading = false;
           if (data != undefined && data.range != undefined) {
+            if (isDelete === true) {
+              if (deleteData && deleteData.length > 0) {
+                data.dataList.forEach((i, index) => {
+                  deleteData.forEach(j => {
+                    if (i.id === j.id) {
+                      data.dataList[index] = j;
+                    }
+                  });
+                });
+              }
+            }
             _self.infoWindowData = data.dataList;
-            _self.$refs.docGeneratorGrid.setPagination(data.totalSize, Math.ceil(data.totalSize / data.range.length));
+            _self.$refs.docGeneratorGrid.setPagination(
+              data.totalSize,
+              Math.ceil(data.totalSize / data.range.length),
+            );
           }
         },
         error: function (XMLHttpRequest, textStatus, errorThrown) {
-          _self.loading=false;
+          _self.loading = false;
           Common.processException(XMLHttpRequest, textStatus, errorThrown);
         },
       });
     },
-
+    openComplex: function (value) {
+      this.isComplex = value;
+    },
     /**
-         * 复杂数据查询
-         * @author YangZhiJie 20210909
-         */
-    queryInfoWindowDataComplex: function () {
+     * 复杂数据查询
+     * @author YangZhiJie 20210909
+     */
+    queryInfoWindowDataComplex: function (isDelete, deleteData) {
       var _self = this;
 
       var infoQueryParam = this.$refs.docGeneratorGrid.getQueryParam();
-      infoQueryParam.infoFilterFieldValues = _self.$refs.queryCondition.getQueryCondition();
-
-      _self.loading=true;
+      infoQueryParam.infoFilterFieldValues =
+        _self.$refs.queryCondition.getQueryCondition();
+      infoQueryParam.addSql = _self.addSql;
+      _self.loading = true;
       $.ajax({
         url: Common.getApiURL('InfoWindowResource/queryInfoWindowDataComplex'),
         type: 'post',
@@ -254,43 +327,56 @@ export default {
         contentType: 'application/json',
         data: JSON.stringify(infoQueryParam),
         success: function (data) {
-          _self.loading=false;
-          console.log(data);
+          _self.loading = false;
           if (data != undefined && data.range != undefined) {
+            if (isDelete === true) {
+              if (deleteData && deleteData.length > 0) {
+                data.dataList.forEach((i, index) => {
+                  deleteData.forEach(j => {
+                    if (i.id === j.id) {
+                      data.dataList[index] = j;
+                    }
+                  });
+                });
+              }
+            }
             _self.infoWindowData = data.dataList;
-            _self.$refs.docGeneratorGrid.setPagination(data.totalSize, Math.ceil(data.totalSize / data.range.length));
+            _self.$refs.docGeneratorGrid.setPagination(
+              data.totalSize,
+              Math.ceil(data.totalSize / data.range.length),
+            );
           }
         },
         error: function (XMLHttpRequest, textStatus, errorThrown) {
-          _self.loading=false;
+          _self.loading = false;
           Common.processException(XMLHttpRequest, textStatus, errorThrown);
         },
       });
     },
 
     /**
-         * 选择的内容发生了改变
-         * @author YangZhiJie 20210909
-         */
-    selectChanged: function(selectDatas){
+     * 选择的内容发生了改变
+     * @author YangZhiJie 20210909
+     */
+    selectChanged: function (selectDatas) {
       this.$refs.docGeneratorSelected.parseDataList(selectDatas);
     },
 
     /**
-         * 根据id判断数据是否被选中
-         * 供外部接口调用
-         * @author YangZhiJie 20210909
-         */
-    isSelectedById: function(id){
+     * 根据id判断数据是否被选中
+     * 供外部接口调用
+     * @author YangZhiJie 20210909
+     */
+    isSelectedById: function (id) {
       return this.$refs.docGeneratorSelected.isSelectedById(id);
     },
 
     /**
-         * 获取选中的数据
-         * 供外部接口调用
-         * @author YangZhiJie 20210909
-         */
-    getSelectedData: function(){
+     * 获取选中的数据
+     * 供外部接口调用
+     * @author YangZhiJie 20210909
+     */
+    getSelectedData: function () {
       return this.$refs.docGeneratorSelected.getSelectedData();
     },
   },
@@ -298,30 +384,32 @@ export default {
 </script>
 <style scoped>
 .grid-container-2 {
-    display: grid;
-    grid-template-columns: 100%;
-    grid-template-rows: min-content auto;
-    width: 100%;
-    height: calc(100% - 10px);
+  display: grid;
+  grid-template-columns: 100%;
+  grid-template-rows: min-content auto;
+  width: 100%;
+  height: calc(100% - 100px);
 }
 
 .grid-header-2 {
-    grid-row: 1 / 2;
-    grid-column: 1 / 2;
+  grid-row: 1 / 2;
+  grid-column: 1 / 2;
 }
 
 .grid-content-2 {
-    grid-row: 2 / 3;
-    grid-column: 1 / 2;
-    overflow: auto;
+  grid-row: 2 / 3;
+  grid-column: 1 / 2;
+  overflow: auto;
 }
 </style>
 
 <style scoped>
-
 /** 修复分页的样式 By YangZhiJie 2021-07-06 11:23 */
 nav >>> ul.pagination {
-    margin: 0 !important;
+  margin: 0 !important;
 }
 
+.nav {
+  margin-bottom: 4px;
+}
 </style>

+ 162 - 143
packages/info/src/DocGeneratorGrid.vue

@@ -8,10 +8,7 @@
       >
         <thead>
           <tr height="40px">
-            <th
-              width="50px"
-              class="fixed-cell"
-            >
+            <th width="50px" class="fixed-cell">
               <input
                 autocomplete="off"
                 :checked="allSelected"
@@ -44,11 +41,7 @@
           </tr>
         </thead>
         <tbody>
-          <tr
-            v-for="rowData in dataList"
-            :key="rowData.id"
-            height="40px"
-          >
+          <tr v-for="rowData in dataList" :key="rowData.id" height="40px">
             <td class="fixed-cell">
               <input
                 v-model="rowData.checked"
@@ -74,11 +67,21 @@
                 autocomplete="off"
                 type="number"
                 class="form-control"
-                :value="getDisplayValue(rowData,infoGridField)"
+                :value="getDisplayValue(rowData, infoGridField)"
                 @keyup="valueChange($event, rowData, infoGridField)"
               />
-              <span v-if="infoGridField.simpleDisplayType == null || infoGridField.simpleDisplayType == '' || infoGridField.simpleDisplayType == 'NONE'">
-                {{ rowData.data[infoGridField.fieldName] == undefined ? "" : rowData.data[infoGridField.fieldName].displayValue[0] }}
+              <span
+                v-if="
+                  infoGridField.simpleDisplayType == null ||
+                    infoGridField.simpleDisplayType == '' ||
+                    infoGridField.simpleDisplayType == 'NONE'
+                "
+              >
+                {{
+                  rowData.data[infoGridField.fieldName] == undefined
+                    ? ""
+                    : rowData.data[infoGridField.fieldName].displayValue[0]
+                }}
               </span>
             </td>
           </tr>
@@ -86,16 +89,13 @@
       </table>
     </div>
 
-    <div
-      class="flex-footer-1"
-      style="margin-top: 10px;"
-    >
+    <div class="flex-footer-1" style="margin-top: 10px">
       <div class="pull-left">
         <span>
-          {{ (pagination.current_page-1)*pagination.per_page+1 }}
+          {{ (pagination.current_page - 1) * pagination.per_page + 1 }}
           -
-          {{ pagination.current_page*pagination.per_page }}
+          {{ pagination.current_page * pagination.per_page }}
           条,共计
           {{ pagination.total }}
           条,每页
@@ -105,10 +105,7 @@
         <span>条</span>
       </div>
       <div class="pull-right">
-        <Pagination
-          :pagination="pagination"
-          :callback="refreshSearch"
-        />
+        <Pagination :pagination="pagination" :callback="refreshSearch" />
       </div>
     </div>
   </div>
@@ -121,16 +118,14 @@ import Pagination from '../../vue-bootstrap-pagination/src/vue-bootstrap-paginat
 import PageSizeSelect from '../../page-size-select/src/PageSizeSelect.vue';
 
 export default {
-
   components: {
     Pagination,
     PageSizeSelect,
   },
 
-  
   props: {
     // 查询窗口编号
-    infoWindowNo : {
+    infoWindowNo: {
       type: String,
       default: null,
     },
@@ -158,9 +153,9 @@ export default {
       dataList: [],
       pagination: {
         total: 0,
-        per_page: Common.pageSize,    // required
+        per_page: Common.pageSize, // required
         current_page: 1, // required
-        last_page: 10,    // required
+        last_page: 10, // required
       },
       sortStyle: '',
       sortClause: '',
@@ -169,16 +164,18 @@ export default {
 
   computed: {
     /**
-         * 自动计算表格的宽度
-         * @author YangZhiJie 20210909
-         */
+     * 自动计算表格的宽度
+     * @author YangZhiJie 20210909
+     */
     tableWidth: function () {
       var totalWidth = 50;
       if (this.infoGridFields !== undefined) {
         this.infoGridFields.forEach(function (infoGridField) {
-          if (infoGridField.width !== undefined
-                        && infoGridField.width !== null
-                        && infoGridField.width !== '') {
+          if (
+            infoGridField.width !== undefined &&
+            infoGridField.width !== null &&
+            infoGridField.width !== ''
+          ) {
             totalWidth += Number(infoGridField.width);
           }
         });
@@ -187,16 +184,24 @@ export default {
     },
 
     /**
-         * 是否选择了全部的数据
-         * @author YangZhiJie 20210909
-         */
+     * 是否选择了全部的数据
+     * @author YangZhiJie 20210909
+     */
     allSelected: function () {
       var _self = this;
-      if (this.dataList === undefined || this.dataList === null || this.dataList.length == 0) {
+      if (
+        this.dataList === undefined ||
+        this.dataList === null ||
+        this.dataList.length == 0
+      ) {
         return false;
       }
 
-      for (let index = 0, length = this.dataList.length; index < length; index++) {
+      for (
+        let index = 0, length = this.dataList.length;
+        index < length;
+        index++
+      ) {
         if (this.dataList[index].checked === false) {
           return false;
         }
@@ -207,21 +212,22 @@ export default {
   },
 
   watch: {
-
     infoWindowData: function (newValue, oldValue) {
       this.setDataList(newValue);
     },
 
     dataList: {
-      handler: function(newValue, oldValue){
+      handler: function (newValue, oldValue) {
         // 清除延迟执行
-        if(this.selectChangedTimeout !== undefined && this.selectChangedTimeout !== null){
+        if (
+          this.selectChangedTimeout !== undefined &&
+          this.selectChangedTimeout !== null
+        ) {
           window.clearTimeout(this.selectChangedTimeout);
         }
-    
+
         // 设置延迟执行
-        this.selectChangedTimeout = setTimeout(()=>{
-          console.log('selectChanged');
+        this.selectChangedTimeout = setTimeout(() => {
           this.$emit('selectChanged', this.dataList);
         }, 500);
       },
@@ -231,10 +237,10 @@ export default {
 
   methods: {
     /**
-         * 重新设置分页
-         * 供外部组件调用
-         * @author YangZhiJie 20210909
-         */
+     * 重新设置分页
+     * 供外部组件调用
+     * @author YangZhiJie 20210909
+     */
     resetPagination: function () {
       this.pagination.current_page = 1;
       this.pagination.last_page = 10;
@@ -242,19 +248,19 @@ export default {
     },
 
     /**
-         * 设置分页
-         * @author YangZhiJie 20210909
-         */
+     * 设置分页
+     * @author YangZhiJie 20210909
+     */
     setPagination: function (total, lastPage) {
       this.pagination.last_page = lastPage;
       this.pagination.total = total;
     },
 
     /**
-         * 获取查询参数
-         * 供外部组件调用
-         * @author YangZhiJie 20210909
-         */
+     * 获取查询参数
+     * 供外部组件调用
+     * @author YangZhiJie 20210909
+     */
     getQueryParam: function () {
       return {
         infoWindowNo: this.infoWindowNo,
@@ -265,18 +271,18 @@ export default {
     },
 
     /**
-         * 页码数量改变
-         * @author YangZhiJie 20210909
-         */
+     * 页码数量改变
+     * @author YangZhiJie 20210909
+     */
     gridSizeSelect: function (newPageSize) {
       this.pagination.per_page = newPageSize;
       this.pagination.current_page = 1;
     },
 
     /**
-         * 列开始拖动
-         * @author YangZhiJie 20210909
-         */
+     * 列开始拖动
+     * @author YangZhiJie 20210909
+     */
     ondragstart: function (event, gridFieldItem) {
       var _self = this;
       _self.startX = event.pageX;
@@ -286,19 +292,18 @@ export default {
     },
 
     /**
-         * 列拖动
-         * @author YangZhiJie 20210909
-         */
+     * 列拖动
+     * @author YangZhiJie 20210909
+     */
     ondrag: function (event, gridFieldItem) {
       var _self = this;
       gridFieldItem.width = _self.startWidth + (event.pageX - _self.startX);
     },
 
-
     /**
-         * 列结束拖动
-         * @author YangZhiJie 20210909
-         */
+     * 列结束拖动
+     * @author YangZhiJie 20210909
+     */
     ondragend: function (event, gridFieldItem, index) {
       var _self = this;
 
@@ -310,7 +315,6 @@ export default {
 
       //gridFieldItem.width = gridFieldItemClone.width;
       InfoUtil.saveInfoGridFields(_self.infoWindowDto.no, _self.infoGridFields);
-            
     },
 
     ondragover: function (event, gridFieldItem) {
@@ -319,13 +323,16 @@ export default {
     },
 
     /**
-         * 排序
-         * @author YangZhiJie 20210909
-         */
+     * 排序
+     * @author YangZhiJie 20210909
+     */
     onSort: function (infoGridField) {
       var _self = this;
       var fieldName = null;
-      if (infoGridField.sortFieldName != undefined && infoGridField.sortFieldName != '') {
+      if (
+        infoGridField.sortFieldName != undefined &&
+        infoGridField.sortFieldName != ''
+      ) {
         fieldName = infoGridField.sortFieldName;
       } else {
         fieldName = infoGridField.fieldName;
@@ -334,21 +341,21 @@ export default {
 
       this.$emit('refreshSearch');
 
-      _self.sortStyle = ((_self.sortStyle === ' ASC') ? ' DESC' : ' ASC');
+      _self.sortStyle = _self.sortStyle === ' ASC' ? ' DESC' : ' ASC';
     },
 
     /**
-         * 发送查询请求
-         * @author YangZhiJie 20210909
-         */
-    refreshSearch: function(){
+     * 发送查询请求
+     * @author YangZhiJie 20210909
+     */
+    refreshSearch: function () {
       this.$emit('refreshSearch');
     },
 
     /**
-         * 冻结表头
-         * @author YangZhiJie 20210909
-         */
+     * 冻结表头
+     * @author YangZhiJie 20210909
+     */
     fixedTableHeader: function () {
       let _self = this;
       _self.$nextTick(function () {
@@ -361,11 +368,10 @@ export default {
       });
     },
 
-
     /**
-         * 表格中填写的值发生了改变
-         * @author YangZhiJie 20210909
-         */
+     * 表格中填写的值发生了改变
+     * @author YangZhiJie 20210909
+     */
     valueChange: function (event, rowData, infoGridField) {
       var _self = this;
       var value = event.target.value;
@@ -374,17 +380,17 @@ export default {
         var tempFieldValue = {
           displayValue: [value],
         };
-        rowData.data[fieldName]=tempFieldValue;
+        rowData.data[fieldName] = tempFieldValue;
       } else {
-        rowData.data[fieldName].displayValue[0]=value;
+        rowData.data[fieldName].displayValue[0] = value;
       }
       rowData.checked = true;
     },
 
     /**
-         * 获取显示的值
-         * @author YangZhiJie 20210909
-         */
+     * 获取显示的值
+     * @author YangZhiJie 20210909
+     */
     getDisplayValue(rowData, infoGridField) {
       let fieldValue = rowData.data[infoGridField.fieldName];
       if (fieldValue === undefined || fieldValue === null) {
@@ -394,27 +400,34 @@ export default {
       }
     },
 
-
     /**
-         * 选择所有/取消选择的数据
-         * @author YangZhiJie 20210909
-         */
+     * 选择所有/取消选择的数据
+     * @author YangZhiJie 20210909
+     */
     selectAll: function (event) {
       var isChecked = event.currentTarget.checked;
 
-      if (this.dataList === undefined || this.dataList === null || this.dataList.length == 0) {
+      if (
+        this.dataList === undefined ||
+        this.dataList === null ||
+        this.dataList.length == 0
+      ) {
         return;
       }
 
-      for (let index = 0, length = this.dataList.length; index < length; index++) {
+      for (
+        let index = 0, length = this.dataList.length;
+        index < length;
+        index++
+      ) {
         this.dataList[index].checked = isChecked;
       }
     },
 
     /**
-         * 设置dataList数据
-         * @author YangZhiJie 20210908
-         */
+     * 设置dataList数据
+     * @author YangZhiJie 20210908
+     */
     setDataList: function (dataList) {
       let _self = this;
       if (dataList === null || dataList === undefined) {
@@ -428,17 +441,23 @@ export default {
       }
 
       const tempDataList = JSON.parse(JSON.stringify(dataList));
-      for (let index = 0, length = tempDataList.length; index < length; index++) {
-        if(this.isSelectedById != null){
-          tempDataList[index].checked = this.isSelectedById(tempDataList[index].id);
-        }else{
+      for (
+        let index = 0, length = tempDataList.length;
+        index < length;
+        index++
+      ) {
+        if (this.isSelectedById != null) {
+          tempDataList[index].checked = this.isSelectedById(
+            tempDataList[index].id,
+          );
+        } else {
           tempDataList[index].checked = false;
         }
       }
 
       this.dataList = tempDataList;
 
-      this.$nextTick(function(){
+      this.$nextTick(function () {
         _self.fixedTableHeader();
       });
     },
@@ -448,76 +467,76 @@ export default {
 
 <style scoped>
 .flex-container-1 {
-    display: flex;
-    flex-direction: column;
-    width: 100%;
-    height: calc(100% - 10px);
+  display: flex;
+  flex-direction: column;
+  width: 100%;
+  height: calc(100% - 10px);
 }
 
 .flex-content-1 {
-    flex: 1;
-    overflow: auto;
-    width: 100%;
-    margin-top: 5px;
+  flex: 1;
+  overflow: auto;
+  width: 100%;
+  margin-top: 5px;
 }
 
 .flex-footer-1 {
-    height: 35px;
-    /*放大缩小比例为0 */
-    flex: 0 0 35px;
+  height: 35px;
+  /*放大缩小比例为0 */
+  flex: 0 0 35px;
 }
 </style>
 
 
 <style scoped>
 .fixed-table {
-    table-layout: fixed;
+  table-layout: fixed;
 }
 
 table.fixed-table th {
-    position: relative;
-    min-width: 10px;
+  position: relative;
+  min-width: 10px;
 }
 
 table.fixed-table tr td:first-child,
 table.fixed-table tr th:first-child {
-    text-align: center;
+  text-align: center;
 }
 
 table.fixed-table th,
 table.fixed-table td {
-    text-align: left;
-    overflow: hidden;
-    white-space: nowrap;
-    text-overflow: ellipsis;
-    padding: 0.1em;
-    border-right: 1px solid rgba(0, 0, 0, 0.05);
-    background-color: white;
+  text-align: left;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  padding: 0.1em;
+  border-right: 1px solid rgba(0, 0, 0, 0.05);
+  background-color: white;
 }
 
 table.fixed-table th .rz-handle {
-    width: 10px;
-    height: 100%;
-    position: absolute;
-    top: 0;
-    right: 0;
-    background: repeating-linear-gradient(
-        45deg,
-        transparent,
-        transparent 2px,
-        rgba(0, 0, 0, 0.05) 2px,
-        rgba(0, 0, 0, 0.05) 4px
-    );
-    cursor: ew-resize !important;
+  width: 10px;
+  height: 100%;
+  position: absolute;
+  top: 0;
+  right: 0;
+  background: repeating-linear-gradient(
+    45deg,
+    transparent,
+    transparent 2px,
+    rgba(0, 0, 0, 0.05) 2px,
+    rgba(0, 0, 0, 0.05) 4px
+  );
+  cursor: ew-resize !important;
 }
 
 table.fixed-table th .rz-handle.rz-handle-active {
-    border-right: 2px solid #000;
-    transform: scaleX(100);
-    background: rgba(0, 0, 0, 0.05) 2px;
+  border-right: 2px solid #000;
+  transform: scaleX(100);
+  background: rgba(0, 0, 0, 0.05) 2px;
 }
 
 .rz-handle:hover {
-    background: rgba(0, 0, 0, 0.2) 4px;
+  background: rgba(0, 0, 0, 0.2) 4px;
 }
 </style>

+ 142 - 144
packages/info/src/DocGeneratorSelected.vue

@@ -8,19 +8,9 @@
       >
         <thead>
           <tr height="40px">
-            <th
-              width="50px"
-              class="fixed-cell"
-            >
-              序号
-            </th>
+            <th width="50px" class="fixed-cell">序号</th>
 
-            <th
-              width="50px"
-              class="fixed-cell"
-            >
-              操作
-            </th>
+            <th width="50px" class="fixed-cell">操作</th>
 
             <th
               v-for="infoGridField in infoGridFields"
@@ -56,7 +46,7 @@
             <td class="fixed-cell">
               <span
                 class="label label-danger"
-                style="cursor: pointer;"
+                style="cursor: pointer"
                 @click="removeRow(rowData)"
               >删除</span>
             </td>
@@ -77,11 +67,15 @@
                 autocomplete="off"
                 type="number"
                 class="form-control"
-                :value="getDisplayValue(rowData,infoGridField)"
+                :value="getDisplayValue(rowData, infoGridField)"
                 @keyup="valueChange($event, rowData, infoGridField)"
               />
               <span v-if="infoGridField.simpleDisplayType == undefined">
-                {{ rowData.data[infoGridField.fieldName]==undefined?"":rowData.data[infoGridField.fieldName].displayValue[0] }}
+                {{
+                  rowData.data[infoGridField.fieldName] == undefined
+                    ? ""
+                    : rowData.data[infoGridField.fieldName].displayValue[0]
+                }}
               </span>
             </td>
           </tr>
@@ -89,14 +83,9 @@
       </table>
     </div>
 
-    <div
-      class="flex-footer-2"
-      style="margin-top: 10px;"
-    >
+    <div class="flex-footer-2" style="margin-top: 10px">
       <div class="pull-left">
-        <span>
-          共计 {{ dataList.length }} 条
-        </span>
+        <span> 共计 {{ dataList.length }} 条 </span>
       </div>
     </div>
   </div>
@@ -108,23 +97,21 @@ import Notify from '../../common/Notify.js';
 import InfoUtil from './InfoUtil.js';
 
 export default {
-
-  components: {
-  },
+  components: {},
   props: {
     // 查询窗口编号
-    'infoWindowNo': {
+    infoWindowNo: {
       type: String,
       default: null,
-    }, 
+    },
     // 表格字段
-    'infoGridFields': {
+    infoGridFields: {
       type: Object,
       default: null,
     },
   },
 
-  emits: ['selectChanged'],
+  emits: ['selectChanged', 'updateDatas'],
 
   data: function () {
     return {
@@ -133,18 +120,20 @@ export default {
       sortClause: '',
     };
   },
-  
+
   computed: {
     /**
-         * 自动计算表格的宽度
-         */
+     * 自动计算表格的宽度
+     */
     tableWidth: function () {
       var totalWidth = 50;
       if (this.infoGridFields !== undefined) {
         this.infoGridFields.forEach(function (infoGridField) {
-          if (infoGridField.width !== undefined
-                        && infoGridField.width !== null
-                        && infoGridField.width !== '') {
+          if (
+            infoGridField.width !== undefined &&
+            infoGridField.width !== null &&
+            infoGridField.width !== ''
+          ) {
             totalWidth += Number(infoGridField.width);
           }
         });
@@ -154,11 +143,10 @@ export default {
   },
 
   methods: {
-
     /**
-         * 列开始拖动
-         * @author YangZhiJie 20210909
-         */
+     * 列开始拖动
+     * @author YangZhiJie 20210909
+     */
     ondragstart: function (event, gridFieldItem) {
       var _self = this;
       _self.startX = event.pageX;
@@ -166,29 +154,30 @@ export default {
     },
 
     /**
-         * 列拖动
-         * @author YangZhiJie 20210909
-         */
+     * 列拖动
+     * @author YangZhiJie 20210909
+     */
     ondrag: function (event, gridFieldItem) {
       var _self = this;
       gridFieldItem.width = _self.startWidth + (event.pageX - _self.startX);
     },
 
     /**
-         * 列结束拖动
-         * @author YangZhiJie 20210909
-         */
+     * 列结束拖动
+     * @author YangZhiJie 20210909
+     */
     ondragend: function (event, gridFieldItem, index) {
       var _self = this;
       var gridFieldItemClone = {
-        'id': gridFieldItem.id,
-        'index': index,
-        'isShow': gridFieldItem.isShow,
-        'width': gridFieldItem.width,
-        'sortNo': gridFieldItem.sortNo,
-        'fieldName': gridFieldItem.fieldName,
+        id: gridFieldItem.id,
+        index: index,
+        isShow: gridFieldItem.isShow,
+        width: gridFieldItem.width,
+        sortNo: gridFieldItem.sortNo,
+        fieldName: gridFieldItem.fieldName,
       };
-      gridFieldItemClone.width = _self.startWidth + (event.pageX - _self.startX);
+      gridFieldItemClone.width =
+        _self.startWidth + (event.pageX - _self.startX);
       if (gridFieldItemClone.width < 50) {
         gridFieldItemClone.width = 50;
       }
@@ -197,29 +186,30 @@ export default {
       InfoUtil.restoreInfoGridField(_self.infoWindowNo, _self.infoGridFields);
     },
 
-
     /**
-         * 排序
-         * @author YangZhiJie 20210909
-         */
+     * 排序
+     * @author YangZhiJie 20210909
+     */
     onSort: function (infoGridField) {
       var _self = this;
       var fieldName = null;
-      if (infoGridField.sortFieldName != undefined && infoGridField.sortFieldName != '') {
+      if (
+        infoGridField.sortFieldName != undefined &&
+        infoGridField.sortFieldName != ''
+      ) {
         fieldName = infoGridField.sortFieldName;
       } else {
         fieldName = infoGridField.fieldName;
       }
       _self.sortClause = fieldName + _self.sortStyle;
-      _self.sortStyle = ((_self.sortStyle === ' ASC') ? ' DESC' : ' ASC');
+      _self.sortStyle = _self.sortStyle === ' ASC' ? ' DESC' : ' ASC';
       console.warn('暂时不支持排序。');
     },
 
-
     /**
-         * 冻结表头
-         * @author YangZhiJie 20210909
-         */
+     * 冻结表头
+     * @author YangZhiJie 20210909
+     */
     fixedTableHeader: function () {
       let _self = this;
       _self.$nextTick(function () {
@@ -232,11 +222,10 @@ export default {
       });
     },
 
-
     /**
-         * 表格中填写的值发生了改变
-         * @author YangZhiJie 20210909
-         */
+     * 表格中填写的值发生了改变
+     * @author YangZhiJie 20210909
+     */
     valueChange: function (event, rowData, infoGridField) {
       var _self = this;
       var value = event.target.value;
@@ -250,12 +239,14 @@ export default {
         rowData.data[fieldName].displayValue[0] = value;
       }
       rowData.checked = true;
+      const dataList = JSON.parse(JSON.stringify(this.dataList));
+      this.$emit('updateDatas', dataList);
     },
 
     /**
-         * 获取显示的值
-         * @author YangZhiJie 20210909
-         */
+     * 获取显示的值
+     * @author YangZhiJie 20210909
+     */
     getDisplayValue(rowData, infoGridField) {
       let fieldValue = rowData.data[infoGridField.fieldName];
       if (fieldValue === undefined || fieldValue === null) {
@@ -265,11 +256,10 @@ export default {
       }
     },
 
-
     /**
-         * 设置dataList数据
-         * @author YangZhiJie 20210908
-         */
+     * 设置dataList数据
+     * @author YangZhiJie 20210908
+     */
     parseDataList: function (dataList) {
       let _self = this;
       if (dataList === null || dataList === undefined) {
@@ -282,49 +272,59 @@ export default {
       }
 
       const tempDataList = JSON.parse(JSON.stringify(dataList));
-      for (let index = 0, length = tempDataList.length; index < length; index++) {
+      for (
+        let index = 0, length = tempDataList.length;
+        index < length;
+        index++
+      ) {
         let tempData = tempDataList[index];
         let rowData = this.getRowDataById(tempData.id);
-        if(tempData.checked === true){
-          if(rowData === null){
-            this.dataList[this.dataList.length]=tempData;
+        if (tempData.checked === true) {
+          if (rowData === null) {
+            this.dataList[this.dataList.length] = tempData;
           } else {
             let dataListIndex = this.dataList.indexOf(rowData);
-            this.dataList[dataListIndex]=tempData;
+            this.dataList[dataListIndex] = tempData;
           }
-        } else if(tempData.checked === false){
-          if(rowData !== null){
+        } else if (tempData.checked === false) {
+          if (rowData !== null) {
             let dataListIndex = this.dataList.indexOf(rowData);
             this.dataList.splice(dataListIndex, 1);
           }
         }
       }
 
-      this.$nextTick(function(){
+      this.$nextTick(function () {
         _self.fixedTableHeader();
       });
     },
 
     /**
-         * 删除用户行
-         * @param rowData 行数据
-         * @author YangZhiJie 2021-09-08
-         */
-    removeRow: function(rowData){
+     * 删除用户行
+     * @param rowData 行数据
+     * @author YangZhiJie 2021-09-08
+     */
+    removeRow: function (rowData) {
       let index = this.dataList.indexOf(rowData);
-      if(index >= 0){
+      if (index >= 0) {
         this.dataList.splice(index, 1);
       }
-      this.$emit('selectChanged');
+      const deleteDatas = JSON.parse(JSON.stringify(this.dataList));
+      this.$emit('selectChanged', deleteDatas);
+      // this.$emit('selectChanged');
     },
 
     /**
-         * 根据id获取行数据
-         * @author YangZhiJie 20210909
-         */
-    getRowDataById: function(id){
-      for (let index = 0, length = this.dataList.length; index < length; index++) {
-        if(this.dataList[index].id === id){
+     * 根据id获取行数据
+     * @author YangZhiJie 20210909
+     */
+    getRowDataById: function (id) {
+      for (
+        let index = 0, length = this.dataList.length;
+        index < length;
+        index++
+      ) {
+        if (this.dataList[index].id === id) {
           return this.dataList[index];
         }
       }
@@ -332,99 +332,97 @@ export default {
     },
 
     /**
-         * 根据id判断数据是否被选中
-         * 供外部接口调用
-         * @author YangZhiJie 20210909
-         */
-    isSelectedById: function(id){
+     * 根据id判断数据是否被选中
+     * 供外部接口调用
+     * @author YangZhiJie 20210909
+     */
+    isSelectedById: function (id) {
       let rowData = this.getRowDataById(id);
       return rowData === null ? false : true;
     },
 
-
     /**
-         * 获取选中的数据
-         * 供外部接口调用
-         * @author YangZhiJie 20210909
-         */
-    getSelectedData: function(){
+     * 获取选中的数据
+     * 供外部接口调用
+     * @author YangZhiJie 20210909
+     */
+    getSelectedData: function () {
       return this.dataList;
     },
-
   },
 };
 </script>
 
 <style scoped>
 .flex-container-2 {
-    display: flex;
-    flex-direction: column;
-    width: 100%;
-    height: calc(100% - 10px);
+  display: flex;
+  flex-direction: column;
+  width: 100%;
+  height: calc(100% - 10px);
 }
 
 .flex-content-2 {
-    flex: 1;
-    overflow: auto;
-    width: 100%;
-    margin-top: 5px;
+  flex: 1;
+  overflow: auto;
+  width: 100%;
+  margin-top: 5px;
 }
 
 .flex-footer-2 {
-    height: 35px;
-    /*放大缩小比例为0 */
-    flex: 0 0 35px;
+  height: 35px;
+  /*放大缩小比例为0 */
+  flex: 0 0 35px;
 }
 </style>
 
 
 <style scoped>
 .fixed-table {
-    table-layout: fixed;
+  table-layout: fixed;
 }
 
-.fixed-cell{
-    text-align: center;
+.fixed-cell {
+  text-align: center;
 }
 
 table.fixed-table th {
-    position: relative;
-    min-width: 10px;
+  position: relative;
+  min-width: 10px;
 }
 
 table.fixed-table tr td:first-child,
 table.fixed-table tr th:first-child {
-    text-align: center;
+  text-align: center;
 }
 
 table.fixed-table th,
 table.fixed-table td {
-    text-align: left;
-    overflow: hidden;
-    white-space: nowrap;
-    text-overflow: ellipsis;
-    padding: 0.1em;
-    border-right: 1px solid rgba(0, 0, 0, 0.05);
-    background-color: white;
+  text-align: left;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  padding: 0.1em;
+  border-right: 1px solid rgba(0, 0, 0, 0.05);
+  background-color: white;
 }
 
 table.fixed-table th .rz-handle {
-    width: 10px;
-    height: 100%;
-    position: absolute;
-    top: 0;
-    right: 0;
-    background: repeating-linear-gradient(
-        45deg,
-        transparent,
-        transparent 2px,
-        rgba(0, 0, 0, 0.05) 2px,
-        rgba(0, 0, 0, 0.05) 4px
-    );
-    cursor: ew-resize !important;
+  width: 10px;
+  height: 100%;
+  position: absolute;
+  top: 0;
+  right: 0;
+  background: repeating-linear-gradient(
+    45deg,
+    transparent,
+    transparent 2px,
+    rgba(0, 0, 0, 0.05) 2px,
+    rgba(0, 0, 0, 0.05) 4px
+  );
+  cursor: ew-resize !important;
 }
 
 table.fixed-table th .rz-handle.rz-handle-active {
-    border-right: 1px dotted #000;
+  border-right: 1px dotted #000;
 }
 </style>

+ 5 - 0
packages/info/src/QueryCondition.vue

@@ -4,6 +4,7 @@
       <div>
         <div>
           <QueryConditionSimple
+            v-show="!isGenerator"
             ref="queryConditionSimple"
             :info-buttons="infoButtons"
             :is-search-widget="isSearchWidget"
@@ -72,6 +73,10 @@ export default {
         return {};
       },
     },
+    'isGenerator':{
+      type: Boolean,
+      default: false,
+    },
   },
     
 

+ 3 - 8
packages/info/src/QueryPage.vue

@@ -476,10 +476,7 @@ export default {
      */
     queryInfoWindowDataSimple: function () {
       var _self = this;
-      if (_self.$refs.loading) {
-        _self.loading = true;
-      }
-
+      _self.loading = true;
       _self.infoQueryParam.whereClauseSource = _self.whereClauseSource;
       $.ajax({
         url: Common.getApiURL('InfoWindowResource/queryInfoWindowDataSimple'),
@@ -505,9 +502,7 @@ export default {
 
         },
         error: function (XMLHttpRequest, textStatus, errorThrown) {
-          if (_self.$refs.loading) {
-            _self.loading = false;
-          }
+          _self.loading = false;
           Common.processException(XMLHttpRequest, textStatus, errorThrown);
         },
       });
@@ -766,7 +761,7 @@ export default {
      * 执行导出
      * @return {void}
      */
-    executeExport: function () {
+    executeExport: function (isSimple) {
       var _self = this;
 
       if (this.searchConditionInstance.state.isComplex == false) {

+ 4 - 1
packages/process/src/ProcessReportArchive.vue

@@ -150,7 +150,7 @@ export default {
         this.title = this.processReportResult.processReportName;
       }
 
-      var loginInfoJson = localStorage.getItem('json_LoginInfo');
+      var loginInfoJson = localStorage.getItem('#LoginInfo');
       var loginInfo = JSON.parse(loginInfoJson);
       if (loginInfo != null) {
         _self.userName = loginInfo.userName;
@@ -181,6 +181,8 @@ export default {
       var _self = this;
       var url = '';
       var reportNames = '';
+      const hash = location.hash;
+      const windowNo = hash.substring(34,49);
       var reportResults = this.processReportResult.reportResults;
       for (var i = 0; i < reportResults.length; i++) {
         var reportResult = reportResults[i];
@@ -204,6 +206,7 @@ export default {
           'description': _self.description,
           'url': url,
           'reportNames': reportNames,
+          'windowNo': windowNo,
         },
         beforeSend: function (request) {
           Common.addTokenToRequest(request);

+ 13 - 6
packages/process/src/ProcessReportResultPreview.vue

@@ -28,10 +28,10 @@
         Excel报表
       </a>
     </div>
-    <!-- <ProcessReportArchive
-      v-if="processReportResult.reportResults != undefined"
+    <ProcessReportArchive
+      v-if="processReportResult.reportResults != undefined && loginClientName == '浙江大华'"
       :process-report-result="processReportResult"
-    /> -->
+    />
 
     <template
       v-for="(reportResult, index) in processReportResult.reportResults"
@@ -169,13 +169,13 @@ import Common from '../../common/Common.js';
 import Uuid from '../../common/Uuid.js';
 import Notify from '../../common/Notify.js';
 import DownloadService from '../../common/DownloadService.js';
-// import ProcessReportArchive from './ProcessReportArchive.vue';
+import ProcessReportArchive from './ProcessReportArchive.vue';
 
 export default {
   name: 'ProcessReportResultPreview',
 
   components: {
-    // ProcessReportArchive,
+    ProcessReportArchive,
   },
 
   props: {
@@ -194,9 +194,9 @@ export default {
   data: function () {
     return {
       'uuid': Uuid.createUUID(),
+      loginClientName: '',
     };
   },
-
   computed: {
     // 是否文本区域显示流程结果
     isTextAreaShowProcessResult: function () {
@@ -219,6 +219,13 @@ export default {
     },
 
   },
+  mounted: function () {
+    const loginInfoJson = localStorage.getItem('#LoginInfo');
+    const loginInfo = JSON.parse(loginInfoJson);
+    if (loginInfo != null) {
+      this.loginClientName = loginInfo.loginClientName;
+    }
+  },
 
   methods: {
     /**