无人机管理后台前端(已迁走)
chenyao
2025-09-30 4809afba10333e1e911c795d28b8c68fb364d593
src/views/tickets/orderLog.vue
@@ -183,6 +183,9 @@
              <el-button type="success" plain icon="el-icon-download" @click="exportData"
                >导出</el-button
              >
              <el-button type="primary" plain icon="el-icon-plus" @click="moreAdd"
              >批量添加</el-button
              >
            </template>
            <template #menu="{ row }">
@@ -806,6 +809,69 @@
        </el-row>
      </el-form>
    </el-dialog>
    <el-dialog class="ztzf-dialog" append-to-body v-model="moreAddVisible" title="批量添加" :width="pxToRem(1200)" :close-on-click-modal="false" :destroy-on-close="true">
      <el-button type="primary" plain icon="el-icon-plus" @click="addMoreData" style="margin-bottom: 10px;"></el-button>
      <el-table border :data="moreDataList" height="400">
        <el-table-column label="序号" type="index" width="60"></el-table-column>
        <el-table-column prop="name" label="工单名称" align="center">
          <template #default="scope">
            <el-input v-model="scope.row.name"></el-input>
          </template>
        </el-table-column>
        <el-table-column prop="end_time" label="选择航线" align="center">
          <template #default="scope">
            <el-select
              v-model="scope.row.file_id"
              placeholder="请选择航线"
              filterable
              @change="getFlyingNestBy"
            >
              <el-option
                v-for="item in wayLineList"
                :key="item.wayline_id"
                :label="item.name"
                :value="item.wayline_id"
              />
            </el-select>
          </template>
        </el-table-column>
        <el-table-column prop="end_time" label="选择机巢" align="center">
          <template #default="scope">
            <el-select
              v-model="scope.row.device_sns"
              placeholder="请选择机巢"
            >
              <el-option label="赣县-夏谭机场" value="赣县-夏谭机场" />
              <el-option label="江西融媒" value="江西融媒" />
              <el-option label="广盈机场" value="广盈机场" />
              <el-option label="桃花街道" value="桃花街道" />
              <el-option label="南昌机场一代1" value="南昌机场一代1" />
            </el-select>
          </template>
        </el-table-column>
        <el-table-column prop="time" label="创建日期" align="center">
          <template #default="scope">
            <el-date-picker v-model="scope.row.time" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" placeholder="选择日期" style="width: 200px;" />
          </template>
        </el-table-column>
        <el-table-column label="描述" prop="remark">
          <template #default="scope">
            <el-input v-model="scope.row.remark"></el-input>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center" width="100">
          <template #default="scope">
            <el-button icon="el-icon-delete" type="text" @click="handleDelete(scope.$index)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="moreAddVisible = false">取 消</el-button>
          <el-button type="primary" @click="saveSubmit">保存</el-button>
        </span>
      </template>
    </el-dialog>
  </basic-container>
</template>
@@ -1011,6 +1077,8 @@
        currentPage: 1,
        total: 0,
      },
      moreDataList: [],
      moreAddVisible: false,
      dialogVisible: false,
      detailVisible: false,
      currentDetail: {},
@@ -1396,6 +1464,71 @@
      this.asyncgetWaylineFileListByArea();
    },
    // 批量添加
    moreAdd() {
      this.moreDataList = []
      this.moreAddVisible = true;
    },
    addMoreData() {
      this.moreDataList.push({
        name: '',
        file_id: '',
        device_sns: '',
        time: '',
        remark: ''
      })
    },
    // 删除
    handleDelete(index) {
      if (this.moreDataList.length > 0) {
        this.moreDataList.splice(index, 1)
      }
    },
    // 批量保存
    saveSubmit() {
      // tableData复制5条数据
      if (this.moreDataList.length === 0) {
        this.$message.warning('请添加数据');
        return
      }
      let bfList = []
      this.moreDataList.map((item, index) => {
        bfList.push({
            $cellEdit:false,
            $index:5,
            ai_type_str:'道路裂缝',
            area_code: `360113000000${index}`,
            begin_time:"2025/09/27 18:08",
            content:item.remark,
            create_time:item.time,
            create_user:"1971102860644016129",
            creator_name:"权限测试账号",
            cycle_time_value:"2025/09/27 2025/09/28 每天 18:08",
            dept_name: item.device_sns,
            device_names: item.device_sns,
            device_sns:['8UUXN5M00A08ZD'],
            end_time:"2025/09/28",
            execute_time_arr: ['1758967680', '1759054080'],
            file_id:"47825a57-e376-427e-8ed1-8bc94c27b9cf",
            id: index,
            industry_type_str:"综合类",
            job_info_num:"36011320250927031",
            latitude:28.692045732105385,
            longitude:115.85282499919674,
            name: item.name,
            reason:"",
            remark:item.remark,
            rep_fre_type:"每天",
            status:1,
            status_str:"待审核",
            wayline_job_info_id: index,
        })
      })
      // 把备份的数据加入tableData 中
      this.tableData = [...this.tableData, ...bfList]
      this.page.total = this.tableData.length + bfList.length
      this.moreAddVisible = false;
    },
    resetForm() {
      this.form = {
        name: '',