gaoluyang
4 天以前 2323c93baf009d2f60acaec545622611673203cb
src/views/inspectionManagement/index.vue
@@ -63,15 +63,23 @@
        />
      </div>
    </el-card>
    <form-dia ref="formDia" @closeDia="handleQuery"></form-dia>
    <qr-code-dia ref="qrCodeDia" @closeDia="handleQuery"></qr-code-dia>
  </div>
</template>
<script setup>
import {Download, Delete, Plus} from "@element-plus/icons-vue";
import {onMounted, ref} from "vue";
const { proxy } = getCurrentInstance()
import Pagination from "@/components/Pagination/index.vue";
import ETable from "@/components/Table/ETable.vue";
import FormDia from "@/views/inspectionManagement/components/formDia.vue";
import QrCodeDia from "@/views/inspectionManagement/components/qrCodeDia.vue";
import {delInspectionTask, inspectionTaskList} from "@/api/inspectionManagement/index.js";
const formDia = ref()
const qrCodeDia = ref()
// 查询参数
const queryParams = reactive({
  supplierName: "",
@@ -79,7 +87,7 @@
})
// 当前标签
const activeTab = ref("task");
const tabName = ref("qrCode");
const tabName = ref("task");
// 标签页数据
const tabs = reactive([
  { name: "task", label: "任务下发" },
@@ -93,22 +101,12 @@
const pageNum = ref(1);
const pageSize = ref(10);
const columns = ref([
  { prop: "saleDate", label: "销售日期", minWidth: 160 },
  { prop: "customer", label: "客户", minWidth: 120 },
  { prop: "coal", label: "煤种", minWidth: 150 },
  { prop: "unit", label: "单位", minWidth: 150 },
  { prop: "priceIncludingTax", label: "单价(含税)", minWidth: 150 },
  { prop: "inventoryQuantity", label: "库存数量", minWidth: 120 },
  { prop: "saleQuantity", label: "销售数量", minWidth: 120 },
  { prop: "salePrice", label: "销售单价(含税)", minWidth: 150 },
  { prop: "totalAmount", label: "销售总价(含税)", minWidth: 120 },
  { prop: "freight", label: "运费", minWidth: 90 },
  { prop: "taxCoal", label: "购销煤税率(%)", minWidth: 120 },
  { prop: "taxTrans", label: "运输税率(%)", minWidth: 120 },
  { prop: "grossProfit", label: "毛利润", minWidth: 90 },
  { prop: "netProfit", label: "净利润", minWidth: 90 },
  { prop: "taskName", label: "巡检任务名称", minWidth: 160 },
  { prop: "port", label: "地点", minWidth: 120 },
  { prop: "remarks", label: "备注", minWidth: 150 },
  { prop: "inspector", label: "执行巡检人", minWidth: 150 },
  { prop: "registrant", label: "登记人", minWidth: 100 },
  { prop: "registrationDate", label: "登记日期", minWidth: 100 },
  { prop: "createTime", label: "登记日期", minWidth: 100 },
]);
onMounted(() => {
@@ -127,8 +125,13 @@
  getList()
}
const getList = () => {
  // tableLoading.value = true;
  tableLoading.value = true;
  inspectionTaskList({...queryParams, size: pageSize.value, current: pageNum.value}).then(res => {
    console.log(res)
    tableLoading.value = false;
    tableData.value = res.data.records;
    total.value = res.data.total;
  })
};
// 重置查询
const resetQuery = () => {
@@ -142,7 +145,14 @@
// 新增、编辑
const handleAdd = (row) => {
  const type = row === undefined ? 'add' : 'edit'
  nextTick(() => {
    if (tabName.value === "task") {
      formDia.value?.openDialog(type, row)
    } else {
      qrCodeDia.value?.openDialog(type, row)
    }
  })
};
// 删除任务
const handleDelete = () => {
@@ -152,7 +162,7 @@
  }
  const deleteIds = selectedRows.value.map(item => item.id);
  proxy.$modal.confirm('是否确认删除所选数据项?').then(function() {
    return delSalesRecord(deleteIds)
    return delInspectionTask(deleteIds)
  }).then(() => {
    handleQuery()
    proxy.$modal.msgSuccess("删除成功")