This commit is contained in:
lb 2023-09-14 14:49:36 +08:00
parent 1bd826b21c
commit 1f99830600
12 changed files with 142 additions and 42 deletions

View File

@ -40,8 +40,8 @@
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.103:8080/pms-am'; // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.103:8080/pms-am';
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.49:8080/pms-am'; // tengyun // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.49:8080/pms-am'; // tengyun
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.67:8080/pms-am'; // wenzhang // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.67:8080/pms-am'; // wenzhang
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.62:8080/pms-am'; // tao window.SITE_CONFIG['apiURL'] = 'http://192.168.1.62:8080/pms-am'; // tao
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.21:8080/pms-am'; // xv // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.21:8080/pms-am'; // xv
// window.SITE_CONFIG['apiURL'] = 'http://localhost:3000/p//////ms-am'; // xv // window.SITE_CONFIG['apiURL'] = 'http://localhost:3000/p//////ms-am'; // xv
</script> </script>
<% } %> <% } %>

View File

@ -33,6 +33,9 @@ export default function () {
}, },
]; ];
const now = new Date();
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
const today = new Date(y, m, d, 0, 0, 0, 0).getTime();
const headFormFields = [ const headFormFields = [
{ {
prop: "key", prop: "key",
@ -85,6 +88,7 @@ export default function () {
"start-placeholder": "开始时间", "start-placeholder": "开始时间",
"end-placeholder": "结束时间", "end-placeholder": "结束时间",
}, },
default: { value: [today - 24 * 7 * 1000 * 3600, today + 3600 * 24 * 1000] },
}, },
{ {
button: { button: {

View File

@ -60,7 +60,9 @@ export default function () {
} }
}; };
const now = new Date().getTime(); const now = new Date()
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()]
const today = new Date(y, m, d, 0, 0, 0, 0).getTime()
const headFormFields = [ const headFormFields = [
{ {
prop: "material", prop: "material",
@ -96,7 +98,7 @@ export default function () {
"start-placeholder": "开始时间", "start-placeholder": "开始时间",
"end-placeholder": "结束时间", "end-placeholder": "结束时间",
}, },
default: { value: [now - 3600 * 24 * 7 * 1000, now] }, default: { value: [today - 3600 * 24 * 1000 * 7, today + 3600 * 1000 * 24] },
}, },
{ {
button: { button: {

View File

@ -60,7 +60,9 @@ export default function () {
} }
}; };
const now = new Date().getTime(); const now = new Date();
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
const today = new Date(y, m, d, 0, 0, 0, 0).getTime();
const headFormFields = [ const headFormFields = [
{ {
prop: "material", prop: "material",
@ -96,7 +98,7 @@ export default function () {
"start-placeholder": "开始时间", "start-placeholder": "开始时间",
"end-placeholder": "结束时间", "end-placeholder": "结束时间",
}, },
default: { value: [now - 3600 * 24 * 7 * 1000, now] }, default: { value: [today - 24 * 7 * 1000 * 3600, today + 3600 * 24 * 1000] },
}, },
{ {
button: { button: {

View File

@ -28,7 +28,9 @@ export default function () {
}, },
]; ];
const now = new Date().getTime(); const now = new Date();
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
const today = new Date(y, m, d, 0, 0, 0, 0).getTime();
const headFormFields = [ const headFormFields = [
{ {
input: true, input: true,
@ -58,7 +60,7 @@ export default function () {
"start-placeholder": "开始时间", "start-placeholder": "开始时间",
"end-placeholder": "结束时间", "end-placeholder": "结束时间",
}, },
default: { value: [now - 3600 * 24 * 7 * 1000, now] }, default: { value: [today - 24 * 7 * 1000 * 3600, today + 3600 * 24 * 1000] },
}, },
{ {
button: { button: {

View File

@ -52,7 +52,9 @@ export default function () {
}, },
]; ];
const now = new Date().getTime(); const now = new Date();
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
const today = new Date(y, m, d, 0, 0, 0, 0).getTime();
const headFormFields = [ const headFormFields = [
{ {
prop: "orderCode", prop: "orderCode",
@ -119,6 +121,7 @@ export default function () {
"start-placeholder": "开始时间", "start-placeholder": "开始时间",
"end-placeholder": "结束时间", "end-placeholder": "结束时间",
}, },
default: { value: [today - 24 * 7 * 1000 * 3600, today + 3600 * 24 * 1000] },
}, },
{ {
button: { button: {

View File

@ -15,7 +15,7 @@
layout="total, sizes, prev, pager, next, jumper"></el-pagination> layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</div> </div>
</section> </section>
<section class="container-content"> <section class="container-content" v-if="dailyStorage.length || middleStorage.length || unknownStorage.length">
<div class="dialy-storage" v-if="dailyStorage.length"> <div class="dialy-storage" v-if="dailyStorage.length">
<h3 <h3
class="" class=""
@ -38,7 +38,7 @@
:qty="st.qty ?? 0" :qty="st.qty ?? 0"
:storage="st.name" :storage="st.name"
color="#8899ff" color="#8899ff"
:material="st.material ?? '默认物料'" :material="st.materialName ?? '默认物料'"
:total="2" :total="2"
:unit-value="st.unitDictValue" :unit-value="st.unitDictValue"
:ratio="st.ratio" /> :ratio="st.ratio" />
@ -66,7 +66,7 @@
:qty="st.qty ?? 0" :qty="st.qty ?? 0"
:storage="st.name" :storage="st.name"
color="#99aa11" color="#99aa11"
:material="st.material ?? '默认物料'" :material="st.materialName ?? '默认物料'"
:total="2" :total="2"
:unit-value="st.unitDictValue" :unit-value="st.unitDictValue"
:ratio="st.ratio" /> :ratio="st.ratio" />
@ -94,13 +94,17 @@
:qty="st.qty ?? 0" :qty="st.qty ?? 0"
color="#3388ff" color="#3388ff"
:storage="st.name" :storage="st.name"
:material="st.material ?? '默认物料'" :material="st.materialName ?? '默认物料'"
:total="2" :total="2"
:unit-value="st.unitDictValue" :unit-value="st.unitDictValue"
:ratio="st.ratio" /> :ratio="st.ratio" />
</div> </div>
</div> </div>
</section> </section>
<div v-else style="color: #ccc; letter-spacing: 1px; font-size: 18px; padding: 12px;">
无数据
</div>
</div> </div>
</template> </template>

View File

@ -600,7 +600,7 @@ export default {
customerId: null, customerId: null,
shortDesc: null, shortDesc: null,
remark: null, remark: null,
paperboard: null paperboard: null,
}, },
visible: false, visible: false,
requestList: [ requestList: [
@ -770,7 +770,6 @@ export default {
* 因为每个页面也许有独立的需求链 * 因为每个页面也许有独立的需求链
*/ */
handleBomChange(bomID) { handleBomChange(bomID) {
//console.log("[handleBomChange] val is: ", bomID);
const target = this.cachedList.bom.find((item) => item.id === bomID); const target = this.cachedList.bom.find((item) => item.id === bomID);
// bomId dataForm // bomId dataForm
this.bomId = bomID; this.bomId = bomID;
@ -826,29 +825,29 @@ export default {
if (res && res.code === 0) { if (res && res.code === 0) {
this.dataForm = __pick(res.data, Object.keys(this.dataForm)); this.dataForm = __pick(res.data, Object.keys(this.dataForm));
return res.data.bomId; // bomId return { bomId: res.data.bomId, bomCode: res.data.bomCode }; // bomId
} else { } else {
this.$message({ throw new Error(`${res.code}: ${res.msg}`);
message: `${res.code}: ${res.msg}`,
type: "error",
duration: 1500,
});
} }
}) })
.then((bomId) => { .then(({ bomId, bomCode }) => {
return this.$http({ return Promise.all([
url: "/pms/bom/pageById", this.$http({
method: "get", url: "/pms/bom/pageById",
params: { method: "get",
limit: 999, params: {
page: 1, limit: 999,
key: "", page: 1,
id: bomId, key: "",
}, id: bomId,
}); },
}),
this.getBomVersionList({ code: bomCode }),
]);
}) })
.then(({ data: res }) => { .then(([{ data: res }]) => {
if (res.code == 0) { if (res.code == 0) {
this.cachedList.bom = res.data.list;
this.bomOptions = res.data.list.map((item) => ({ this.bomOptions = res.data.list.map((item) => ({
name: item.name, name: item.name,
label: item.code, label: item.code,

View File

@ -8,39 +8,115 @@
<div class="list-view-with-head" ref="pointer-loading-ref"> <div class="list-view-with-head" ref="pointer-loading-ref">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="6"> <el-col :span="6">
<el-input v-model="hu" placeholder="扫描HU号" @keydown.enter.native="handleReport"></el-input> <el-input
ref="hu"
v-model="hu"
placeholder="扫描HU号"
@keydown.enter.native="handleReport"></el-input>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="1.5">
<el-button @click="handleReport" type="primary" plain>报工</el-button> <el-button @click="handleReport" type="primary" plain>报工</el-button>
</el-col> </el-col>
<el-col :span="3">
<el-select v-model="team" placeholder="班次" style="width: 100%">
<el-option label="早班" value="0">早班</el-option>
<el-option label="中班" value="1">中班</el-option>
<el-option label="晚班" value="2">晚班</el-option>
</el-select>
</el-col>
</el-row>
<el-row style="margin-top: 18px">
<BaseListTable
v-if="dataList.length"
v-loading="tableLoading"
:table-config="tableConfig.table"
:column-config="tableConfig.column"
:table-data="dataList"
:page="listQuery.page"
:size="listQuery.limit"
@operate-event="handleOperate"
:refresh-layout-key="refreshLayoutKey" />
<div style="color: #ccc; letter-spacing: 1px" v-else>暂无数据</div>
</el-row> </el-row>
</div> </div>
</template> </template>
<script> <script>
// import BaseSearchForm from "@/components/BaseSearchForm.vue"; // import BaseSearchForm from "@/components/BaseSearchForm.vue";
import BaseListTable from "@/components/BaseListTable.vue";
import moment from "moment";
export default { export default {
name: "PackReport", name: "PackReport",
// components: { BaseSearchForm }, components: { BaseListTable },
data() { data() {
return { return {
// hu: "40032179#300000624000000016", // hu: "40032179#300000624000000016",
hu: '' hu: "",
team: "",
tableLoading: false,
tableConfig: {
table: null,
column: [],
},
dataList: [],
listQuery: {
page: 1,
limit: 10,
},
refreshLayoutKey: Math.random(),
}; };
}, },
activated() {
this.$refs.hu.focus();
},
mounted() {
this.getList();
},
methods: { methods: {
handleOperate() {},
handleReport() {},
async getList() {
const now = new Date();
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
const today = new Date(y, m, d, 0, 0, 0).getTime();
const { data: res } = await this.$axios({
url: "/pms-am/pms/workReport/pageView",
method: "post",
data: {
externalCode: 2,
startTime: moment(today - 24 * 7 * 60 * 60 * 1000).format("YYYY-MM-DDTHH:mm:ss"),
endTime: moment(today + 24 * 60 * 60 * 1000).format("YYYY-MM-DDTHH:mm:ss"),
page: this.listQuery.page,
limit: this.listQuery.limit,
},
});
if (res.code == 0) {
this.dataList = res.data;
} else {
this.$message.error(res.msg);
}
},
handleReport() { handleReport() {
this.$http({ this.$http({
url: "/pms/workReport/packReport", url: "/pms/workReport/packReport",
method: "post", method: "post",
data: this.hu, data: {
hu: this.hu,
team: this.team,
},
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
}, },
}).then(({ data: res }) => { }).then(({ data: res }) => {
if (res.code == 0) { if (res.code == 0) {
this.$message.success("报工成功"); this.$message.success("报工成功");
this.getList();
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }

View File

@ -29,6 +29,9 @@ export default function () {
}, },
]; ];
const now = new Date();
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
const today = new Date(y, m, d, 0, 0, 0, 0).getTime();
const headFormFields = [ const headFormFields = [
// { // {
// prop: 'code', // prop: 'code',
@ -49,6 +52,7 @@ export default function () {
"start-placeholder": "开始时间", "start-placeholder": "开始时间",
"end-placeholder": "结束时间", "end-placeholder": "结束时间",
}, },
default: { value: [today - 24 * 7 * 1000 * 3600, today + 3600 * 24 * 1000] },
}, },
{ {
button: { button: {

View File

@ -37,6 +37,9 @@ export default function () {
}, },
]; ];
const now = new Date();
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
const today = new Date(y, m, d, 0, 0, 0, 0).getTime();
const headFormFields = [ const headFormFields = [
{ {
prop: "order", prop: "order",
@ -69,7 +72,8 @@ export default function () {
type: "datetimerange", type: "datetimerange",
"start-placeholder": "开始时间", "start-placeholder": "开始时间",
"end-placeholder": "结束时间", "end-placeholder": "结束时间",
} },
default: { value: [today - 24 * 7 * 1000 * 3600, today + 3600 * 24 * 1000] },
}, },
{ {
button: { button: {

View File

@ -36,7 +36,7 @@ export default function () {
{ width: 200, prop: "shapeShortDesc", label: "喷码描述" }, { width: 200, prop: "shapeShortDesc", label: "喷码描述" },
{ width: 120, prop: "prodqty", label: "要求生产数量" }, { width: 120, prop: "prodqty", label: "要求生产数量" },
{ width: 128, prop: "paperboard", label: "是否贴纸板", filter: (val) => ["否", "是"][val] }, { width: 128, prop: "paperboard", label: "是否贴纸板", filter: (val) => ["否", "是"][val] },
{ width: 128, prop: "palletType", label: "托盘类型", filter: dictFilter("pallet_type") }, { width: 128, prop: "palletType", label: "托盘类型", filter: val => (val != null) ? ['非熏蒸', '熏蒸'][val] : '-' },
{ width: 120, prop: "remark", label: "备注" }, { width: 120, prop: "remark", label: "备注" },
{ width: 120, prop: "createTime", label: "报工时间", filter: timeFilter }, { width: 120, prop: "createTime", label: "报工时间", filter: timeFilter },
{ width: 120, prop: "creatorName", label: "报工人" }, { width: 120, prop: "creatorName", label: "报工人" },
@ -168,7 +168,7 @@ export default function () {
optionLabel: "code", optionLabel: "code",
customLabel: "cate", customLabel: "cate",
fetchData: () => this.$http.post("/pms/order/listForReport"), fetchData: () => this.$http.post("/pms/order/listForReport"),
elparams: { placeholder: "请选择订单" }, elparams: { placeholder: "请选择订单", filterable: true },
rules: [{ required: true, message: "必填项不能为空", trigger: "blur" }], rules: [{ required: true, message: "必填项不能为空", trigger: "blur" }],
}, },
{ {
@ -250,7 +250,7 @@ export default function () {
// prop: "description", // prop: "description",
// }, // },
// ], // ],
// [{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }], [{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
], ],
operations: [ operations: [
{ {