add 添加质量检查

This commit is contained in:
lb 2023-03-31 13:51:19 +08:00
parent 21713c2c22
commit 34999e44b6
3 changed files with 296 additions and 2 deletions

View File

@ -38,9 +38,9 @@
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
<script>
// 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.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/pms-am'; // xv
</script>
<% } %>

View File

@ -0,0 +1,230 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
import TableTextComponent from "@/components/noTemplateComponents/detailComponent";
// import StatusComponent from "@/components/noTemplateComponents/statusComponent";
import { timeFilter } from "@/utils/filters";
export default function () {
const tableProps = [
{ type: "index", label: "序号" },
{ width: 160, prop: "createTime", label: "添加时间", filter: timeFilter },
{ prop: "carCode", label: "窑车号" },
{ prop: "orderCode", label: "订单号" },
{ prop: "orderCate", label: "子号" },
{ prop: "scrap", label: "是否报废" },
{ prop: "qty", label: "抽检数量" },
{ prop: "badqty", label: "不合格数量" },
{ prop: 'description', label: '查看详情', subcomponent: TableTextComponent },
{ width: 160, prop: "checkTime", label: "检测时间", filter: timeFilter },
{
prop: "operations",
name: "操作",
fixed: "right",
width: 90,
subcomponent: TableOperaionComponent,
options: [
{ name: "edit", label: "编辑", icon: "edit-outline", },
{ name: 'delete', label: '删除', icon: 'delete' },
// 只有 injectRow.task 为手动时,才允许编辑
// { name:"edit", label: "编辑", icon: "edit-outline", enable: injectRow => { return 'task' in injectRow && injectRow.task === 'Manual' } },
// { name: 'delete', icon: 'delete', enable: injectRow => { return 'task' in injectRow && injectRow.task === 'Manual' } },
// 只有 injectRow.status 为 waiting 时,才允许编辑
// { name: "edit", label: "编辑", icon: "edit-outline", enable: injectRow => { return 'status' in injectRow && injectRow.status === 'Waiting' } },
// { name: 'delete', icon: 'delete', emitFull: true, promptField: 'batchNo', enable: injectRow => { return 'status' in injectRow && injectRow.status === 'Waiting' } },
]
},
];
const headFormFields = [
{
prop: "orderId",
label: "订单号",
fieldOptionLabel: 'code',
// fieldOptionValue: 'id',
select: [],
fn: () => this.$http.post("/pms/order/pageView", { page: 1, limit: 999 }),
bind: {
placeholder: "请选择订单号",
filterable: true
},
},
{
prop: "carId",
label: "窑车号",
select: [],
fn: () => this.$http.get("/pms/car/page", { params: { page: 1, limit: 999 } }),
bind: {
placeholder: "请选择窑车号",
filterable: true
},
},
{
timerange: true,
prop: 'timerange',
label: "时间段",
bind: {
placeholder: '请选择上料时间段',
type: "datetimerange",
"start-placeholder": "开始时间",
"end-placeholder": "结束时间",
}
},
{
button: {
type: "primary",
name: "查询",
},
},
{
button: {
type: "primary",
name: "新增",
permission: ""
},
bind: {
plain: true,
}
},
];
const dialogJustFormConfigs = {
// extra blenderOrderId
// extraIds: {},
form: {
rows: [
[
{
input: true,
label: "窑车号",
prop: "carId",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入批次编码" },
},
{
input: true,
label: "当前位置",
prop: "posCode",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请入当前位置" },
},
{
select: true,
label: "当前状态",
prop: "carState",
options: [
{ label: '没有数据', value: 0 },
{ label: '正常窑车', value: 1 },
{ label: '判废窑车', value: 2 },
{ label: '摆渡车', value: 3 },
{ label: '空窑车', value: 4 },
],
rules: { required: true, message: "必选项不能为空", trigger: "blur" },
elparams: { placeholder: "请选择状态" },
},
{
select: true,
label: "整车报废",
prop: "scrap",
options: [
{ label: '是', value: 'yes' },
{ label: '否', value: 'no', default: true },
],
rules: { required: true, message: "必选项不能为空", trigger: "blur" },
elparams: { placeholder: "请选择报废状态" },
},
],
[
{
input: true,
label: "订单号",
prop: "orderId",
rules: { required: true, message: "必选项不能为空", trigger: "blur" },
elparams: { placeholder: "请选择订单" },
},
{
input: true,
label: "子号",
prop: "orderCate"
},
{
input: true,
label: "砖型",
prop: "shapeCode"
},
{
input: true,
label: "订单砖数",
prop: "orderQty",
},
],
[
{
input: true,
label: "抽检数量",
prop: "orderQty",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{ type: 'number', message: '请输入正确的数字类型', trigger: 'blur', transform: val => Number(val) }
],
elparams: { placeholder: "请输入抽检数量" },
},
{
input: true,
label: "不合格量",
prop: "badqty",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{ type: 'number', message: '请输入正确的数字类型', trigger: 'blur', transform: val => Number(val) }
],
elparams: { placeholder: "请输入不合格量" },
},
{
input: true,
label: "检测人",
prop: "checkPerson",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入批次编码" },
},
{
datetime: true,
label: "检测时间",
prop: "checkTime",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请选择检测时间", type: 'datetime' },
},
],
[
{
textarea: true,
label: "描述",
prop: "explainText",
elparams: { placeholder: "请输入描述" },
}
]
],
operations: [
{ name: "add", label: "保存", type: "primary", permission: "", showOnEdit: false },
{ name: "update", label: "更新", type: "primary", permission: "", showOnEdit: true },
{ name: "reset", label: "重置", type: "warning", showAlways: true },
],
},
};
return {
dialogConfigs: dialogJustFormConfigs,
tableConfig: {
table: null, // 此处可省略el-table 上的配置项
column: tableProps, // el-column-item 上的配置项
},
headFormConfigs: {
rules: null, // 名称是由 BaseSearchForm.vue 组件固定的
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
},
urls: {
// base: "/pms/qualityInspectionRecord/pageView",
page: "/pms/qualityInspectionRecord/pageView",
pageIsPostApi: true,
// subase: "/pms/equipmentTechParam",
},
};
}

View File

@ -0,0 +1,64 @@
<template>
<ListViewWithHead
:table-config="tableConfig"
:head-config="headFormConfigs"
:dialog-configs="dialogConfigs"
:list-query-extra="[]"
:trigger-update="triggerUpdateKey"
/>
<!-- attach-list-query-extra="blenderOrderId" -->
</template>
<script>
import initConfig from "./config";
import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue";
export default {
name: "QualityInspectionRecordView",
components: { ListViewWithHead },
provide() {
return {
urls: this.allUrls,
};
},
computed: {
// id
id() {
return this.$route.query.id || "";
},
},
data() {
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
return {
tableConfig,
headFormConfigs,
allUrls: urls,
dialogConfigs,
triggerUpdateKey: "",
};
},
// watch: {
// $route: {
// handler: function (route) {
// if (route.query.id) {
// this.triggerUpdateKey = Math.random().toString();
// console.log("[$oute changed] val.params.id", route.query.id, this.triggerUpdateKey);
// }
// },
// immediate: true,
// deep: true,
// },
// },
mounted() {},
activated() {
// console.log("activated...");
this.triggerUpdateKey = Math.random().toString();
},
// deactivated() {
// console.log("deactivated...");
// },
methods: {},
};
</script>
<style scoped></style>