|
@@ -1,20 +1,27 @@
|
|
|
<template>
|
|
|
<div class="pageIndexClass">
|
|
|
<div>
|
|
|
- <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
|
|
|
- :selectConfig="selectConfig" :action-list="[
|
|
|
+ <byTable :source="sourceList.data" :tableBorder="true" :pagination="sourceList.pagination" :config="config" :loading="loading"
|
|
|
+ highlight-current-row :selectConfig="selectConfig" :hidePagination="true" :action-list="[
|
|
|
|
|
|
]" @get-list="getList">
|
|
|
|
|
|
<template #product="{ item }">
|
|
|
- <div>
|
|
|
- aaaaaaa
|
|
|
+ <div style="width:100%; ">
|
|
|
+ {{item.productName}}
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #date="{ item }">
|
|
|
- <div>
|
|
|
- <div>2024-01-09</div>
|
|
|
- <div>2024-01-18</div>
|
|
|
+ <div style="width:100%; ">
|
|
|
+ <div>{{item.createTime}} ~ {{item.deliveryPeriod}}</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-for="(row) in allDay" v-slot:[row.key]="{ index }" :key="row.key">
|
|
|
+ <div style="width:100%">
|
|
|
+ <div style="height:12px" class="is-bk"
|
|
|
+ :class="{'left-class':index>=0? isAddLeftClass(row,index):false,'right-class':index>=0? isAddRightClass(row,index):false}"
|
|
|
+ v-if="index>=0 &&sourceList.data && sourceList.data.length>0 && isAddClass(row.day,index)"></div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -64,6 +71,7 @@ import byForm from "@/components/byForm/index";
|
|
|
import QRCode from "qrcodejs2-fix";
|
|
|
import { getDateAllDay } from "@/utils/date.js";
|
|
|
import moment from "moment";
|
|
|
+import { watch } from "vue";
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const loading = ref(false);
|
|
@@ -77,7 +85,7 @@ const sourceList = ref({
|
|
|
pageSize: 10,
|
|
|
keyword: "",
|
|
|
produceStatus: "",
|
|
|
- staDeliveryPeriod: str,
|
|
|
+ beginDate: str,
|
|
|
endDeliveryPeriod: "",
|
|
|
beginTime: "",
|
|
|
endTime: "",
|
|
@@ -102,20 +110,30 @@ const statusData = ref([
|
|
|
]);
|
|
|
const allDay = ref([]);
|
|
|
const changDay = (val) => {
|
|
|
- allDay.value = getDateAllDay(val);
|
|
|
- for (let i = 0; i < allDay.value.length; i++) {
|
|
|
- const ele = allDay.value[i];
|
|
|
+ getList();
|
|
|
+ allDay.value = [];
|
|
|
+ config.value.splice(3, config.value.length - 3);
|
|
|
+ let days = getDateAllDay(val);
|
|
|
+ let list = [];
|
|
|
+ for (let i = 0; i < days.length; i++) {
|
|
|
+ const ele = days[i];
|
|
|
+ list.push({
|
|
|
+ key: "day" + ele,
|
|
|
+ day: ele,
|
|
|
+ });
|
|
|
let attrs = {
|
|
|
label: `${ele.substr(8, 10)}`,
|
|
|
- slot: ele,
|
|
|
+ slot: "day" + ele,
|
|
|
isNeedHeaderSlot: false,
|
|
|
- width: 50,
|
|
|
- // fixed: "right",
|
|
|
+ width: 40,
|
|
|
+ align: "center",
|
|
|
+ fixed: "right",
|
|
|
};
|
|
|
config.value.push({
|
|
|
attrs,
|
|
|
});
|
|
|
}
|
|
|
+ allDay.value = list;
|
|
|
};
|
|
|
const selectConfig = computed(() => [
|
|
|
{
|
|
@@ -126,11 +144,11 @@ const selectConfig = computed(() => [
|
|
|
{
|
|
|
type: "time",
|
|
|
itemType: "month",
|
|
|
- label: "生产日期",
|
|
|
+ label: "排程日期",
|
|
|
placeholder: "请选择生产日期",
|
|
|
- prop: "staDeliveryPeriod",
|
|
|
+ prop: "beginDate",
|
|
|
clearable: false,
|
|
|
- placeholderOne: "结束日期",
|
|
|
+ placeholderOne: "",
|
|
|
propOne: "",
|
|
|
fn: (val) => {
|
|
|
changDay(val);
|
|
@@ -141,97 +159,41 @@ const config = ref([
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "生产订单号",
|
|
|
- prop: "orderCode",
|
|
|
+ prop: "code",
|
|
|
width: 130,
|
|
|
- fixed: "left",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "产品",
|
|
|
- slot: "product",
|
|
|
- "min-width": 300,
|
|
|
- fixed: "left",
|
|
|
+ label: "生产日期",
|
|
|
+ slot: "date",
|
|
|
+ width: 150,
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "生产日期",
|
|
|
- slot: "date",
|
|
|
- width: 130,
|
|
|
- fixed: "left",
|
|
|
+ label: "产品",
|
|
|
+ slot: "product",
|
|
|
+ "min-width": 300,
|
|
|
},
|
|
|
},
|
|
|
]);
|
|
|
-const formData = reactive({
|
|
|
- data: {},
|
|
|
-});
|
|
|
-const formOption = reactive({
|
|
|
- inline: true,
|
|
|
- labelWidth: 100,
|
|
|
- itemWidth: 100,
|
|
|
-});
|
|
|
-const formDom = ref(null);
|
|
|
-const formConfig = computed(() => {
|
|
|
- return [
|
|
|
- {
|
|
|
- type: "input",
|
|
|
- prop: "code",
|
|
|
- label: "店铺编号",
|
|
|
- itemWidth: 100,
|
|
|
- disabled: false,
|
|
|
- },
|
|
|
- {
|
|
|
- type: "input",
|
|
|
- prop: "name",
|
|
|
- label: "店铺名称",
|
|
|
- itemWidth: 100,
|
|
|
- disabled: false,
|
|
|
- },
|
|
|
- {
|
|
|
- type: "treeSelect",
|
|
|
- prop: "deptId",
|
|
|
- label: "负责部门",
|
|
|
- data: treeData.value,
|
|
|
- propsTreeLabel: "deptName",
|
|
|
- propsTreeValue: "deptId",
|
|
|
- itemWidth: 100,
|
|
|
- disabled: false,
|
|
|
- },
|
|
|
- ];
|
|
|
-});
|
|
|
-const rules = ref({
|
|
|
- deptId: [{ required: true, message: "请选择负责部门", trigger: "change" }],
|
|
|
- name: [{ required: true, message: "请输入店铺名称", trigger: "blur" }],
|
|
|
- code: [{ required: true, message: "请输入店铺编号", trigger: "blur" }],
|
|
|
-});
|
|
|
|
|
|
-const getList = async (req) => {
|
|
|
+const getList = (req) => {
|
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
|
loading.value = true;
|
|
|
- proxy.post("/produceOrderDetail/page", sourceList.value.pagination).then(
|
|
|
+ proxy.post("/produceOrder/schedulingList", sourceList.value.pagination).then(
|
|
|
(res) => {
|
|
|
- sourceList.value.data = res.rows;
|
|
|
- sourceList.value.pagination.total = res.total;
|
|
|
+ sourceList.value.data = res.map((x, index) => ({
|
|
|
+ ...x,
|
|
|
+ id: "id" + index,
|
|
|
+ createTime: x.createTime.substr(0, 10),
|
|
|
+ deliveryPeriod: x.deliveryPeriod.substr(0, 10),
|
|
|
+ }));
|
|
|
+ // sourceList.value.pagination.total = res.total;
|
|
|
setTimeout(() => {
|
|
|
loading.value = false;
|
|
|
}, 200);
|
|
|
- const productIdList = res.rows.map((x) => x.productId);
|
|
|
- // 请求文件数据并回显
|
|
|
- if (productIdList.length > 0) {
|
|
|
- proxy.getFile(productIdList, sourceList.value.data, "productId");
|
|
|
- }
|
|
|
-
|
|
|
- const productIdListOne = res.rows.map((x) => x.contractDetailId);
|
|
|
- // 请求文件数据并回显
|
|
|
- if (productIdListOne.length > 0) {
|
|
|
- proxy.getFile(
|
|
|
- productIdListOne,
|
|
|
- sourceList.value.data,
|
|
|
- "contractDetailId",
|
|
|
- "fileListOne"
|
|
|
- );
|
|
|
- }
|
|
|
},
|
|
|
(err) => {
|
|
|
loading.value = false;
|
|
@@ -239,124 +201,41 @@ const getList = async (req) => {
|
|
|
);
|
|
|
};
|
|
|
|
|
|
-const openModal = () => {
|
|
|
- dialogVisible.value = true;
|
|
|
- modalType.value = "add";
|
|
|
- formData.data = {
|
|
|
- definition: "2",
|
|
|
- fileList: [],
|
|
|
- };
|
|
|
- if (currencyData.value && currencyData.value.length > 0) {
|
|
|
- formData.data.currency = currencyData.value[0].dictKey;
|
|
|
- formData.data.costCurrency = currencyData.value[0].dictKey;
|
|
|
- }
|
|
|
-};
|
|
|
-
|
|
|
-const submitForm = () => {
|
|
|
- formDom.value.handleSubmit((valid) => {
|
|
|
- submitLoading.value = true;
|
|
|
- proxy.post("/shopInfo/" + modalType.value, formData.data).then(
|
|
|
- (res) => {
|
|
|
- proxy.msgTip("操作成功", 1);
|
|
|
- dialogVisible.value = false;
|
|
|
- submitLoading.value = false;
|
|
|
- getList();
|
|
|
- },
|
|
|
- (err) => {
|
|
|
- submitLoading.value = false;
|
|
|
- }
|
|
|
- );
|
|
|
- });
|
|
|
-};
|
|
|
-
|
|
|
-const getDtl = (row) => {
|
|
|
- modalType.value = "edit";
|
|
|
- proxy.post("/shopInfo/detail", { id: row.id }).then((res) => {
|
|
|
- formData.data = res;
|
|
|
- dialogVisible.value = true;
|
|
|
- });
|
|
|
-};
|
|
|
-const processesData = ref([]);
|
|
|
-const getProcesses = () => {
|
|
|
- proxy
|
|
|
- .post("/productionProcesses/page", { pageNum: 1, pageSize: 9999 })
|
|
|
- .then((res) => {
|
|
|
- for (let i = 0; i < res.rows.length; i++) {
|
|
|
- const ele = res.rows[i];
|
|
|
- let attrs = {
|
|
|
- label: `[ ${ele.name} ]`,
|
|
|
- slot: ele.id,
|
|
|
- isNeedHeaderSlot: false,
|
|
|
- width: 90,
|
|
|
- fixed: "right",
|
|
|
- };
|
|
|
- config.value.push({
|
|
|
- attrs,
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- // config.value.push({
|
|
|
- // attrs: {
|
|
|
- // label: "操作",
|
|
|
- // width: "100",
|
|
|
- // align: "center",
|
|
|
- // fixed: "right",
|
|
|
- // },
|
|
|
- // renderHTML(row) {
|
|
|
- // return [
|
|
|
- // {
|
|
|
- // attrs: {
|
|
|
- // label: "打印二维码",
|
|
|
- // type: "primary",
|
|
|
- // text: true,
|
|
|
- // },
|
|
|
- // el: "button",
|
|
|
- // click() {
|
|
|
- // printQrCode(row);
|
|
|
- // },
|
|
|
- // },
|
|
|
- // ];
|
|
|
- // },
|
|
|
- // });
|
|
|
- processesData.value = res.rows;
|
|
|
- });
|
|
|
-};
|
|
|
-// getProcesses();
|
|
|
changDay(str);
|
|
|
-getList();
|
|
|
-const printData = ref({});
|
|
|
-const printQrCode = (row) => {
|
|
|
- printData.value = row;
|
|
|
- dialogVisible.value = true;
|
|
|
- nextTick(() => {
|
|
|
- proxy.$refs[row.id].innerHTML = ""; //清除二维码方法一
|
|
|
- new QRCode(proxy.$refs[row.id], {
|
|
|
- text: row.id,
|
|
|
- width: 200,
|
|
|
- height: 200,
|
|
|
- colorDark: "#000000",
|
|
|
- colorLight: "#ffffff",
|
|
|
- correctLevel: QRCode.CorrectLevel.H,
|
|
|
- });
|
|
|
- });
|
|
|
+const isAddClass = (day, index) => {
|
|
|
+ if (index >= 0 && sourceList.value.data[index]) {
|
|
|
+ let row = sourceList.value.data[index];
|
|
|
+ let start = new Date(row.createTime).getTime();
|
|
|
+ let end = new Date(row.deliveryPeriod + " 23:59:59").getTime();
|
|
|
+ let now = new Date(day + " 23:59:59").getTime();
|
|
|
+ if (now >= start && now <= end) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
-const printObj = ref({
|
|
|
- id: "pdfDom",
|
|
|
- popTitle: "",
|
|
|
- extraCss:
|
|
|
- "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
|
|
|
- extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
|
|
|
-});
|
|
|
|
|
|
-const handleClickFile = (file) => {
|
|
|
- window.open(file.fileUrl, "_blank");
|
|
|
+const isAddLeftClass = (day, index) => {
|
|
|
+ if (index >= 0 && sourceList.value.data[index]) {
|
|
|
+ let row = sourceList.value.data[index];
|
|
|
+ let start = row.createTime;
|
|
|
+ if (day.day == start) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
-
|
|
|
-const isShowCotent = (slot, item) => {
|
|
|
- if (item && item.productionProcessesList) {
|
|
|
- return item.productionProcessesList.some((x) => x.id == slot.id);
|
|
|
- } else {
|
|
|
- return false;
|
|
|
+const isAddRightClass = (day, index) => {
|
|
|
+ if (index >= 0 && sourceList.value.data[index]) {
|
|
|
+ let row = sourceList.value.data[index];
|
|
|
+ let start = row.deliveryPeriod;
|
|
|
+ if (day.day == start) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
@@ -365,4 +244,16 @@ const isShowCotent = (slot, item) => {
|
|
|
::v-deep(.el-progress__text) {
|
|
|
font-size: 14px !important;
|
|
|
}
|
|
|
+.is-bk {
|
|
|
+ background: #0066ff;
|
|
|
+}
|
|
|
+.left-class {
|
|
|
+ border-radius: 6px 0 0 6px;
|
|
|
+}
|
|
|
+.right-class {
|
|
|
+ border-radius: 0px 6px 6px 0px;
|
|
|
+}
|
|
|
+:deep(.el-table .cell) {
|
|
|
+ padding: 0px !important;
|
|
|
+}
|
|
|
</style>
|