123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- <template>
- <el-card class="box-card">
- <byTable
- :source="sourceList.data"
- :pagination="sourceList.pagination"
- :config="config"
- :loading="loading"
- :searchConfig="searchConfig"
- highlight-current-row
- @get-list="getList"
- @clickReset="clickReset"
- @changeRadioGroup="changeRadioGroup">
- <template #code="{ item }">
- <div>
- <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickCode(item)">{{ item.code }}</a>
- </div>
- </template>
- <template #address="{ item }">
- <div>{{ item.province }}, {{ item.city }}, {{ item.county }}, {{ item.detailedAddress }}</div>
- </template>
- </byTable>
- </el-card>
- </template>
- <script setup>
- import byTable from "/src/components/byTable/index";
- import { getNearDays } from "/src/utils/util";
- const { proxy } = getCurrentInstance();
- const sourceList = ref({
- data: [],
- pagination: {
- total: 0,
- pageNum: 1,
- pageSize: 10,
- orderCode: "",
- orderWlnCode: "",
- skuSpecCode: "",
- skuSpecName: "",
- bomSpecCode: "",
- bomSpecName: "",
- productionWorkOrderCode: "",
- beginTime: "",
- endTime: "",
- type: 3,
- },
- });
- const loading = ref(false);
- const searchConfig = computed(() => {
- return [
- {
- type: "input",
- prop: "orderCode",
- label: "订单号",
- },
- {
- type: "input",
- prop: "orderWlnCode",
- label: "万里牛单号",
- },
- {
- type: "input",
- prop: "skuSpecCode",
- label: "SKU品号",
- },
- {
- type: "input",
- prop: "skuSpecName",
- label: "SKU品名",
- },
- {
- type: "input",
- prop: "bomSpecCode",
- label: "BOM品号",
- },
- {
- type: "input",
- prop: "bomSpecName",
- label: "BOM品名",
- },
- {
- type: "input",
- prop: "productionWorkOrderCode",
- label: "工单号",
- },
- {
- type: "radio-group",
- prop: "type",
- label: "交期",
- data: [
- {
- dictKey: 1,
- dictValue: "近3天",
- },
- {
- dictKey: 3,
- dictValue: "近7天",
- },
- {
- dictKey: 15,
- dictValue: "近31天",
- },
- ],
- },
- {
- type: "date",
- propList: ["beginTime", "endTime"],
- label: "日期",
- },
- ];
- });
- const config = computed(() => {
- return [
- {
- attrs: {
- label: "订单号",
- prop: "orderCode",
- width: 180,
- },
- },
- {
- attrs: {
- label: "万里牛单号",
- prop: "orderWlnCode",
- width: 150,
- },
- },
- {
- attrs: {
- label: "SKU品号",
- prop: "skuSpecCode",
- width: 140,
- },
- },
- {
- attrs: {
- label: "SKU品名",
- prop: "skuSpecName",
- 'min-width': 220,
- },
- },
- {
- attrs: {
- label: "BOM品号",
- prop: "bomSpecCode",
- width: 140,
- },
- },
- {
- attrs: {
- label: "BOM品名",
- prop: "bomSpecName",
- 'min-width': 280,
- },
- },
- {
- attrs: {
- label: "生产状态",
- prop: "status",
- width: 100,
- },
- render(val) {
- if (val == 0) {
- return "待投产";
- }
- },
- },
- // {
- // attrs: {
- // label: "工艺路线",
- // prop: "departmentName",
- // width: 120,
- // },
- // },
- // {
- // attrs: {
- // label: "投产时间",
- // prop: "departmentName",
- // width: 160,
- // align: "center",
- // fixed: "right",
- // },
- // },
- {
- attrs: {
- label: "完成时间",
- prop: "completeTime",
- width: 160,
- align: "center",
- fixed: "right",
- },
- },
- // {
- // attrs: {
- // label: "生产用时",
- // prop: "departmentName",
- // width: 160,
- // align: "center",
- // fixed: "right",
- // },
- // },
- ];
- });
- const getList = async (req, status) => {
- if (status) {
- sourceList.value.pagination = {
- pageNum: sourceList.value.pagination.pageNum,
- pageSize: sourceList.value.pagination.pageSize,
- type: 3,
- beginTime: getNearDays(3).beginTime,
- endTime: getNearDays(3).endTime,
- };
- } else {
- sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
- }
- loading.value = true;
- proxy.post("/productionWorkOrder/page", sourceList.value.pagination).then((res) => {
- sourceList.value.data = res.rows;
- sourceList.value.pagination.total = res.total;
- setTimeout(() => {
- loading.value = false;
- }, 200);
- });
- };
- getList({ beginTime: getNearDays(3).beginTime, endTime: getNearDays(3).endTime });
- const clickReset = () => {
- getList("", true);
- };
- const changeRadioGroup = () => {
- getList({ beginTime: getNearDays(sourceList.value.pagination.type).beginTime, endTime: getNearDays(sourceList.value.pagination.type).endTime });
- };
- const clickCode = (row) => {
- proxy.$router.replace({
- path: "/addOrder",
- query: {
- detailId: row.id,
- text: "订单详情",
- random: proxy.random(),
- orderInquiry: true,
- },
- });
- };
- </script>
- <style lang="scss" scoped>
- :deep(.el-dialog) {
- margin-top: 10px !important;
- margin-bottom: 10px !important;
- }
- </style>
|