update 0727docs

This commit is contained in:
lb 2023-07-27 15:01:42 +08:00
parent 070013b7b2
commit d35f0ba843
8 changed files with 73 additions and 92 deletions

View File

@ -9,7 +9,8 @@ export default function () {
{ prop: "batchNo", label: "批次编码" }, { prop: "batchNo", label: "批次编码" },
{ prop: "batchSize", label: "批次重量 [kg]" }, { prop: "batchSize", label: "批次重量 [kg]" },
{ prop: "status", label: "状态" }, { prop: "status", label: "状态" },
{ prop: "startTime", label: "开始时间" }, // { prop: "startTime", label: "开始时间" },
{ prop: "endTime", label: "结束时间" },
{ prop: "task", label: "任务分类" }, { prop: "task", label: "任务分类" },
{ prop: "blenderCode", label: "混料机" }, { prop: "blenderCode", label: "混料机" },
// { width: 120, prop: "orderCate", label: "主订单子号" }, // { width: 120, prop: "orderCate", label: "主订单子号" },

View File

@ -5,8 +5,7 @@
:dialog-configs="dialogConfigs" :dialog-configs="dialogConfigs"
:list-query-extra="[{ blenderOrderId: id }]" :list-query-extra="[{ blenderOrderId: id }]"
attach-list-query-extra="blenderOrderId" attach-list-query-extra="blenderOrderId"
:trigger-update="triggerUpdateKey" :trigger-update="triggerUpdateKey" />
/>
</template> </template>
<script> <script>
@ -24,8 +23,17 @@ export default {
computed: { computed: {
// id // id
id() { id() {
console.log("computed id");
return this.$route.query.id || ""; return this.$route.query.id || "";
}, },
refreshPage() {
console.log("computed refreshPage");
const val = this.$route.query.refreshPage ? Math.random().toString() : null;
// location.href refreshPage
location.href = location.href.replace(/&refreshPage=[^&]*/, "");
return val
},
}, },
data() { data() {
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this); const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
@ -34,20 +42,32 @@ export default {
headFormConfigs, headFormConfigs,
allUrls: urls, allUrls: urls,
dialogConfigs, dialogConfigs,
triggerUpdateKey: '' 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
// }
// },
watch: { watch: {
$route: { refreshPage: {
handler: function (route) { handler: function (val) {
if (route.query.id) { console.log("refreshPage", val);
this.triggerUpdateKey = Math.random().toString() if (val) {
console.log('[$oute changed] val.params.id', route.query.id, this.triggerUpdateKey) // this.triggerUpdateKey = Math.random().toString();
this.triggerUpdateKey = val;
} }
}, },
immediate: true, immediate: true,
deep: true },
}
}, },
created() {}, created() {},
mounted() {}, mounted() {},

View File

@ -223,6 +223,7 @@ export default {
name: toRouter, name: toRouter,
query: { query: {
id: data, // id id: data, // id
refreshPage: 1, // 1 or 0
}, },
}); });
break; break;

View File

@ -3,8 +3,7 @@
:table-config="tableConfig" :table-config="tableConfig"
:head-config="headFormConfigs" :head-config="headFormConfigs"
:dialog-configs="dialogConfigs" :dialog-configs="dialogConfigs"
:list-query-extra="[]" :list-query-extra="[{ viewType: 0 }]" />
/>
</template> </template>
<script> <script>
@ -12,27 +11,13 @@ import initConfig from "./config";
import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue"; import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue";
export default { export default {
name: "BlenderView", name: "KilnOrderView",
components: { ListViewWithHead }, components: { ListViewWithHead },
provide() { provide() {
return { return {
urls: this.allUrls, urls: this.allUrls,
}; };
}, },
// urls: {
// type: Object,
// required: true,
// default: () => ({
// /** url **/ list: null,
// /** url **/ page: null,
// /** url **/ edit: null,
// /** url **/ delete: null,
// /** url **/ detail: null,
// /** url **/ export: null,
// /** url **/ import: null,
// /** url **/ other: null,
// }),
// },
data() { data() {
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this); const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
return { return {
@ -42,9 +27,6 @@ export default {
dialogConfigs, dialogConfigs,
}; };
}, },
created() {},
mounted() {},
methods: {},
}; };
</script> </script>

View File

@ -1,20 +1,20 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent"; import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
// import switchBtn from "@/components/noTemplateComponents/switchBtn"; // import switchBtn from "@/components/noTemplateComponents/switchBtn";
import request from "@/utils/request"; import request from "@/utils/request";
import { dictFilter } from '@/utils/filters' import { dictFilter } from "@/utils/filters";
import { timeFilter } from '@/utils/filters' import { timeFilter } from "@/utils/filters";
export default function () { export default function () {
const tableProps = [ const tableProps = [
{ type: 'index', label: '序号' }, { type: "index", label: "序号" },
{ prop: "name", label: "料仓名称" }, { prop: "name", label: "料仓名称" },
{ prop: "code", label: "料仓编码" }, { prop: "code", label: "料仓编码" },
{ prop: "typeDictValue", label: "料仓类型", filter: dictFilter('liaocang') }, { prop: "typeDictValue", label: "料仓类型", filter: dictFilter("liaocang") },
// { prop: "enabled", label: "状态", subcomponent: switchBtn }, // subcomponent // { prop: "enabled", label: "状态", subcomponent: switchBtn }, // subcomponent
{ prop: "materialDescription", label: "原料" }, { prop: "materialDescription", label: "原料" },
{ prop: "qty", label: "料位" }, { prop: "qty", label: "料位" },
// { prop: "unitDictValue", label: "单位", filter: dictFilter('unit') }, // { prop: "unitDictValue", label: "单位", filter: dictFilter('unit') },
{ prop: "materialTypeDictValue", label: "原料类型", filter: dictFilter('material_category') }, { prop: "materialTypeDictValue", label: "原料类型", filter: dictFilter("material_category") },
{ prop: "density", label: "原料堆积密度" }, { prop: "density", label: "原料堆积密度" },
{ prop: "dosLow", label: "加料下限" }, { prop: "dosLow", label: "加料下限" },
{ prop: "dosHigh", label: "加料上限" }, { prop: "dosHigh", label: "加料上限" },
@ -38,14 +38,27 @@ export default function () {
const headFormFields = [ const headFormFields = [
{ {
prop: 'name', prop: "name",
label: "料仓名称", label: "料仓名称",
input: true, input: true,
default: { value: "" }, default: { value: "" },
bind: { bind: {
// placeholder: '请输入产线名称或编码' // placeholder: '请输入产线名称或编码'
placeholder: '请输入料仓名称' placeholder: "请输入料仓名称",
} },
},
{
prop: "typeDictValue",
label: "料仓类型",
select: JSON.parse(localStorage.getItem("dictList"))["liaocang"].map((item) => ({
label: item.dictLabel,
value: item.dictValue,
})),
default: { value: null },
bind: {
placeholder: "请选择料仓类型",
filterable: true,
},
}, },
{ {
button: { button: {
@ -57,11 +70,11 @@ export default function () {
button: { button: {
type: "primary", type: "primary",
name: "全部同步", name: "全部同步",
permission: "" permission: "",
}, },
bind: { bind: {
plain: true, plain: true,
} },
}, },
]; ];
@ -97,8 +110,8 @@ export default function () {
// fetchData: () => this.$http.get("/pms/factory/page", { params: { limit: 999, page: 1 } }), // fetchData: () => this.$http.get("/pms/factory/page", { params: { limit: 999, page: 1 } }),
options: [ options: [
// TODO: 或许映射可以全权交给数据字典 // TODO: 或许映射可以全权交给数据字典
{ label: '中间仓', value: '0' }, { label: "中间仓", value: "0" },
{ label: '日料仓', value: '1' }, { label: "日料仓", value: "1" },
], ],
rules: { required: true, message: "必填项不能为空", trigger: "change" }, rules: { required: true, message: "必填项不能为空", trigger: "change" },
elparams: { placeholder: "请选择料仓类型" }, elparams: { placeholder: "请选择料仓类型" },
@ -107,10 +120,10 @@ export default function () {
select: true, select: true,
label: "原料", label: "原料",
prop: "materialId", prop: "materialId",
fetchData: () => this.$http.get("/pms/material/page", { params: { key: '', limit: 999, page: 1 } }), fetchData: () => this.$http.get("/pms/material/page", { params: { key: "", limit: 999, page: 1 } }),
options: [], options: [],
optionLabel: 'code', optionLabel: "code",
customLabel: 'description', customLabel: "description",
rules: { required: true, message: "必填项不能为空", trigger: "change" }, rules: { required: true, message: "必填项不能为空", trigger: "change" },
elparams: { filterable: true, placeholder: "请选择原料" }, elparams: { filterable: true, placeholder: "请选择原料" },
}, },
@ -162,7 +175,7 @@ export default function () {
base: "/pms/materialStorageDynamic", base: "/pms/materialStorageDynamic",
page: "/pms/materialStorageDynamic/page", page: "/pms/materialStorageDynamic/page",
syncUrl: "/pms/trans/matStoreSync", syncUrl: "/pms/trans/matStoreSync",
syncSingleUrl: "/pms/trans/matStoreSingleSync" syncSingleUrl: "/pms/trans/matStoreSingleSync",
// subase: '/pms/blenderStepParam', // subase: '/pms/blenderStepParam',
// subpage: '/pms/blenderStepParam/page', // subpage: '/pms/blenderStepParam/page',
// more... // more...

View File

@ -3,8 +3,7 @@
:table-config="tableConfig" :table-config="tableConfig"
:head-config="headFormConfigs" :head-config="headFormConfigs"
:dialog-configs="dialogConfigs" :dialog-configs="dialogConfigs"
:list-query-extra="[]" :list-query-extra="[{ viewType: 0 }]" />
/>
</template> </template>
<script> <script>
@ -12,27 +11,13 @@ import initConfig from "./config";
import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue"; import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue";
export default { export default {
name: "BlenderView", name: "PressOrderView",
components: { ListViewWithHead }, components: { ListViewWithHead },
provide() { provide() {
return { return {
urls: this.allUrls, urls: this.allUrls,
}; };
}, },
// urls: {
// type: Object,
// required: true,
// default: () => ({
// /** url **/ list: null,
// /** url **/ page: null,
// /** url **/ edit: null,
// /** url **/ delete: null,
// /** url **/ detail: null,
// /** url **/ export: null,
// /** url **/ import: null,
// /** url **/ other: null,
// }),
// },
data() { data() {
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this); const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
return { return {
@ -42,9 +27,6 @@ export default {
dialogConfigs, dialogConfigs,
}; };
}, },
created() {},
mounted() {},
methods: {},
}; };
</script> </script>

View File

@ -6,10 +6,10 @@ import { timeFilter, dictFilter } from "@/utils/filters";
export default function () { export default function () {
const tableProps = [ const tableProps = [
{ type: "index", label: "序号" }, { type: "index", label: "序号" },
{ prop: "name", label: "物料名称" },
{ prop: "code", label: "物料编码" }, { prop: "code", label: "物料编码" },
{ prop: "name", label: "物料描述" },
// { prop: "typeDictValue", label: "物料类型", filter: dictFilter("product_type") }, // { prop: "typeDictValue", label: "物料类型", filter: dictFilter("product_type") },
{ prop: "specifications", label: "规格" }, // { prop: "specifications", label: "规格" },
// { prop: "unitDictValue", label: "单位", filter: dictFilter("unit") }, // { prop: "unitDictValue", label: "单位", filter: dictFilter("unit") },
{ prop: "weight", label: "重量", filter: (val) => (val ? val + " kg" : "-") }, { prop: "weight", label: "重量", filter: (val) => (val ? val + " kg" : "-") },
{ prop: "processTime", label: "产线完成单位产品用时", width: 200, filter: (val) => val + " (分钟)" }, { prop: "processTime", label: "产线完成单位产品用时", width: 200, filter: (val) => val + " (分钟)" },
@ -43,11 +43,11 @@ export default function () {
const headFormFields = [ const headFormFields = [
{ {
label: "物料名称/编码", label: "物料描述/编码",
prop: "key", prop: "key",
input: true, input: true,
default: { value: "" }, default: { value: "" },
bind: { placeholder: "请输入物料名称或编码" }, bind: { placeholder: "请输入物料描述或编码" },
}, },
{ {
button: { button: {
@ -97,14 +97,14 @@ export default function () {
label: "物料描述", label: "物料描述",
prop: "name", prop: "name",
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入设备名称" }, elparams: { placeholder: "请输入物料描述" },
}, },
{ {
input: true, input: true,
label: "物料编码", label: "物料编码",
prop: "code", prop: "code",
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入设备编码" }, elparams: { placeholder: "请输入物料编码" },
}, },
// { input: true, label: '版本号', prop: 'version', elparams: { placeholder: '请输入版本号' } }, // { input: true, label: '版本号', prop: 'version', elparams: { placeholder: '请输入版本号' } },
// { // {

View File

@ -3,8 +3,7 @@
:table-config="tableConfig" :table-config="tableConfig"
:head-config="headFormConfigs" :head-config="headFormConfigs"
:dialog-configs="dialogConfigs" :dialog-configs="dialogConfigs"
:list-query-extra="[]" :list-query-extra="[{ viewType: 0 }]" />
/>
</template> </template>
<script> <script>
@ -19,20 +18,6 @@ export default {
urls: this.allUrls, urls: this.allUrls,
}; };
}, },
// urls: {
// type: Object,
// required: true,
// default: () => ({
// /** url **/ list: null,
// /** url **/ page: null,
// /** url **/ edit: null,
// /** url **/ delete: null,
// /** url **/ detail: null,
// /** url **/ export: null,
// /** url **/ import: null,
// /** url **/ other: null,
// }),
// },
data() { data() {
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this); const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
return { return {
@ -42,9 +27,6 @@ export default {
dialogConfigs, dialogConfigs,
}; };
}, },
created() {},
mounted() {},
methods: {},
}; };
</script> </script>