|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<div class="pageIndexClass" style="display:flex">
|
|
|
- <div style="width:calc(65% - 10px);margin-right:10px">
|
|
|
+ <div style="width:calc(60% - 10px);margin-right:10px">
|
|
|
<byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
|
|
|
:selectConfig="selectConfig" :action-list="[
|
|
|
|
|
@@ -64,9 +64,17 @@
|
|
|
|
|
|
<template v-for="(slotItem, index) in processesData" v-slot:[slotItem.id]="{ item }" :key="slotItem.id">
|
|
|
<div style="width:100%">
|
|
|
- <span v-if="isShowCotent(slotItem,item)" style="font-weight:700;min-width:50px;line-height:18px;display:inline-block"
|
|
|
- :class="showCotentQuantity(slotItem,item)">
|
|
|
- {{showCotent(slotItem,item)}}
|
|
|
+ <span v-if="isShowCotent(slotItem,item)" style="font-size:12px">
|
|
|
+ <div style="text-align:center"><el-button type="primary" @click="openModal(item,slotItem)" text>排程</el-button></div>
|
|
|
+
|
|
|
+ <div :style="{
|
|
|
+ color:isFindCotentData(slotItem,item).schedulingCount>=item.quantity?'#70cd31':''
|
|
|
+ }">
|
|
|
+ <div v-for="record in isFindCotentData(slotItem,item).schedulingList" :key="record.id"
|
|
|
+ style="line-height:22px;display:flex;justify-content:space-between">
|
|
|
+ <span v-if="record.schedulingDate">{{record.schedulingDate.slice(5,10)}}</span> <span>{{record.quantity}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</span>
|
|
|
<div v-else class="no-bk">
|
|
|
-
|
|
@@ -75,16 +83,10 @@
|
|
|
</template>
|
|
|
</byTable>
|
|
|
</div>
|
|
|
- <div style="width:35%">
|
|
|
+ <div style="width:40%">
|
|
|
<div class="schedule-right">
|
|
|
<div class="schedule-top">
|
|
|
<el-row>
|
|
|
- <!-- <el-col :span="10" style="text-align: left">
|
|
|
- <el-select v-model="status" style="width: 110px">
|
|
|
- <el-option v-for="item in tableStatus" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
- </el-select>
|
|
|
- <el-button type="info" style="margin-left: 8px" @click="clickToday()" plain>今日</el-button>
|
|
|
- </el-col> -->
|
|
|
<el-col :span="24" style="text-align: center; height: 32px; line-height: 32px">
|
|
|
<div style="display: flex; justify-content: space-between">
|
|
|
<el-button @click="clickToday()" plain>今日</el-button>
|
|
@@ -93,9 +95,6 @@
|
|
|
<el-button :icon="ArrowRightBold" @click="nextMonth()" />
|
|
|
</div>
|
|
|
</el-col>
|
|
|
- <!-- <el-col :span="10" style="text-align: right">
|
|
|
- <el-button type="primary" @click="newSchedule()">新建日程</el-button>
|
|
|
- </el-col> -->
|
|
|
</el-row>
|
|
|
</div>
|
|
|
<div class="schedule-bottom">
|
|
@@ -106,33 +105,16 @@
|
|
|
{{ data.day.substr(8, 10) }}
|
|
|
</div>
|
|
|
<div style="width:100%">
|
|
|
- <div v-for="item in processesData" :key="item.id">
|
|
|
- {{item.name}}:99999
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <!-- <el-popover placement="left" :width="400" style="height" trigger="hover" @show="onShow(data.day)">
|
|
|
- <template #reference>
|
|
|
- <div v-if="isShow(data.day)">
|
|
|
- <div style="height:5px;margin-bottom:5px;border-radius:2px" v-for="(item,index) in judgeDay(data.day)" :key="index"
|
|
|
- :style="{ background: colorData[item]}">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <div style="height:500px;overflow:auto">
|
|
|
- <div v-for="item in showData" :key="item" style="margin-bottom:20px">
|
|
|
- <div style="display:flex">
|
|
|
- <div>颜色:</div>
|
|
|
- <div :style="{ background: colorData[item]}" style="width:20px;height:20px;border-radius:10px"></div>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- 订单号:<span v-if="rightDataObj[item]">{{rightDataObj[item]['code']}}</span>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- 产品:<span v-if="rightDataObj[item]">{{rightDataObj[item]['productName']}}</span>
|
|
|
- </div>
|
|
|
+ <div v-for="process in processesData" :key="process.id">
|
|
|
+ <div style="display:flex;justify-content:space-between;align-items:center;margin:3px 0;height:22px">
|
|
|
+ <span> {{process.name}}</span>
|
|
|
+ <span v-if="isShowDayData(data.day,process)" class="tag-active" style="display:inline-block;min-width:45px;text-align:right;">
|
|
|
+ {{isShowDayData(data.day,process).quantity}}
|
|
|
+ </span>
|
|
|
+ <!-- {{item.quantity}} -->
|
|
|
</div>
|
|
|
</div>
|
|
|
- </el-popover> -->
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-calendar>
|
|
@@ -140,201 +122,15 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-dialog :title="'打印任务单'" v-model="dialogVisible" width="840px" destroy-on-close :before-close="beforeClose">
|
|
|
- <div style="height:calc(100vh - 280px);overflow:auto;padding: 0 10px">
|
|
|
- <div id="pdfDom" style="width:100%">
|
|
|
- <!-- <div style="font-size:20px;text-align:center">
|
|
|
- {{printData.name}}
|
|
|
- </div> -->
|
|
|
- <div v-for="item in printList" :key="item.id" style="margin-bottom:20px">
|
|
|
- <div style="font-size:32px;font-weight:700;color:#000;text-align:center">
|
|
|
- 生产任务单
|
|
|
- </div>
|
|
|
- <div style="float:right;margin: 20px 0px 5px 0;">
|
|
|
- {{printTime}}
|
|
|
- </div>
|
|
|
- <table class="table" border>
|
|
|
- <tr>
|
|
|
- <td style="width:25%">
|
|
|
- <div :ref="item.id">
|
|
|
- </div>
|
|
|
- </td>
|
|
|
- <td style="width:75%">
|
|
|
- <div style="display:flex;margin-bottom:10px">
|
|
|
- <div style="width:50%">
|
|
|
- <div class="top-title">
|
|
|
- 订单号
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- {{item.orderCode}}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div style="width:50%">
|
|
|
- <div class="top-title">
|
|
|
- 交期
|
|
|
- </div>
|
|
|
- <div v-if="item.deliveryPeriod">
|
|
|
- {{item.deliveryPeriod.substr(0,10)}}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div style="display:flex;margin-bottom:10px">
|
|
|
- <div style="width:50%">
|
|
|
- <div class="top-title">
|
|
|
- 产品编码
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- {{item.productCode}}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div style="width:50%">
|
|
|
- <div class="top-title">
|
|
|
- 生产数量
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- {{item.quantity}}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div style="margin-bottom:10px">
|
|
|
- <div class="top-title">
|
|
|
- 产品名称
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- {{item.productName}}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div style="margin-bottom:10px">
|
|
|
- <div class="top-title">
|
|
|
- 产品尺寸(cm)
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- {{item.productLength}} * {{item.productWidth}} * {{item.productHeight}}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td style="text-align:center" rowspan="4">
|
|
|
- <div>
|
|
|
- <div style="font-weight:700">产品图</div>
|
|
|
- <img v-if="item.fileList &&item.fileList.length > 0" class="bigImg" :src="item.fileList[0].fileUrl" alt="">
|
|
|
- </div>
|
|
|
- <div style="margin-top:20px">
|
|
|
- <div style="font-weight:700">设计图</div>
|
|
|
- <img v-if="item.fileListOne &&item.fileListOne.length > 0" class="bigImg" :src="item.fileListOne[0].fileUrl" alt="">
|
|
|
- </div>
|
|
|
- </td>
|
|
|
- <td style="height:60px;vertical-align:top">
|
|
|
- <div>
|
|
|
- <div class="top-title">
|
|
|
- 产品备注
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- {{item.productRemark}}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td style="height:60px;vertical-align:top">
|
|
|
- <div class="top-title">
|
|
|
- 生产工序
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <!-- <el-checkbox v-for="proess in item.productionTaskProgressList" :key="proess.processesId" :label="proess.progressName"
|
|
|
- size="small" /> -->
|
|
|
- <span v-for="(proess,index) in item.productionTaskProgressList" :key="proess.processesId">{{proess.progressName}} <span
|
|
|
- v-if="index<item.productionTaskProgressList.length-1"> > </span> </span>
|
|
|
- </div>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td style="height:107px">
|
|
|
- <div style="margin-bottom:10px">
|
|
|
- <div class="top-title">
|
|
|
- 原材料编码
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- {{item.rawMaterialCode}}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <div class="top-title">
|
|
|
- 原材料名称
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- {{item.rawMaterialName}}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td style="vertical-align:top">
|
|
|
- <div class="top-title">BOM</div>
|
|
|
- <div>
|
|
|
- <table border class="table son">
|
|
|
- <tr>
|
|
|
- <td style="width:85%">名称</td>
|
|
|
- <!-- <td style="width:15%">单价</td> -->
|
|
|
- <td style="width:15%">数量</td>
|
|
|
- </tr>
|
|
|
- <tr v-for="son in item.contractProductBomList" :key="son.id">
|
|
|
- <td>
|
|
|
- <div>
|
|
|
- {{son.productCode}}
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- {{son.productName}}
|
|
|
- </div>
|
|
|
- </td>
|
|
|
- <!-- <td>{{son.price}}</td> -->
|
|
|
- <td>{{son.quantity}}</td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
-
|
|
|
- </table>
|
|
|
- <div style="page-break-after: always"></div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <template #footer>
|
|
|
- <el-button @click="dialogVisible = false" size="defualt">取 消</el-button>
|
|
|
- <el-button type="primary" v-print="printObj" size="defualt">打 印</el-button>
|
|
|
- </template>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
- <el-dialog title="备注" v-model="remarkDialog" width="500" destroy-on-close v-if="remarkDialog">
|
|
|
+ <el-dialog :title="'排程'" v-model="dialogVisible" width="500" destroy-on-close>
|
|
|
<byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom" v-loading="submitLoading">
|
|
|
</byForm>
|
|
|
<template #footer>
|
|
|
- <el-button @click="remarkDialog = false" size="defualt" v-debounce>取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitForm()" size="defualt" v-debounce>
|
|
|
- 确 定
|
|
|
- </el-button>
|
|
|
+ <el-button @click="dialogVisible = false" size="defualt">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm()" size="defualt">提 交</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog title="记录查看" v-model="recordDialog" width="70%" destroy-on-close v-if="recordDialog">
|
|
|
- <byForm :formConfig="recordFormConfig" :formOption="recordFormOption" v-model="formData.recordData">
|
|
|
- <template #detail1>
|
|
|
- <div style="width:100%">
|
|
|
- a
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template #detail2>
|
|
|
- <div style="width:100%">
|
|
|
- b
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </byForm>
|
|
|
- <template #footer>
|
|
|
- <el-button @click="recordDialog = false" size="defualt" v-debounce>关闭</el-button>
|
|
|
- </template>
|
|
|
- </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -378,13 +174,17 @@ const statusData = ref([
|
|
|
value: "0",
|
|
|
},
|
|
|
{
|
|
|
- label: "进行中",
|
|
|
+ label: "生产中",
|
|
|
value: "1",
|
|
|
},
|
|
|
{
|
|
|
- label: "已完成",
|
|
|
+ label: "生产完成",
|
|
|
value: "2",
|
|
|
},
|
|
|
+ {
|
|
|
+ label: "已出库",
|
|
|
+ value: "10",
|
|
|
+ },
|
|
|
]);
|
|
|
|
|
|
const isOverdueData = ref([
|
|
@@ -400,7 +200,7 @@ const isOverdueData = ref([
|
|
|
|
|
|
const selectConfig = computed(() => [
|
|
|
// {
|
|
|
- // label: "生产公司",
|
|
|
+ // label: "工厂",
|
|
|
// prop: "companyId",
|
|
|
// data: companyData.value,
|
|
|
// },
|
|
@@ -475,7 +275,7 @@ const config = ref([
|
|
|
// },
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "生产公司",
|
|
|
+ label: "工厂",
|
|
|
prop: "companyName",
|
|
|
width: 100,
|
|
|
// align: "center",
|
|
@@ -586,16 +386,22 @@ const config = ref([
|
|
|
attrs: {
|
|
|
label: "交期",
|
|
|
prop: "deliveryPeriod",
|
|
|
- width: 160,
|
|
|
+ width: 100,
|
|
|
},
|
|
|
- },
|
|
|
- {
|
|
|
- attrs: {
|
|
|
- label: "投产时间",
|
|
|
- prop: "produceTime",
|
|
|
- width: 160,
|
|
|
+ render(val) {
|
|
|
+ if (val) {
|
|
|
+ return val.slice(0, 10);
|
|
|
+ }
|
|
|
+ return "";
|
|
|
},
|
|
|
},
|
|
|
+ // {
|
|
|
+ // attrs: {
|
|
|
+ // label: "投产时间",
|
|
|
+ // prop: "produceTime",
|
|
|
+ // width: 160,
|
|
|
+ // },
|
|
|
+ // },
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "完成时间",
|
|
@@ -632,17 +438,29 @@ const formDom = ref(null);
|
|
|
const formConfig = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
- type: "input",
|
|
|
- prop: "remark",
|
|
|
- itemType: "textarea",
|
|
|
- label: "备注",
|
|
|
+ type: "date",
|
|
|
+ prop: "schedulingDate",
|
|
|
+ itemType: "date",
|
|
|
+ label: "排程日期",
|
|
|
itemWidth: 100,
|
|
|
disabled: false,
|
|
|
},
|
|
|
+ {
|
|
|
+ type: "number",
|
|
|
+ prop: "quantity",
|
|
|
+ label: "数量",
|
|
|
+ precision: 0,
|
|
|
+ min: 0,
|
|
|
+ controls: false,
|
|
|
+ itemWidth: 100,
|
|
|
+ },
|
|
|
];
|
|
|
});
|
|
|
const rules = ref({
|
|
|
- remark: [{ required: true, message: "请输入备注", trigger: "blur" }],
|
|
|
+ schedulingDate: [
|
|
|
+ { required: true, message: "请选择排程日期", trigger: "change" },
|
|
|
+ ],
|
|
|
+ quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
|
|
|
});
|
|
|
|
|
|
const getList = async (req) => {
|
|
@@ -719,58 +537,26 @@ const getList = async (req) => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-const printList = ref([]);
|
|
|
-
|
|
|
-const selectIds = ref([]);
|
|
|
-const selectRow = (data) => {
|
|
|
- selectIds.value = data.map((x) => x.id);
|
|
|
-};
|
|
|
-const printTime = ref("");
|
|
|
-const openModal = () => {
|
|
|
- proxy.msgTip("请稍后", 2);
|
|
|
- proxy
|
|
|
- .post("/produceOrderDetail/detailByIds", { taskIds: selectIds.value })
|
|
|
- .then((res) => {
|
|
|
- printList.value = res;
|
|
|
- for (let i = 0; i < printList.value.length; i++) {
|
|
|
- const iele = printList.value[i];
|
|
|
- for (let j = 0; j < sourceList.value.data.length; j++) {
|
|
|
- const jele = sourceList.value.data[j];
|
|
|
- if (iele.id == jele.id) {
|
|
|
- iele.fileList = jele.fileList;
|
|
|
- iele.fileListOne = jele.fileListOne;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- printTime.value = moment().format("yyyy-MM-DD HH:mm:ss");
|
|
|
- dialogVisible.value = true;
|
|
|
- nextTick(() => {
|
|
|
- for (let i = 0; i < printList.value.length; i++) {
|
|
|
- const row = printList.value[i];
|
|
|
- proxy.$refs[row.id][0].innerHTML = ""; //清除二维码方法一
|
|
|
- new QRCode(proxy.$refs[row.id][0], {
|
|
|
- text: row.id,
|
|
|
- width: 200,
|
|
|
- height: 200,
|
|
|
- colorDark: "#000000",
|
|
|
- colorLight: "#ffffff",
|
|
|
- correctLevel: QRCode.CorrectLevel.H,
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
+const openModal = (item, sonItem) => {
|
|
|
+ formData.data = {
|
|
|
+ taskId: item.id,
|
|
|
+ processesId: sonItem.id,
|
|
|
+ schedulingDate: "",
|
|
|
+ quantity: null,
|
|
|
+ };
|
|
|
+ dialogVisible.value = true;
|
|
|
};
|
|
|
|
|
|
const submitForm = () => {
|
|
|
formDom.value.handleSubmit((valid) => {
|
|
|
submitLoading.value = true;
|
|
|
- proxy.post("/produceOrderDetail/editRemark", formData.data).then(
|
|
|
+ proxy.post("/productionScheduling/add", formData.data).then(
|
|
|
(res) => {
|
|
|
proxy.msgTip("操作成功", 1);
|
|
|
- remarkDialog.value = false;
|
|
|
+ dialogVisible.value = false;
|
|
|
submitLoading.value = false;
|
|
|
getList();
|
|
|
+ getRightData();
|
|
|
},
|
|
|
(err) => {
|
|
|
submitLoading.value = false;
|
|
@@ -797,7 +583,7 @@ const getProcesses = () => {
|
|
|
label: `[ ${ele.name} ]`,
|
|
|
slot: ele.id,
|
|
|
isNeedHeaderSlot: false,
|
|
|
- width: 90,
|
|
|
+ width: 100,
|
|
|
align: "center",
|
|
|
fixed: "right",
|
|
|
};
|
|
@@ -845,26 +631,6 @@ const getProcesses = () => {
|
|
|
};
|
|
|
getProcesses();
|
|
|
getList();
|
|
|
-const printType = ref(false);
|
|
|
-
|
|
|
-const printQrCode = (row) => {
|
|
|
- printType.value = true;
|
|
|
- selectIds.value = [row.id];
|
|
|
- openModal();
|
|
|
-};
|
|
|
-const beforeClose = () => {
|
|
|
- if (printType.value) {
|
|
|
- selectIds.value = [];
|
|
|
- }
|
|
|
- dialogVisible.value = 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");
|
|
@@ -879,6 +645,26 @@ const isShowCotent = (slot, item) => {
|
|
|
return false;
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
+const isFindCotentData = (slot, item) => {
|
|
|
+ if (item && item.productionTaskProgressList) {
|
|
|
+ let current = item.productionTaskProgressList.find(
|
|
|
+ (x) => x.processesId == slot.id
|
|
|
+ );
|
|
|
+ if (
|
|
|
+ current &&
|
|
|
+ current.schedulingList &&
|
|
|
+ current.schedulingList.length > 0
|
|
|
+ ) {
|
|
|
+ return current;
|
|
|
+ } else {
|
|
|
+ return {
|
|
|
+ schedulingList: [],
|
|
|
+ schedulingCount: 0,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
const showCotent = (slot, item) => {
|
|
|
if (item && item.productionTaskProgressList) {
|
|
|
const current = item.productionTaskProgressList.find(
|
|
@@ -971,7 +757,7 @@ const month = ref(moment().format("yyyy年MM月"));
|
|
|
const monthOne = ref(moment().format("yyyy-MM"));
|
|
|
|
|
|
const calendar = ref(null);
|
|
|
-const rightData = ref([]);
|
|
|
+const rightData = ref({});
|
|
|
const rightDataObj = ref({});
|
|
|
const colorData = ref({});
|
|
|
let colorList = [
|
|
@@ -989,37 +775,32 @@ let colorList = [
|
|
|
"#FFB3FF",
|
|
|
"#FFFF33",
|
|
|
];
|
|
|
-const getRightData = () => {
|
|
|
- proxy
|
|
|
- .post("/produceOrder/schedulingList", {
|
|
|
- beginDate: monthOne.value,
|
|
|
- companyId: sourceList.value.pagination.companyId,
|
|
|
- })
|
|
|
- .then(
|
|
|
- (res) => {
|
|
|
- rightDataObj.value = {};
|
|
|
- rightData.value = res.map((x, index) => ({
|
|
|
- ...x,
|
|
|
- produceTimeOne: x.produceTime,
|
|
|
- produceTime: x.produceTime.substr(0, 10),
|
|
|
- deliveryPeriod: x.deliveryPeriod.substr(0, 10),
|
|
|
- }));
|
|
|
|
|
|
- for (let i = 0; i < res.length; i++) {
|
|
|
- const ele = res[i];
|
|
|
- rightDataObj.value[ele.id] = ele;
|
|
|
- if (i <= 12) {
|
|
|
- colorData.value[ele.id] = colorList[i];
|
|
|
- } else {
|
|
|
- let index = Math.floor(i % 12);
|
|
|
- colorData.value[ele.id] = colorList[index];
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- (err) => {
|
|
|
- loading.value = false;
|
|
|
- }
|
|
|
- );
|
|
|
+function getLastDayOfMonth() {
|
|
|
+ // 设置指定的月份
|
|
|
+ let date = new Date(monthOne.value + "-01");
|
|
|
+ // 将日期设置为下个月的第一天
|
|
|
+ date.setMonth(date.getMonth() + 1);
|
|
|
+ // 将日期设置为上个月的最后一天
|
|
|
+ date.setDate(date.getDate() - 1);
|
|
|
+ // 返回月份的最后一天
|
|
|
+ return date.getDate();
|
|
|
+}
|
|
|
+
|
|
|
+const getRightData = () => {
|
|
|
+ if (monthOne.value.includes("-")) {
|
|
|
+ proxy
|
|
|
+ .post("/productionScheduling/listMap", {
|
|
|
+ beginTime: monthOne.value + "-01",
|
|
|
+ endTime: monthOne.value + "-" + getLastDayOfMonth(),
|
|
|
+ })
|
|
|
+ .then(
|
|
|
+ (res) => {
|
|
|
+ rightData.value = res;
|
|
|
+ },
|
|
|
+ (err) => {}
|
|
|
+ );
|
|
|
+ }
|
|
|
};
|
|
|
getRightData();
|
|
|
|
|
@@ -1030,51 +811,9 @@ const clickToday = () => {
|
|
|
getRightData();
|
|
|
};
|
|
|
|
|
|
-const isShow = (day) => {
|
|
|
- let nowDay = new Date(day + " 23:59:59").getTime();
|
|
|
- let flag = false;
|
|
|
- for (let i = 0; i < rightData.value.length; i++) {
|
|
|
- const e = rightData.value[i];
|
|
|
- let startDay = new Date(e.produceTime).getTime();
|
|
|
- let endDay = new Date(e.deliveryPeriod + " 23:59:59").getTime();
|
|
|
- if (nowDay >= startDay && nowDay <= endDay) {
|
|
|
- flag = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- return flag;
|
|
|
-};
|
|
|
-
|
|
|
-const judgeDay = (day) => {
|
|
|
- // return dateList.value[day] && dateList.value[day].length > 0;
|
|
|
- let nowDay = new Date(day + " 23:59:59").getTime();
|
|
|
- let rows = [];
|
|
|
- for (let i = 0; i < rightData.value.length; i++) {
|
|
|
- const e = rightData.value[i];
|
|
|
- let startDay = new Date(e.produceTime).getTime();
|
|
|
- let endDay = new Date(e.deliveryPeriod + " 23:59:59").getTime();
|
|
|
- if (nowDay >= startDay && nowDay <= endDay) {
|
|
|
- rows.push(e.id);
|
|
|
- }
|
|
|
- }
|
|
|
- return rows;
|
|
|
-};
|
|
|
-
|
|
|
-const showData = ref([]);
|
|
|
-const onShow = (day) => {
|
|
|
- let rows = judgeDay(day);
|
|
|
- showData.value = rows;
|
|
|
-};
|
|
|
-
|
|
|
-const getData = (id, att) => {
|
|
|
- const current = rightData.value.find((x) => x.id == id);
|
|
|
- if (current && current[att]) {
|
|
|
- return current[att];
|
|
|
- }
|
|
|
-};
|
|
|
-
|
|
|
const selectDate = (val) => {
|
|
|
calendar.value.selectDate(val);
|
|
|
+ getRightData();
|
|
|
};
|
|
|
|
|
|
const prevMonth = () => {
|
|
@@ -1083,15 +822,14 @@ const prevMonth = () => {
|
|
|
).format("yyyy年MM月");
|
|
|
monthOne.value = moment(moment(month.value, "yyyy年MM月")).format("yyyy-MM");
|
|
|
selectDate("prev-month");
|
|
|
- getRightData();
|
|
|
};
|
|
|
+
|
|
|
const nextMonth = () => {
|
|
|
month.value = moment(
|
|
|
moment(month.value, "yyyy年MM月").add(+1, "month").calendar()
|
|
|
).format("yyyy年MM月");
|
|
|
monthOne.value = moment(moment(month.value, "yyyy年MM月")).format("yyyy-MM");
|
|
|
selectDate("next-month");
|
|
|
- getRightData();
|
|
|
};
|
|
|
|
|
|
watch(
|
|
@@ -1106,6 +844,19 @@ watch(
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
+
|
|
|
+const isShowDayData = (day, process) => {
|
|
|
+ if (rightData.value[day] && rightData.value[day].length > 0) {
|
|
|
+ let current = rightData.value[day].find((x) => x.processesId == process.id);
|
|
|
+ if (current) {
|
|
|
+ return current;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -1205,5 +956,6 @@ watch(
|
|
|
// min-height: calc((100vh - 100px - 20px - 83px - 80px) / 5);
|
|
|
height: auto;
|
|
|
overflow-y: hidden;
|
|
|
+ padding: 4px;
|
|
|
}
|
|
|
</style>
|