|
@@ -0,0 +1,265 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import {
|
|
|
+ listFlowConfig,
|
|
|
+ getFlowConfig,
|
|
|
+ updateFlowConfig,
|
|
|
+ listLotattConfig,
|
|
|
+ flowConfigLotatt
|
|
|
+ } from "@/api/ams/flowConfig";
|
|
|
+ import {choseFlow, exec} from "@/api/ams/lineCall";
|
|
|
+ import {querySkuDict} from "@/api/base/baseSku";
|
|
|
+ import {querySupplierDict} from "@/api/base/supplier";
|
|
|
+ import {treeselect} from "@/api/base/locationInfo";
|
|
|
+ import {inputTag} from "@/utils/combo/dict";
|
|
|
+
|
|
|
+ export default {
|
|
|
+ name: "FlowConfig",
|
|
|
+ dicts: ['sys_yes_no', 'ams_inv_quality'],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 子表选中数据
|
|
|
+ checkedFlowConfigDetails: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 流程配置头表格数据
|
|
|
+ flowConfigList: [],
|
|
|
+ // 流程配置体表格数据
|
|
|
+ flowConfigDetailsList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ flowName: null,
|
|
|
+ },
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ flowName: [
|
|
|
+ {required: true, message: "流程名称不能为空", trigger: "blur"}
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ defaultProps: {
|
|
|
+ children: "children",
|
|
|
+ label: "label"
|
|
|
+ },
|
|
|
+ inputTagCombo: inputTag,
|
|
|
+ supplierCombo: [],
|
|
|
+ skuTypeCombo: undefined,
|
|
|
+ locationFromOptions: undefined,
|
|
|
+ locationToOptions: undefined,
|
|
|
+ locationFromCombo: undefined,
|
|
|
+ locationToCombo: undefined
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.init();
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /** 查询流程配置头列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ listFlowConfig(this.queryParams).then(response => {
|
|
|
+ this.flowConfigList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ id: null,
|
|
|
+ flowName: null,
|
|
|
+ sku: '',
|
|
|
+ skuTypeFlag: 'Choice',
|
|
|
+ qty: null,
|
|
|
+ qtyFlag: 'Choice',
|
|
|
+ weight: null,
|
|
|
+ weightFlag: 'Choice',
|
|
|
+ supplier: '',
|
|
|
+ supplierFlag: 'Choice',
|
|
|
+ locationFrom: null,
|
|
|
+ locationFromFlag: null,
|
|
|
+ locationTo: null,
|
|
|
+ locationToFlag: null,
|
|
|
+ createBy: null,
|
|
|
+ createTime: null,
|
|
|
+ updateBy: null,
|
|
|
+ updateTime: null,
|
|
|
+ remark: null,
|
|
|
+ lineCallDetailsFormList: null
|
|
|
+ };
|
|
|
+ this.flowConfigDetailsList = [];
|
|
|
+ this.resetForm("form");
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ // 多选框选中数据
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.ids = selection.map(item => item.id)
|
|
|
+ this.single = selection.length !== 1
|
|
|
+ this.multiple = !selection.length
|
|
|
+ },
|
|
|
+ /** 新增按钮操作 */
|
|
|
+ handleAdd() {
|
|
|
+ this.reset();
|
|
|
+ this.open = true;
|
|
|
+ this.title = "添加流程配置";
|
|
|
+ },
|
|
|
+ /** 修改按钮操作 */
|
|
|
+ handleUpdate(row) {
|
|
|
+ this.reset();
|
|
|
+ const id = row.id || this.ids
|
|
|
+ // 加载批次属性明细
|
|
|
+ flowConfigLotatt(id).then(response => {
|
|
|
+ this.flowConfigDetailsList = response.data;
|
|
|
+ });
|
|
|
+ choseFlow(id).then(response => {
|
|
|
+ this.locationFromCombo = response.locationFrom
|
|
|
+ this.locationToCombo = response.locationTo
|
|
|
+ this.form.skuTypeFlag = response.skuTypeFlag
|
|
|
+ this.form.qtyFlag = response.qtyFlag
|
|
|
+ this.form.weightFlag = response.weightFlag
|
|
|
+ this.form.supplierFlag = response.supplierFlag
|
|
|
+ this.form.locationFromFlag = response.locationFromFlag
|
|
|
+ this.form.locationToFlag = response.locationToFlag
|
|
|
+ this.skuTypeCombo = response.skuList;
|
|
|
+ this.open = true;
|
|
|
+ this.title = "线边呼叫";
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.skuTypeFlag === 'Required' && this.form.skuType === '') {
|
|
|
+ this.$modal.msgError("物料必须选择");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.form.qtyFlag === 'Required' && this.form.qty === null) {
|
|
|
+ this.$modal.msgError("数量必须输入");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.form.weightFlag === 'Required' && this.form.weight === null) {
|
|
|
+ this.$modal.msgError("重量必须输入");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.form.supplierFlag === 'Required' && this.form.supplier === null) {
|
|
|
+ this.$modal.msgError("供应商必须输入");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.form.locationFromFlag === 'Required' && this.form.locationFrom === null) {
|
|
|
+ this.$modal.msgError("必须选择起点位置");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.form.locationToFlag === 'Required' && this.form.locationTo === null) {
|
|
|
+ this.$modal.msgError("必须选择终点位置");
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.flowConfigDetailsList.length > 0) {
|
|
|
+ for (let i = 0; i < this.flowConfigDetailsList.length; i++) {
|
|
|
+ if (this.flowConfigDetailsList[i].lotattFlag === 'Required') {
|
|
|
+ if(this.flowConfigDetailsList[i].lotattValue === '' || this.flowConfigDetailsList[i].lotattValue === null) {
|
|
|
+ this.$modal.msgError(this.flowConfigDetailsList[i].lotattName+"必须输入");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ let lineCallDetailsFormList = new Array();
|
|
|
+ for (let i = 0; i < this.flowConfigDetailsList.length; i++) {
|
|
|
+ let obj = new Object();
|
|
|
+ obj.lotattId = this.flowConfigDetailsList[i].lotattId
|
|
|
+ obj.lotattValue = this.flowConfigDetailsList[i].lotattValue
|
|
|
+ lineCallDetailsFormList.push(obj)
|
|
|
+ }
|
|
|
+ this.form.lineCallDetailsFormList = lineCallDetailsFormList
|
|
|
+ console.log(this.form)
|
|
|
+ exec(this.form).then(response => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ this.$modal.msgSuccess("执行成功");
|
|
|
+ this.open = false;
|
|
|
+ } else {
|
|
|
+ this.$modal.msgError(response.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 流程配置体序号 */
|
|
|
+ rowFlowConfigDetailsIndex({row, rowIndex}) {
|
|
|
+ row.index = rowIndex + 1;
|
|
|
+ },
|
|
|
+ /** 流程配置体添加按钮操作 */
|
|
|
+ handleAddFlowConfigDetails() {
|
|
|
+ let obj = {};
|
|
|
+ obj.lotattId = "";
|
|
|
+ obj.lotattFlag = "";
|
|
|
+ obj.remark = "";
|
|
|
+ this.flowConfigDetailsList.push(obj);
|
|
|
+ },
|
|
|
+ /** 流程配置体删除按钮操作 */
|
|
|
+ handleDeleteFlowConfigDetails() {
|
|
|
+ if (this.checkedFlowConfigDetails.length == 0) {
|
|
|
+ this.$modal.msgError("请先选择要删除的流程配置体数据");
|
|
|
+ } else {
|
|
|
+ const flowConfigDetailsList = this.flowConfigDetailsList;
|
|
|
+ const checkedFlowConfigDetails = this.checkedFlowConfigDetails;
|
|
|
+ this.flowConfigDetailsList = flowConfigDetailsList.filter(function (item) {
|
|
|
+ return checkedFlowConfigDetails.indexOf(item.index) == -1
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /** 复选框选中数据 */
|
|
|
+ handleFlowConfigDetailsSelectionChange(selection) {
|
|
|
+ this.checkedFlowConfigDetails = selection.map(item => item.index)
|
|
|
+ },
|
|
|
+ // 筛选节点
|
|
|
+ filterNode(value, data) {
|
|
|
+ if (!value) return true;
|
|
|
+ return data.label.indexOf(value) !== -1;
|
|
|
+ },
|
|
|
+ init() {
|
|
|
+ // 初始化供应商
|
|
|
+ querySupplierDict().then(response => {
|
|
|
+ this.supplierCombo = response.data;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+</script>
|