已修改17个文件
598 ■■■■ 文件已修改
src/api/salesManagement/salesLedger.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/product/ProductSelectDialog.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/customerService/afterSalesHandling/index.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/dispatchLog/Record.vue 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/dispatchLog/index.vue 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/receiptManagement/Record.vue 69 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/receiptManagement/index.vue 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/stockManagement/Qualified.vue 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/stockManagement/Unqualified.vue 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/stockManagement/index.vue 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionOrder/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/deliveryLedger/index.vue 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/paymentShipping/index.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/returnOrder/components/detailDia.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/returnOrder/components/formDia.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/returnOrder/index.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/index.vue 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/salesManagement/salesLedger.js
@@ -116,4 +116,13 @@
        method: "get",
        params: query,
    });
}
// 撤销发货
export function cancelDelivery(query) {
    return request({
        url: "/sales/product/cancelDelivery",
        method: "post",
        data: query,
    });
}
src/views/basicData/product/ProductSelectDialog.vue
@@ -33,10 +33,10 @@
    </div>
    <template #footer>
      <el-button @click="close()">取消</el-button>
      <el-button type="primary" :disabled="multipleSelection.length === 0" @click="onConfirm">
        确定
      </el-button>
            <el-button @click="close()">取消</el-button>
    </template>
  </el-dialog>
</template>
src/views/customerService/afterSalesHandling/index.vue
@@ -102,7 +102,6 @@
    afterSalesServiceFileListPage,
    afterSalesServiceFileAdd,
    afterSalesServiceFileDel,
    afterSalesServiceRepairListPage,
} from "@/api/customerService/index.js";
import useUserStore from "@/store/modules/user.js";
const { proxy } = getCurrentInstance();
@@ -211,13 +210,13 @@
                },
            },
            // TODO 为写报告添加的
            {
                name: "维修记录",
                type: "text",
                clickFun: (row) => {
                    openRepairDialog(row);
                },
            },
            // {
            //     name: "维修记录",
            //     type: "text",
            //     clickFun: (row) => {
            //         openRepairDialog(row);
            //     },
            // },
        ],
    },
]);
src/views/inventoryManagement/dispatchLog/Record.vue
@@ -22,9 +22,18 @@
                     :label="item.label"
                     :value="item.value"/>
        </el-select>
        <span class="search_title ml10">质检状态:</span>
        <el-select v-model="searchForm.type"
                  style="width: 240px"
                  placeholder="请选择"
                  clearable>
          <el-option label="合格" :value="0" />
          <el-option label="不合格" :value="1" />
        </el-select>
                <el-button type="primary" @click="handleQuery" style="margin-left: 10px"
                >搜索</el-button
                >
                <el-button @click="handleReset">重置</el-button>
            </div>
            <div>
                <el-button @click="handleOut">导出</el-button>
@@ -76,6 +85,16 @@
                    prop="stockOutNum"
                    show-overflow-tooltip
                />
                <el-table-column label="质检状态"
                         prop="type"
                         show-overflow-tooltip
                         width="100">
          <template #default="scope">
            <el-tag :type="scope.row.type == 0 ? 'success' : 'danger'" size="small">
              {{ scope.row.type == 0 ? '合格' : '不合格' }}
            </el-tag>
          </template>
        </el-table-column>
                <el-table-column
                    label="出库人"
                    prop="createBy"
@@ -103,7 +122,7 @@
<script setup>
import pagination from "@/components/PIMTable/Pagination.vue";
import { ref } from "vue";
import { ref, watch } from "vue";
import { ElMessageBox } from "element-plus";
import useUserStore from "@/store/modules/user";
import { getCurrentDate } from "@/utils/index.js";
@@ -130,9 +149,9 @@
const props = defineProps({
  type: {
    type: String,
    type: Number,
    required: true,
    default: '0'
    default: 1
  }
})
@@ -146,6 +165,7 @@
        supplierName: "",
        timeStr: "",
    recordType: "",
    type: "",
    }
});
const { searchForm } = toRefs(data);
@@ -156,6 +176,15 @@
    page.current = 1;
    getList();
};
/** 重置按钮操作 */
const handleReset = () => {
  searchForm.value.supplierName = "";
  searchForm.value.timeStr = "";
  searchForm.value.recordType = "";
  searchForm.value.type = "";
  handleQuery();
};
const paginationChange = (obj) => {
    page.current = obj.page;
    page.size = obj.limit;
@@ -163,7 +192,11 @@
};
const getList = () => {
    tableLoading.value = true;
    getStockOutPage({ ...searchForm.value, ...page, type: props.type })
    const params = { ...searchForm.value, ...page, productType: props.type };
  if (searchForm.value.type !== "") {
    params.type = searchForm.value.type;
  }
    getStockOutPage(params)
        .then((res) => {
            tableLoading.value = false;
            tableData.value = res.data.records;
@@ -183,17 +216,17 @@
// 获取来源类型选项
const fetchStockRecordTypeOptions = () => {
  if (props.type === '0') {
  if (props.type === 1 || props.type === 2) {
    findAllQualifiedStockOutRecordTypeOptions()
        .then(res => {
          stockRecordTypeOptions.value = res.data;
        })
    return
  }
  findAllUnQualifiedStockOutRecordTypeOptions()
  } else {
    findAllUnQualifiedStockOutRecordTypeOptions()
      .then(res => {
        stockRecordTypeOptions.value = res.data;
      })
  }
}
// 表格选择数据
@@ -212,7 +245,12 @@
        type: "warning",
    })
        .then(() => {
            proxy.download("/stockOutRecord/exportStockOutRecord", {type: props.type}, props.type === '0' ? "合格出库台账.xlsx" : "不合格出库台账.xlsx");
            const fileNameMap = {
        1: '自制出库台账.xlsx',
        2: '外购出库台账.xlsx',
        3: '委外出库台账.xlsx'
      };
            proxy.download("/stockOutRecord/exportStockOutRecord", {productType: props.type}, fileNameMap[props.type] || '出库台账.xlsx');
        })
        .catch(() => {
            proxy.$modal.msg("已取消");
@@ -537,6 +575,12 @@
    getList();
  fetchStockRecordTypeOptions();
});
watch(() => props.type, () => {
  page.current = 1;
  getList();
  fetchStockRecordTypeOptions();
});
</script>
<style scoped lang="scss">
src/views/inventoryManagement/dispatchLog/index.vue
@@ -14,25 +14,33 @@
<script setup>
import Record from "@/views/inventoryManagement/dispatchLog/Record.vue";
const activeTab = ref('qualified')
const type = ref(0)
import { computed, ref } from "vue";
const activeTab = ref('selfMade')
const type = ref(1)
const tabs = computed(() => {
  return [
    {
      label: '合格出库',
      name: 'qualified',
      type: '0'
      label: '自制',
      name: 'selfMade',
      type: 1
    },
    {
      label: '不合格出库',
      name: 'unqualified',
      type: '1'
      label: '外购',
      name: 'purchase',
      type: 2
    },
    {
      label: '委外',
      name: 'outsourcing',
      type: 3
    }
  ]
})
const handleTabChange = (tabName) => {
  activeTab.value = tabName;
  type.value = tabName === 'qualified' ? 0 : 1
  const tab = tabs.value.find(t => t.name === tabName);
  type.value = tab ? tab.type : 1;
}
</script>
src/views/inventoryManagement/receiptManagement/Record.vue
@@ -25,10 +25,19 @@
                     :label="item.label"
                     :value="item.value"/>
        </el-select>
        <span class="search_title ml10">质检状态:</span>
        <el-select v-model="searchForm.type"
                  style="width: 240px"
                  placeholder="请选择"
                  clearable>
          <el-option label="合格" :value="0" />
          <el-option label="不合格" :value="1" />
        </el-select>
        <el-button type="primary"
                   @click="handleQuery"
                   style="margin-left: 10px">搜索
        </el-button>
        <el-button @click="handleReset">重置</el-button>
      </div>
      <div>
        <el-button @click="handleOut">导出</el-button>
@@ -73,6 +82,19 @@
        <el-table-column label="入库数量"
                         prop="stockInNum"
                         show-overflow-tooltip/>
        <el-table-column label="质检状态"
                         prop="type"
                         show-overflow-tooltip
                         width="100">
          <template #default="scope">
            <el-tag :type="scope.row.type == 0 ? 'success' : 'danger'" size="small">
              {{ scope.row.type == 0 ? '合格' : '不合格' }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column label="库位"
                         prop="locationName"
                         show-overflow-tooltip/>
        <el-table-column label="入库人"
                         prop="createBy"
                         show-overflow-tooltip/>
@@ -102,6 +124,7 @@
  toRefs,
  onMounted,
  getCurrentInstance,
  watch,
} from "vue";
import {ElMessageBox} from "element-plus";
import {
@@ -116,9 +139,9 @@
const props = defineProps({
  type: {
    type: String,
    type: Number,
    required: true,
    default: '0'
    default: 1
  }
})
@@ -138,14 +161,25 @@
    productName: "",
    timeStr: "",
    recordType: "",
    type: "",
  },
});
const {searchForm} = toRefs(data);
// 查询列表
/** 搜索按钮操作 */
const handleQuery = () => {
  page.current = 1;
  getList();
};
/** 重置按钮操作 */
const handleReset = () => {
  searchForm.value.productName = "";
  searchForm.value.timeStr = "";
  searchForm.value.recordType = "";
  searchForm.value.type = "";
  handleQuery();
};
const getRecordType = (recordType) => {
@@ -160,10 +194,13 @@
const getList = () => {
  tableLoading.value = true;
  const params = {...page, type: props.type};
  const params = {...page, productType: props.type};
  params.timeStr = searchForm.value.timeStr;
  params.productName = searchForm.value.productName;
  params.recordType = searchForm.value.recordType;
  if (searchForm.value.type !== "") {
    params.type = searchForm.value.type;
  }
  getStockInRecordListPage(params)
      .then(res => {
        tableData.value = res.data.records;
@@ -175,17 +212,17 @@
// 获取来源类型选项
const fetchStockRecordTypeOptions = () => {
  if (props.type === '0') {
  if (props.type === 1 || props.type === 2) {
    findAllQualifiedStockInRecordTypeOptions()
        .then(res => {
          stockRecordTypeOptions.value = res.data;
        })
    return
  } else {
    findAllUnQualifiedStockInRecordTypeOptions()
        .then(res => {
          stockRecordTypeOptions.value = res.data;
        })
  }
  findAllUnQualifiedStockInRecordTypeOptions()
      .then(res => {
        stockRecordTypeOptions.value = res.data;
      })
}
// 表格选择数据
@@ -203,8 +240,12 @@
    type: "warning",
  })
      .then(() => {
        // 根据不同的 tab 类型调用不同的导出接口
        proxy.download("/stockInRecord/exportStockInRecord", {type: props.type}, props.type === '0' ? "合格入库.xlsx" : "不合格入库.xlsx");
        const fileNameMap = {
          1: '自制入库.xlsx',
          2: '外购入库.xlsx',
          3: '委外入库.xlsx'
        };
        proxy.download("/stockInRecord/exportStockInRecord", {productType: props.type}, fileNameMap[props.type] || '入库.xlsx');
      })
      .catch(() => {
        proxy.$modal.msg("已取消");
@@ -243,6 +284,12 @@
  getList();
  fetchStockRecordTypeOptions();
});
watch(() => props.type, () => {
  page.current = 1;
  getList();
  fetchStockRecordTypeOptions();
});
</script>
<style scoped lang="scss"></style>
src/views/inventoryManagement/receiptManagement/index.vue
@@ -14,23 +14,29 @@
<script setup>
import Record from "@/views/inventoryManagement/receiptManagement/Record.vue";
const activeTab = ref('qualified')
const type = ref(0)
const activeTab = ref('selfMade')
const type = ref(1)
const tabs = ref([
  {
    label: '合格入库',
    name: 'qualified',
    type: '0'
    label: '自制',
    name: 'selfMade',
    type: 1
  },
  {
    label: '不合格入库',
    name: 'unqualified',
    type: '1'
    label: '外购',
    name: 'purchase',
    type: 2
  },
  {
    label: '委外',
    name: 'outsourcing',
    type: 3
  }
])
const handleTabChange = (tabName) => {
  activeTab.value = tabName;
  type.value = tabName === 'qualified' ? 0 : 1
  const tab = tabs.value.find(t => t.name === tabName);
  type.value = tab ? tab.type : 1;
}
</script>
src/views/inventoryManagement/stockManagement/Qualified.vue
@@ -7,7 +7,15 @@
                  style="width: 240px"
                  placeholder="请输入"
                  clearable/>
        <span class="search_title ml10">质检状态:</span>
        <el-select v-model="searchForm.type"
                  style="width: 240px"
                  placeholder="请选择">
          <el-option label="合格" :value="0" />
          <el-option label="不合格" :value="1" />
        </el-select>
        <el-button type="primary" @click="handleQuery" style="margin-left: 10px">搜索</el-button>
        <el-button @click="handleReset">重置</el-button>
      </div>
      <div>
         <el-button type="primary" @click="isShowNewModal = true">新增库存</el-button>
@@ -27,6 +35,15 @@
        <el-table-column label="规格型号" prop="model" show-overflow-tooltip />
        <el-table-column label="单位" prop="unit" show-overflow-tooltip />
        <el-table-column label="库存数量" prop="qualitity" show-overflow-tooltip />
        <el-table-column label="质检状态"
                         show-overflow-tooltip
                         width="100">
          <template #default="scope">
            <el-tag :type="searchForm.type == 0 ? 'success' : 'danger'" size="small">
              {{ searchForm.type == 0 ? '合格' : '不合格' }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column label="冻结数量" prop="lockedQuantity" show-overflow-tooltip />
        <el-table-column label="库存预警数量" prop="warnNum"  show-overflow-tooltip />
        <el-table-column label="备注" prop="remark"  show-overflow-tooltip />
@@ -44,39 +61,49 @@
    </div>
    <new-stock-inventory v-if="isShowNewModal"
                 v-model:visible="isShowNewModal"
                 type="qualified"
                 :type="searchForm.type === 0 ? 'qualified' : 'unqualified'"
                 @completed="handleQuery" />
    <subtract-stock-inventory v-if="isShowSubtractModal"
                 v-model:visible="isShowSubtractModal"
                 :record="record"
                 type="qualified"
                 :type="searchForm.type === 0 ? 'qualified' : 'unqualified'"
                 @completed="handleQuery" />
    <!-- 导入库存-->
    <import-stock-inventory v-if="isShowImportModal"
                 v-model:visible="isShowImportModal"
                 type="qualified"
                 :type="searchForm.type === 0 ? 'qualified' : 'unqualified'"
                 @uploadSuccess="handleQuery" />
    <!-- 冻结/解冻库存-->
    <frozen-and-thaw-stock-inventory v-if="isShowFrozenAndThawModal"
                 v-model:visible="isShowFrozenAndThawModal"
                 :record="record"
                 :operation-type="operationType"
                 type="qualified"
                 :type="searchForm.type === 0 ? 'qualified' : 'unqualified'"
                 @completed="handleQuery" />
  </div>
</template>
<script setup>
import pagination from '@/components/PIMTable/Pagination.vue'
import { ref, reactive, toRefs, onMounted, getCurrentInstance } from 'vue'
import { ref, reactive, toRefs, onMounted, getCurrentInstance, watch, computed } from 'vue'
import {ElMessage, ElMessageBox} from "element-plus";
import { getStockInventoryListPage } from "@/api/inventoryManagement/stockInventory.js";
import { getStockUninventoryListPage } from "@/api/inventoryManagement/stockUninventory.js";
const NewStockInventory = defineAsyncComponent(() => import("@/views/inventoryManagement/stockManagement/New.vue"));
const SubtractStockInventory = defineAsyncComponent(() => import("@/views/inventoryManagement/stockManagement/Subtract.vue"));
const ImportStockInventory = defineAsyncComponent(() => import("@/views/inventoryManagement/stockManagement/Import.vue"));
const FrozenAndThawStockInventory = defineAsyncComponent(() => import("@/views/inventoryManagement/stockManagement/FrozenAndThaw.vue"));
const { proxy } = getCurrentInstance()
const props = defineProps({
  type: {
    type: Number,
    required: true,
    default: 1
  }
})
const tableData = ref([])
const selectedRows = ref([])
const record = ref({})
@@ -99,15 +126,27 @@
const data = reactive({
  searchForm: {
    productName: '',
    type: 0,
  }
})
const { searchForm } = toRefs(data)
const qualityType = computed(() => {
  return searchForm.value.type === 0 ? 'qualified' : 'unqualified';
})
// 查询列表
/** 搜索按钮操作 */
const handleQuery = () => {
  page.current = 1
  getList()
}
/** 重置按钮操作 */
const handleReset = () => {
  searchForm.value.productName = '';
  searchForm.value.type = 0;
  handleQuery();
}
const paginationChange = (obj) => {
  page.current = obj.page;
@@ -116,7 +155,13 @@
}
const getList = () => {
  tableLoading.value = true
  getStockInventoryListPage({ ...searchForm.value, ...page }).then(res => {
  const params = { ...searchForm.value, ...page, productType: props.type };
  params.type = searchForm.value.type;
  const apiCall = searchForm.value.type === 0 ? getStockInventoryListPage : getStockUninventoryListPage;
  const exportApi = searchForm.value.type === 0 ? "/stockInventory/exportStockInventory" : "/stockUninventory/exportStockUninventory";
  apiCall(params).then(res => {
    tableLoading.value = false
    tableData.value = res.data.records
    total.value = res.data.total
@@ -186,7 +231,13 @@
    type: 'warning',
  }
  ).then(() => {
    proxy.download("/stockInventory/exportStockInventory", {}, '合格库存信息.xlsx')
    const fileNameMap = {
      1: '自制库存信息.xlsx',
      2: '外购库存信息.xlsx',
      3: '委外库存信息.xlsx'
    };
    const exportApi = searchForm.value.type === 0 ? "/stockInventory/exportStockInventory" : "/stockUninventory/exportStockUninventory";
    proxy.download(exportApi, {productType: props.type}, fileNameMap[props.type] || '库存信息.xlsx')
  }).catch(() => {
    proxy.$modal.msg("已取消")
  })
@@ -195,6 +246,16 @@
onMounted(() => {
  getList()
})
watch(() => props.type, () => {
  page.current = 1
  getList()
})
watch(() => searchForm.value.type, () => {
  page.current = 1
  getList()
})
</script>
<style scoped lang="scss">
src/views/inventoryManagement/stockManagement/Unqualified.vue
@@ -7,7 +7,16 @@
                  style="width: 240px"
                  placeholder="请输入"
                  clearable/>
        <span class="search_title ml10">质检状态:</span>
        <el-select v-model="searchForm.type"
                  style="width: 240px"
                  placeholder="请选择"
                  clearable>
          <el-option label="合格" :value="0" />
          <el-option label="不合格" :value="1" />
        </el-select>
        <el-button type="primary" @click="handleQuery" style="margin-left: 10px">搜索</el-button>
        <el-button @click="handleReset">重置</el-button>
      </div>
      <div>
         <el-button type="primary" @click="isShowNewModal = true">新增库存</el-button>
@@ -24,6 +33,16 @@
        <el-table-column label="规格型号" prop="model" show-overflow-tooltip />
        <el-table-column label="单位" prop="unit" show-overflow-tooltip />
        <el-table-column label="库存数量" prop="qualitity" show-overflow-tooltip />
        <el-table-column label="质检状态"
                         prop="type"
                         show-overflow-tooltip
                         width="100">
          <template #default="scope">
            <el-tag :type="scope.row.type == 0 ? 'success' : 'danger'" size="small">
              {{ scope.row.type == 0 ? '合格' : '不合格' }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column label="冻结数量" prop="lockedQuantity" show-overflow-tooltip />
        <el-table-column label="备注" prop="remark"  show-overflow-tooltip />
        <el-table-column label="最近更新时间" prop="updateTime" show-overflow-tooltip />
@@ -60,7 +79,7 @@
<script setup>
import pagination from '@/components/PIMTable/Pagination.vue'
import { ref, reactive, toRefs, onMounted, getCurrentInstance } from 'vue'
import { ref, reactive, toRefs, onMounted, getCurrentInstance, watch } from 'vue'
import { ElMessageBox } from "element-plus";
import { getStockUninventoryListPage } from "@/api/inventoryManagement/stockUninventory.js";
const NewStockInventory = defineAsyncComponent(() => import("@/views/inventoryManagement/stockManagement/New.vue"));
@@ -68,6 +87,15 @@
const FrozenAndThawStockInventory = defineAsyncComponent(() => import("@/views/inventoryManagement/stockManagement/FrozenAndThaw.vue"));
const { proxy } = getCurrentInstance()
const props = defineProps({
  type: {
    type: Number,
    required: true,
    default: 3
  }
})
const tableData = ref([])
const selectedRows = ref([])
const record = ref({})
@@ -88,6 +116,7 @@
const data = reactive({
  searchForm: {
    productName: '',
    type: '',
  }
})
const { searchForm } = toRefs(data)
@@ -98,6 +127,13 @@
  page.current = 1
  getList()
}
/** 重置按钮操作 */
const handleReset = () => {
  searchForm.value.productName = '';
  searchForm.value.type = '';
  handleQuery();
}
const paginationChange = (obj) => {
  page.current = obj.page;
  page.size = obj.limit;
@@ -105,7 +141,11 @@
}
const getList = () => {
  tableLoading.value = true
  getStockUninventoryListPage({ ...searchForm.value, ...page }).then(res => {
  const params = { ...searchForm.value, ...page, productType: props.type };
  if (searchForm.value.type !== "") {
    params.type = searchForm.value.type;
  }
  getStockUninventoryListPage(params).then(res => {
    tableLoading.value = false
    tableData.value = res.data.records
    total.value = res.data.total
@@ -164,7 +204,12 @@
    type: 'warning',
  }
  ).then(() => {
    proxy.download("/stockUninventory/exportStockUninventory", {}, '不合格库存信息.xlsx')
    const fileNameMap = {
      1: '自制库存信息.xlsx',
      2: '外购库存信息.xlsx',
      3: '委外库存信息.xlsx'
    };
    proxy.download("/stockUninventory/exportStockUninventory", {productType: props.type}, fileNameMap[props.type] || '库存信息.xlsx')
  }).catch(() => {
    proxy.$modal.msg("已取消")
  })
@@ -173,6 +218,11 @@
onMounted(() => {
  getList()
})
watch(() => props.type, () => {
  page.current = 1
  getList()
})
</script>
<style scoped lang="scss">
src/views/inventoryManagement/stockManagement/index.vue
@@ -5,25 +5,35 @@
                   :label="tab.label"
                   :name="tab.name"
                   :key="tab.name">
        <component :is="tab.name === 'qualified' ? QualifiedRecord : UnqualifiedRecord" />
        <component :is="tab.component" :type="tab.type" v-if="activeTab === tab.name" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script setup>
import QualifiedRecord from "@/views/inventoryManagement/stockManagement/Qualified.vue";
import UnqualifiedRecord from "@/views/inventoryManagement/stockManagement/Unqualified.vue";
import { markRaw } from 'vue';
import StockRecord from "@/views/inventoryManagement/stockManagement/Qualified.vue";
const activeTab = ref('qualified')
const activeTab = ref('selfMade')
const tabs = ref([
  {
    label: '合格库存',
    name: 'qualified'
    label: '自制',
    name: 'selfMade',
    type: 1,
    component: markRaw(StockRecord)
  },
  {
    label: '不合格库存',
    name: 'unqualified'
    label: '外购',
    name: 'purchase',
    type: 2,
    component: markRaw(StockRecord)
  },
  {
    label: '委外',
    name: 'outsourcing',
    type: 3,
    component: markRaw(StockRecord)
  }
])
src/views/productionManagement/productionOrder/index.vue
@@ -163,6 +163,10 @@
      prop: "completeQuantity",
    },
    {
      label: "库存数量",
      prop: "inventoryQuantity",
    },
    {
      dataType: "slot",
      label: "完成进度",
      prop: "completionStatus",
src/views/salesManagement/deliveryLedger/index.vue
@@ -39,7 +39,7 @@
            />
          </template>
        </el-table-column>
        <el-table-column label="审核状态" prop="status" align="center" width="120">
        <el-table-column label="状态" prop="status" align="center" width="120">
          <template #default="scope">
            <el-tag :type="getApprovalStatusType(scope.row.status)">
              {{ getApprovalStatusText(scope.row.status) }}
@@ -52,7 +52,7 @@
              link 
              type="primary"  
              size="small" 
              :disabled="(scope.row.waitShippingTotal || 0) <= 0"
              :disabled="(scope.row.waitShippingTotal || 0) <= 0 || isRevoked(scope.row.status)"
              @click="openForm('edit', scope.row)">分批发货</el-button>
            <el-button
              link
@@ -117,6 +117,10 @@
                    <div class="summary-value shipped">{{ currentShippingOrder.shippingSuccessTotal || 0 }}</div>
                  </div>
                  <div class="summary-item">
                    <div class="summary-label">已退货数量</div>
                    <div class="summary-value returned">{{ currentShippingOrder.returnedQuantity || 0 }}</div>
                  </div>
                  <div class="summary-item">
                    <div class="summary-label">待发货数量</div>
                    <div class="summary-value waiting">{{ currentShippingOrder.waitShippingTotal || 0 }}</div>
                  </div>
@@ -169,6 +173,10 @@
                        <span class="info-label">发货数量</span>
                        <span class="info-value quantity">{{ record.shippingNum }}</span>
                      </div>
                      <div class="info-row">
                        <span class="info-label">退货数量</span>
                        <span class="info-value returned">{{ record.returnNum || 0 }}</span>
                      </div>
                      <div class="info-row" v-if="record.type === '货车'">
                        <span class="info-label">车牌号</span>
                        <span class="info-value">{{ record.shippingCarNumber || '--' }}</span>
@@ -194,6 +202,14 @@
                            preview-teleported
                          />
                        </div>
                      </div>
                      <div class="record-actions" v-if="canRevokeShipping(record)">
                        <el-button
                          type="danger"
                          size="small"
                          @click="handleRevokeShipping(record)">
                          撤销发货
                        </el-button>
                      </div>
                    </div>
                  </div>
@@ -442,6 +458,11 @@
    return;
  }
  
  if (type === 'edit' && isRevoked(row.status)) {
    proxy.$modal.msgWarning("已撤销状态不能分批发货");
    return;
  }
  dialogMode.value = type === 'edit' ? 'edit' : 'view';
  currentShippingOrder.value = row;
  showAddForm.value = false;
@@ -519,6 +540,30 @@
  return waitShipping > 0;
};
// 是否可以撤销发货
const canRevokeShipping = (record) => {
  const shippingNum = record.shippingNum || 0;
  const returnNum = record.returnNum || 0;
  return shippingNum > 0 && returnNum > 0 && shippingNum === returnNum;
};
// 撤销发货
const handleRevokeShipping = (record) => {
  ElMessageBox.confirm("此操作将撤销该发货记录,是否确认?", "撤销发货", {
    confirmButtonText: "确认",
    cancelButtonText: "取消",
    type: "warning",
  })
    .then(() => {
      updateShippingInfoDetail({ ...record, status: 3 }).then((res) => {
        proxy.$modal.msgSuccess("撤销成功");
        loadShippingRecords(currentShippingOrder.value.id);
        getList();
      });
    })
    .catch(() => {});
};
// 提交发货
const submitShipping = () => {
  proxy.$refs["shippingFormRef"].validate((valid) => {
@@ -529,6 +574,8 @@
      }
      const payload = {
        shippingInfoId: currentShippingOrder.value.id,
        salesLedgerId: currentShippingOrder.value.salesLedgerId,
        salesLedgerProductId: currentShippingOrder.value.salesLedgerProductId,
        shippingTotal: currentShippingOrder.value.shippingTotal,
        shippingNum: shippingForm.value.shippingNum,
        type: shippingForm.value.type,
@@ -739,6 +786,7 @@
    '审核中': '审核中',
    '审核拒绝': '审核拒绝',
    '审核通过': '审核通过',
    '已撤销': '已撤销',
    '0': '待审核',
    '1': '审核中',
    '2': '审核拒绝',
@@ -767,6 +815,7 @@
    '审核中': 'warning',
    '审核拒绝': 'danger',
    '审核通过': 'success',
    '已撤销': 'warning',
    '0': 'info',
    '1': 'warning',
    '2': 'danger',
@@ -797,6 +846,18 @@
  }
  const statusStr = String(status).trim();
  return statusStr === '审核中' || statusStr === '1';
};
// 检查状态是否为"已撤销"
const isRevoked = (status) => {
  if (status === null || status === undefined || status === '') {
    return false;
  }
  if (typeof status === 'number') {
    return status === 3;
  }
  const statusStr = String(status).trim();
  return statusStr === '已撤销' || statusStr === '3';
};
onMounted(() => {
@@ -879,6 +940,10 @@
            
            &.shipped {
              color: #67C23A;
            }
            &.returned {
              color: #F56C6C;
            }
            
            &.waiting {
@@ -992,9 +1057,21 @@
                  color: #409EFF;
                  font-size: 16px;
                }
                &.returned {
                  font-weight: bold;
                  color: #F56C6C;
                  font-size: 16px;
                }
              }
            }
            
            .record-actions {
              margin-top: 12px;
              padding-top: 12px;
              border-top: 1px solid #EBEEF5;
            }
            .record-images {
              display: flex;
              gap: 8px;
src/views/salesManagement/paymentShipping/index.vue
@@ -27,6 +27,7 @@
            <el-option label="待发货" value="待发货"></el-option>
            <el-option label="已发货" value="已发货"></el-option>
            <el-option label="已签收" value="已签收"></el-option>
            <el-option label="已撤销" value="已撤销"></el-option>
          </el-select>
        </el-col>
        <el-col :span="6">
@@ -148,6 +149,7 @@
                <el-option label="待发货" value="待发货"></el-option>
                <el-option label="已发货" value="已发货"></el-option>
                <el-option label="已签收" value="已签收"></el-option>
                <el-option label="已撤销" value="已撤销"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
@@ -346,7 +348,8 @@
  const statusMap = {
    '待发货': 'warning',
    '已发货': 'primary',
    '已签收': 'success'
    '已签收': 'success',
    '已撤销': 'warning'
  }
  return statusMap[status] || 'info'
}
src/views/salesManagement/returnOrder/components/detailDia.vue
@@ -45,7 +45,7 @@
  {align: "center", label: "产品大类", prop: "productCategory"},
  {align: "center", label: "规格型号", prop: "specificationModel"},
  {align: "center", label: "单位", prop: "unit", width: 80},
  {align: "center", label: "总数量", prop: "quantity", width: 120},
  {align: "center", label: "总数量", prop: "shippingNum", width: 120},
  {align: "center", label: "已退货数量", prop: "totalReturnNum", width: 120},
  {align: "center", label: "未退货数量", prop: "unQuantity", width: 120},
  {align: "center", label: "退货数量", prop: "returnQuantity", width: 120},
src/views/salesManagement/returnOrder/components/formDia.vue
@@ -148,7 +148,7 @@
        <el-table-column align="center" prop="productCategory" label="产品大类" />
        <el-table-column align="center" prop="specificationModel" label="规格型号" />
        <el-table-column align="center" prop="unit" label="单位" />
        <el-table-column align="center" prop="quantity" label="总数量" />
        <el-table-column align="center" prop="shippingNum" label="总数量" />
        <el-table-column align="center" prop="unQuantity" label="未退货数量" />
        <el-table-column align="center" label="已退货数量">
          <template #default="{ row }">{{ calcAlreadyReturned(row) }}</template>
@@ -208,7 +208,7 @@
const { form, rules } = toRefs(data);
const calcAlreadyReturned = (row) => {
  const total = Number(row?.quantity ?? row?.totalQuantity ?? row?.totalReturnNum ?? 0);
  const total = Number(row?.shippingNum ?? row?.totalQuantity ?? row?.totalReturnNum ?? 0);
  const un = Number(row?.unQuantity ?? 0);
  if (!Number.isFinite(total) || !Number.isFinite(un)) return 0;
  return Math.max(total - un, 0);
@@ -218,7 +218,7 @@
  {align: "center", label: "产品大类", prop: "productCategory" },
  {align: "center", label: "规格型号", prop: "specificationModel" },
  {align: "center", label: "单位", prop: "unit", width: 80 },
  {align: "center", label: "总数量", prop: "quantity", width: 120 },
  {align: "center", label: "总数量", prop: "shippingNum", width: 120 },
  {align: "center", label: "已退货数量", prop: "totalReturnNum", width: 120 },
  {align: "center", label: "未退货数量", prop: "unQuantity", width: 120 },
  {align: "center", label: "退货数量", prop: "returnQuantity", dataType: "slot", slot: "returnQuantity", width: 120 },
@@ -458,9 +458,9 @@
};
const calculateRowAmount = (row) => {
  const quantity = Number(row.returnQuantity || 0);
  const shippingNum = Number(row.returnQuantity || 0);
  const price = Number(row.price || 0);
  row.amount = (quantity * price).toFixed(2);
  row.amount = (shippingNum * price).toFixed(2);
};
const calculateTotalRefund = () => {
@@ -515,7 +515,7 @@
        productName: product.productName,
        specificationModel: product.specificationModel,
        unit: product.unit,
        quantity: product.quantity,
                shippingNum: product.shippingNum,
        totalReturnNum: product.totalReturnNum,
        unQuantity: product.unQuantity
      });
src/views/salesManagement/returnOrder/index.vue
@@ -120,7 +120,8 @@
const documentStatusOptions = ref([
  { label: "待处理", value: 0 },
  { label: "已处理", value: 1 }
  { label: "已处理", value: 1 },
  { label: "已撤销", value: 2 }
]);
const defaultColumns = [
@@ -144,7 +145,7 @@
      { name: "编辑", disabled: (row) => row.status !== 0, type: "text", clickFun: (row) => openForm("edit", row) },
      { name: "退款处理", disabled: (row) => row.status !== 0, type: "text", clickFun: (row) => handleRowHandle(row) },
      { name: "详情", type: "text", clickFun: (row) => openDetail(row) },
      { name: "删除", disabled: (row) => row.status !== 0, type: "text", clickFun: (row) => handleRowDelete(row) },
      { name: "删除", disabled: (row) => row.status === 1 || row.status === 2, type: "text", clickFun: (row) => handleRowDelete(row) },
    ],
  },
];
@@ -206,7 +207,8 @@
const getStatusType = (status) => {
  const statusMap = {
    0: "warning",
    1: "success"
    1: "success",
    2: "warning"
  };
  return statusMap[status] || "info";
};
@@ -214,7 +216,8 @@
const getStatusText = (status) => {
  const statusMap = {
    0: "待处理",
    1: "已处理"
    1: "已处理",
    2: "已撤销"
  };
  return statusMap[status] || "未知";
};
src/views/salesManagement/salesLedger/index.vue
@@ -64,34 +64,15 @@
                                    </el-tag>
                                </template>
                            </el-table-column>
                            <el-table-column label="快递公司" prop="expressCompany" show-overflow-tooltip />
                            <el-table-column label="快递单号" prop="expressNumber" show-overflow-tooltip />
              <el-table-column label="发货车牌" minWidth="100px" align="center">
                <template #default="scope">
                  <div>
                    <el-tag type="success" v-if="scope.row.shippingCarNumber">{{ scope.row.shippingCarNumber }}</el-tag>
                    <el-tag v-else type="info">-</el-tag>
                  </div>
                </template>
              </el-table-column>
                            <el-table-column label="发货日期"
                                                             minWidth="100px"
                                                             align="center">
                <template #default="scope">
                  <div>
                    <div v-if="scope.row.shippingDate">{{ scope.row.shippingDate }}</div>
                                        <el-tag v-else
                                                        type="info">-</el-tag>
                  </div>
                </template>
              </el-table-column>
              <el-table-column label="已发货数量" prop="shippingNum" align="center" />
              <el-table-column label="已退货数量" prop="returnNum" align="center" />
              <el-table-column label="数量" prop="quantity" />
              <el-table-column label="税率(%)" prop="taxRate" />
              <el-table-column label="含税单价(元)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" />
              <el-table-column label="含税总价(元)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" />
              <el-table-column label="不含税总价(元)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" />
            <!--操作-->
              <el-table-column width="100" label="操作" align="center" fixed="right">
              <el-table-column width="150" label="操作" align="center" fixed="right">
                <template #default="scope">
                  <el-button 
                    link 
@@ -100,6 +81,14 @@
                    :disabled="!canShip(scope.row)"
                    @click="openDeliveryForm(scope.row)">
                    发货
                  </el-button>
                  <el-button
                    link
                    type="danger"
                    size="small"
                    :disabled="!canRevokeShipping(scope.row)"
                    @click="handleRevokeShipping(scope.row)">
                    撤销发货
                  </el-button>
                </template>
              </el-table-column>
@@ -650,7 +639,7 @@
    delLedger,
    addOrUpdateSalesLedgerProduct,
    delProduct,
    delLedgerFile, getProductInventory,
    delLedgerFile, getProductInventory, cancelDelivery,
} from "@/api/salesManagement/salesLedger.js";
import { modelList, productTreeList } from "@/api/basicData/product.js";
import useFormData from "@/hooks/useFormData.js";
@@ -1964,11 +1953,6 @@
 * @param row 行数据
 */
const getShippingStatusText = (row) => {
    // 如果已发货(有发货日期或车牌号),显示"已发货"
    if (row.shippingDate || row.shippingCarNumber) {
        return '已发货';
    }
    // 获取发货状态字段
    const status = row.shippingStatus;
    
@@ -1979,13 +1963,25 @@
    
    // 状态是字符串
    const statusStr = String(status).trim();
    // 如果状态是"已撤销",直接返回
    if (statusStr === '已撤销') {
        return '已撤销';
    }
    // 如果已发货(有发货日期或车牌号),显示"已发货"
    if (row.shippingDate || row.shippingCarNumber) {
        return '已发货';
    }
    const statusTextMap = {
        '待发货': '待发货',
        '待审核': '待审核',
        '审核中': '审核中',
        '审核拒绝': '审核拒绝',
        '审核通过': '审核通过',
        '已发货': '已发货'
        '已发货': '已发货',
        '已撤销': '已撤销'
    };
    return statusTextMap[statusStr] || '待发货';
};
@@ -1995,11 +1991,6 @@
 * @param row 行数据
 */
const getShippingStatusType = (row) => {
    // 如果已发货(有发货日期或车牌号),显示绿色
    if (row.shippingDate || row.shippingCarNumber) {
        return 'success';
    }
    // 获取发货状态字段
    const status = row.shippingStatus;
    
@@ -2010,11 +2001,23 @@
    
    // 状态是字符串
    const statusStr = String(status).trim();
    // 如果状态是"已撤销",显示橙色
    if (statusStr === '已撤销') {
        return 'warning';
    }
    // 如果已发货(有发货日期或车牌号),显示绿色
    if (row.shippingDate || row.shippingCarNumber) {
        return 'success';
    }
    const typeTextMap = {
        '待发货': 'info',
        '待审核': 'info',
        '审核中': 'warning',
        '审核拒绝': 'danger',
        '已撤销': 'warning',
        '审核通过': 'success',
        '已发货': 'success'
    };
@@ -2023,7 +2026,7 @@
/**
 * 判断是否可以发货
 * 只有在产品状态是充足,发货状态是待发货和审核拒绝的时候才可以发货
 * 只有在产品状态是充足,发货状态是待发货、审核拒绝和已撤销的时候才可以发货
 * @param row 行数据
 */
const canShip = (row) => {
@@ -2035,17 +2038,59 @@
    // 获取发货状态
    const shippingStatus = row.shippingStatus;
    
    // 如果状态为空或未定义,默认为"待发货"
    if (shippingStatus === null || shippingStatus === undefined || shippingStatus === '') {
        return true;
    }
    // 状态是字符串
    const statusStr = String(shippingStatus).trim();
    // 如果状态是"已撤销",允许发货
    if (statusStr === '已撤销') {
        return true;
    }
    // 如果已发货(有发货日期或车牌号),不能再次发货
    if (row.shippingDate || row.shippingCarNumber) {
        return false;
    }
    
    // 发货状态必须是"待发货"或"审核拒绝"
    const statusStr = shippingStatus ? String(shippingStatus).trim() : '';
    // 发货状态必须是"待发货"、"审核拒绝"或"已撤销"
    return statusStr === '待发货' || statusStr === '审核拒绝';
};
/**
 * 判断是否可以撤销发货
 * 只有当发货数量等于退货数量且都不为0时才可以撤销
 * @param row 行数据
 */
const canRevokeShipping = (row) => {
    const shippingNum = row.shippingNum || 0;
    const returnNum = row.returnNum || 0;
    return shippingNum > 0 && returnNum > 0 && shippingNum === returnNum;
};
/**
 * 撤销发货
 * @param row 行数据
 */
const handleRevokeShipping = (row) => {
    ElMessageBox.confirm("此操作将撤销该发货记录,是否确认?", "撤销发货", {
        confirmButtonText: "确认",
        cancelButtonText: "取消",
        type: "warning",
    })
        .then(() => {
            cancelDelivery({ id: row.id }).then(() => {
                proxy.$modal.msgSuccess("撤销成功");
                getList();
            });
        })
        .catch(() => {});
};
/**
 * 下载文件
 *
 * @param row 下载文件的相关信息对象