riku
2025-06-25 b187b6cf678f0e6b17e3612c5681ecd35434f15a
任务管理界面新增巡查单据下载功能
已修改5个文件
已删除1个文件
已添加1个文件
272 ■■■■ 文件已修改
package-lock.json 180 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/工地巡查单据模板.docx 补丁 | 查看 | 原始文档 | blame | 历史
public/餐饮巡查单据模板.doc 补丁 | 查看 | 原始文档 | blame | 历史
public/餐饮巡查单据模板.docx 补丁 | 查看 | 原始文档 | blame | 历史
src/components/FYImageSelectDialog.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/scene/SceneInspectFile.vue 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package-lock.json
@@ -15,6 +15,7 @@
        "@vueuse/core": "^9.7.0",
        "axios": "^1.2.1",
        "dayjs": "^1.11.13",
        "docx-preview": "^0.3.5",
        "docxtemplater": "^3.50.0",
        "docxtemplater-image-module": "^3.1.0",
        "docxtemplater-image-module-free": "^1.1.1",
@@ -32,6 +33,7 @@
        "vue": "^3.2.45",
        "vue-demi": "^0.14.6",
        "vue-i18n": "^9.8.0",
        "vue-print-nb": "^1.7.5",
        "vue-router": "^4.1.6",
        "xlsx": "^0.18.5"
      },
@@ -512,17 +514,17 @@
      }
    },
    "node_modules/@babel/helper-string-parser": {
      "version": "7.19.4",
      "dev": true,
      "license": "MIT",
      "version": "7.27.1",
      "resolved": "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz",
      "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==",
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helper-validator-identifier": {
      "version": "7.19.1",
      "dev": true,
      "license": "MIT",
      "version": "7.27.1",
      "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz",
      "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==",
      "engines": {
        "node": ">=6.9.0"
      }
@@ -640,8 +642,12 @@
      }
    },
    "node_modules/@babel/parser": {
      "version": "7.20.5",
      "license": "MIT",
      "version": "7.27.5",
      "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.27.5.tgz",
      "integrity": "sha512-OsQd175SxWkGlzbny8J3K8TnnDD0N3lrIUtB92xwyRpzaenGZhxDvxN/JgU00U3CDZNj9tPuDJ5H0WS4Nt3vKg==",
      "dependencies": {
        "@babel/types": "^7.27.3"
      },
      "bin": {
        "parser": "bin/babel-parser.js"
      },
@@ -1785,13 +1791,12 @@
      }
    },
    "node_modules/@babel/types": {
      "version": "7.20.5",
      "dev": true,
      "license": "MIT",
      "version": "7.27.6",
      "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.27.6.tgz",
      "integrity": "sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q==",
      "dependencies": {
        "@babel/helper-string-parser": "^7.19.4",
        "@babel/helper-validator-identifier": "^7.19.1",
        "to-fast-properties": "^2.0.0"
        "@babel/helper-string-parser": "^7.27.1",
        "@babel/helper-validator-identifier": "^7.27.1"
      },
      "engines": {
        "node": ">=6.9.0"
@@ -3948,6 +3953,14 @@
      },
      "engines": {
        "node": ">=6.0.0"
      }
    },
    "node_modules/docx-preview": {
      "version": "0.3.5",
      "resolved": "https://registry.npmmirror.com/docx-preview/-/docx-preview-0.3.5.tgz",
      "integrity": "sha512-nod1jG5PkvzDIiZAcgAY4gSFQzgmAAChcuZH4Hj9dj7oCzscY3Hn8NfbUv7X7Jk4xL1lfKO113JLDhWKOt6fYw==",
      "dependencies": {
        "jszip": ">=3.0.0"
      }
    },
    "node_modules/docxtemplater": {
@@ -7455,14 +7468,6 @@
        "node": ">=8.17.0"
      }
    },
    "node_modules/to-fast-properties": {
      "version": "2.0.0",
      "dev": true,
      "license": "MIT",
      "engines": {
        "node": ">=4"
      }
    },
    "node_modules/to-regex-range": {
      "version": "5.0.1",
      "dev": true,
@@ -8086,6 +8091,57 @@
      },
      "peerDependencies": {
        "vue": "^3.0.0"
      }
    },
    "node_modules/vue-print-nb": {
      "version": "1.7.5",
      "resolved": "https://registry.npmmirror.com/vue-print-nb/-/vue-print-nb-1.7.5.tgz",
      "integrity": "sha512-iNbNyUVRWz0Ha1UTiCKxMPtHLUDGgNI8e8xmD3xqm9RlXIUeX9bT7DgNAfY8vPzqyFRHqGjxLI1rycKH366ziQ==",
      "dependencies": {
        "vue": "^2.6.11"
      }
    },
    "node_modules/vue-print-nb/node_modules/@vue/compiler-sfc": {
      "version": "2.7.16",
      "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-2.7.16.tgz",
      "integrity": "sha512-KWhJ9k5nXuNtygPU7+t1rX6baZeqOYLEforUPjgNDBnLicfHCoi48H87Q8XyLZOrNNsmhuwKqtpDQWjEFe6Ekg==",
      "dependencies": {
        "@babel/parser": "^7.23.5",
        "postcss": "^8.4.14",
        "source-map": "^0.6.1"
      },
      "optionalDependencies": {
        "prettier": "^1.18.2 || ^2.0.0"
      }
    },
    "node_modules/vue-print-nb/node_modules/csstype": {
      "version": "3.1.3",
      "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.3.tgz",
      "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="
    },
    "node_modules/vue-print-nb/node_modules/prettier": {
      "version": "2.8.8",
      "resolved": "https://registry.npmmirror.com/prettier/-/prettier-2.8.8.tgz",
      "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
      "optional": true,
      "bin": {
        "prettier": "bin-prettier.js"
      },
      "engines": {
        "node": ">=10.13.0"
      },
      "funding": {
        "url": "https://github.com/prettier/prettier?sponsor=1"
      }
    },
    "node_modules/vue-print-nb/node_modules/vue": {
      "version": "2.7.16",
      "resolved": "https://registry.npmmirror.com/vue/-/vue-2.7.16.tgz",
      "integrity": "sha512-4gCtFXaAA3zYZdTp5s4Hl2sozuySsgz4jy1EnpBHNfpMa9dK1ZCG7viqBPCwXtmgc8nHqUsAu3G4gtmXkkY3Sw==",
      "deprecated": "Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details.",
      "dependencies": {
        "@vue/compiler-sfc": "2.7.16",
        "csstype": "^3.1.0"
      }
    },
    "node_modules/vue-router": {
@@ -8758,12 +8814,14 @@
      }
    },
    "@babel/helper-string-parser": {
      "version": "7.19.4",
      "dev": true
      "version": "7.27.1",
      "resolved": "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz",
      "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA=="
    },
    "@babel/helper-validator-identifier": {
      "version": "7.19.1",
      "dev": true
      "version": "7.27.1",
      "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz",
      "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow=="
    },
    "@babel/helper-validator-option": {
      "version": "7.18.6",
@@ -8842,7 +8900,12 @@
      }
    },
    "@babel/parser": {
      "version": "7.20.5"
      "version": "7.27.5",
      "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.27.5.tgz",
      "integrity": "sha512-OsQd175SxWkGlzbny8J3K8TnnDD0N3lrIUtB92xwyRpzaenGZhxDvxN/JgU00U3CDZNj9tPuDJ5H0WS4Nt3vKg==",
      "requires": {
        "@babel/types": "^7.27.3"
      }
    },
    "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": {
      "version": "7.18.6",
@@ -9515,12 +9578,12 @@
      }
    },
    "@babel/types": {
      "version": "7.20.5",
      "dev": true,
      "version": "7.27.6",
      "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.27.6.tgz",
      "integrity": "sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q==",
      "requires": {
        "@babel/helper-string-parser": "^7.19.4",
        "@babel/helper-validator-identifier": "^7.19.1",
        "to-fast-properties": "^2.0.0"
        "@babel/helper-string-parser": "^7.27.1",
        "@babel/helper-validator-identifier": "^7.27.1"
      }
    },
    "@colors/colors": {
@@ -10998,6 +11061,14 @@
      "dev": true,
      "requires": {
        "esutils": "^2.0.2"
      }
    },
    "docx-preview": {
      "version": "0.3.5",
      "resolved": "https://registry.npmmirror.com/docx-preview/-/docx-preview-0.3.5.tgz",
      "integrity": "sha512-nod1jG5PkvzDIiZAcgAY4gSFQzgmAAChcuZH4Hj9dj7oCzscY3Hn8NfbUv7X7Jk4xL1lfKO113JLDhWKOt6fYw==",
      "requires": {
        "jszip": ">=3.0.0"
      }
    },
    "docxtemplater": {
@@ -13309,10 +13380,6 @@
        "rimraf": "^3.0.0"
      }
    },
    "to-fast-properties": {
      "version": "2.0.0",
      "dev": true
    },
    "to-regex-range": {
      "version": "5.0.1",
      "dev": true,
@@ -13669,6 +13736,47 @@
        "@vue/devtools-api": "^6.5.0"
      }
    },
    "vue-print-nb": {
      "version": "1.7.5",
      "resolved": "https://registry.npmmirror.com/vue-print-nb/-/vue-print-nb-1.7.5.tgz",
      "integrity": "sha512-iNbNyUVRWz0Ha1UTiCKxMPtHLUDGgNI8e8xmD3xqm9RlXIUeX9bT7DgNAfY8vPzqyFRHqGjxLI1rycKH366ziQ==",
      "requires": {
        "vue": "^2.6.11"
      },
      "dependencies": {
        "@vue/compiler-sfc": {
          "version": "2.7.16",
          "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-2.7.16.tgz",
          "integrity": "sha512-KWhJ9k5nXuNtygPU7+t1rX6baZeqOYLEforUPjgNDBnLicfHCoi48H87Q8XyLZOrNNsmhuwKqtpDQWjEFe6Ekg==",
          "requires": {
            "@babel/parser": "^7.23.5",
            "postcss": "^8.4.14",
            "prettier": "^1.18.2 || ^2.0.0",
            "source-map": "^0.6.1"
          }
        },
        "csstype": {
          "version": "3.1.3",
          "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.3.tgz",
          "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="
        },
        "prettier": {
          "version": "2.8.8",
          "resolved": "https://registry.npmmirror.com/prettier/-/prettier-2.8.8.tgz",
          "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
          "optional": true
        },
        "vue": {
          "version": "2.7.16",
          "resolved": "https://registry.npmmirror.com/vue/-/vue-2.7.16.tgz",
          "integrity": "sha512-4gCtFXaAA3zYZdTp5s4Hl2sozuySsgz4jy1EnpBHNfpMa9dK1ZCG7viqBPCwXtmgc8nHqUsAu3G4gtmXkkY3Sw==",
          "requires": {
            "@vue/compiler-sfc": "2.7.16",
            "csstype": "^3.1.0"
          }
        }
      }
    },
    "vue-router": {
      "version": "4.1.6",
      "requires": {
package.json
@@ -20,6 +20,7 @@
    "@vueuse/core": "^9.7.0",
    "axios": "^1.2.1",
    "dayjs": "^1.11.13",
    "docx-preview": "^0.3.5",
    "docxtemplater": "^3.50.0",
    "docxtemplater-image-module": "^3.1.0",
    "docxtemplater-image-module-free": "^1.1.1",
@@ -37,6 +38,7 @@
    "vue": "^3.2.45",
    "vue-demi": "^0.14.6",
    "vue-i18n": "^9.8.0",
    "vue-print-nb": "^1.7.5",
    "vue-router": "^4.1.6",
    "xlsx": "^0.18.5"
  },
public/¹¤µØÑ²²éµ¥¾ÝÄ£°å.docx
Binary files differ
public/²ÍÒûѲ²éµ¥¾ÝÄ£°å.doc
Binary files differ
public/²ÍÒûѲ²éµ¥¾ÝÄ£°å.docx
Binary files differ
src/components/FYImageSelectDialog.vue
@@ -9,9 +9,18 @@
    :close-on-press-escape="false"
  >
    <el-row justify="end">
      <el-text v-if="onContextMenu != undefined" size="small" type="info">{{
        `(${contextMenuStr})`
      }}</el-text>
      <el-space v-if="onContextMenu != undefined">
        <el-switch
          v-model="useContextMenu"
          inline-prompt
          active-text="开"
          inactive-text="关"
        />
        <el-text size="small" type="info">
          {{ `(${contextMenuStr})` }}
        </el-text>
      </el-space>
      <div v-if="!readonly">
        <el-text size="small" type="info" class="m-r-8"
          >最多选择{{ maxSelect }}张图片</el-text
@@ -104,7 +113,7 @@
  },
  contextMenuStr: {
    type: String,
    default: '右键点击图片触发额外操作'
    default: '右键点击图片移动'
  }
});
@@ -113,6 +122,8 @@
const activeId = ref('');
const selectedImgUrlList = ref([]);
const useContextMenu = ref(false);
let loadedImgCount = ref(0);
// åŠ è½½çŠ¶æ€
@@ -186,9 +197,9 @@
  emit('update:dialogVisible', false);
}
// å›¾ç‰‡å³é”®ç‚¹å‡»æ—¶é—´
// å›¾ç‰‡å³é”®ç‚¹å‡»äº‹ä»¶
function showContextMenu(event, index) {
  if (props.onContextMenu) {
  if (props.onContextMenu && useContextMenu.value) {
    event.preventDefault();
    props.onContextMenu(event, activeId.value, index);
  }
src/views/fysp/scene/SceneInspectFile.vue
@@ -53,9 +53,9 @@
        <el-button type="primary" :loading="docLoading" @click="handelDownload">
          ä¸‹è½½
        </el-button>
        <el-button type="default" :loading="docLoading" @click="handelPrint">
        <!-- <el-button type="default" :loading="docLoading" @click="handelPrint">
          æ‰“印
        </el-button>
        </el-button> -->
      </div>
    </template>
  </el-dialog>
@@ -124,6 +124,20 @@
  emits('update:modelValue', value);
}
function setParam(value, length) {
  const _value = value ? value : '';
  const offset = length - _value.length;
  if (offset > 0) {
    let str = _value;
    for (let i = 0; i < offset; i++) {
      str += ' ';
    }
    return str;
  } else {
    return _value;
  }
}
// æ ¼å¼åŒ–场景信息,生成参数结构
function parseParam() {
  const selected = sceneInfoList.value.filter((v, i) => {
@@ -137,16 +151,19 @@
          type: v.scense.typeid,
          params: {
            district: v.scense.districtname,
            name: v.scense.name,
            employerUnit: v.scense.csEmployerUnit,
            constructionUnit: v.subScene.csConstructionUnit,
            timeRange: v.subScene.csStartTime
            name: setParam(v.scense.name, 57),
            employerUnit: setParam(v.scense.csEmployerUnit, 30),
            constructionUnit: setParam(v.subScene.csConstructionUnit, 36),
            timeRange: setParam(
              v.subScene.csStartTime
              ? `${v.subScene.csStartTime}至${v.subScene.csEndTime}`
              : undefined,
            stage: v.subScene.siExtension1,
            contacts: v.subScene.csConstructionContacts,
            contactsTel: v.subScene.csConstructionContactsTel,
            location: v.scense.location
                : '',
              26
            ),
            stage: setParam(v.subScene.siExtension1, 36),
            contacts: setParam(v.scense.contacts, 27),
            contactsTel: setParam(v.scense.contactst, 40),
            location: setParam(v.scense.location, 27)
          }
        };
      // é¤é¥®
@@ -155,10 +172,10 @@
          type: v.scense.typeid,
          params: {
            district: v.scense.districtname,
            location: v.scense.location,
            name: v.scense.name,
            contacts: v.scense.contacts,
            contactsTel: v.scense.contactst
            location: setParam(v.scense.location, 63),
            name: setParam(v.scense.name, 64),
            contacts: setParam(v.scense.contacts, 67),
            contactsTel: setParam(v.scense.contactst, 62)
          }
        };
      // default:
@@ -167,15 +184,15 @@
    }
  });
  param.forEach((p) => {
    for (const key in p.params) {
      let value = p.params[key];
      if (value == undefined) {
        // è‹¥å±žæ€§ç¼ºå¤±ï¼Œåˆ™æ”¹ä¸º20个空格符,对应word中10个中文字符的长度
        p.params[key] = '                    ';
      }
    }
  });
  // param.forEach((p) => {
  //   for (const key in p.params) {
  //     let value = p.params[key];
  //     if (value == undefined) {
  //       // è‹¥å±žæ€§ç¼ºå¤±ï¼Œåˆ™æ”¹ä¸º20个空格符,对应word中10个中文字符的长度
  //       p.params[key] = '                    ';
  //     }
  //   }
  // });
  return param;
}
@@ -192,6 +209,8 @@
        break;
      // é¤é¥®
      case 5:
        template = '/餐饮巡查单据模板.docx';
        _param = p.params;
        break;
      default:
        break;