现场问题修改..................
This commit is contained in:
@@ -44,21 +44,6 @@
|
||||
placeholder="请选择结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="仓库" prop="warehouseId"><!–仓库–>-->
|
||||
<!-- <el-select-->
|
||||
<!-- v-model="queryParams.warehouseId"-->
|
||||
<!-- placeholder="请选择仓库"-->
|
||||
<!-- clearable-->
|
||||
<!-- @change="handleQuery"-->
|
||||
<!-- >-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in warehouseOptions"-->
|
||||
<!-- :key="item.warehouseId"-->
|
||||
<!-- :label="item.warehouseName"-->
|
||||
<!-- :value="item.warehouseId"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
@@ -96,6 +81,16 @@
|
||||
@click="openEditTrayDialog"
|
||||
>修改托盘码</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="openEditDeptDialog"
|
||||
>修改部门</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
@@ -141,35 +136,6 @@
|
||||
<el-table-column label="任务ID" align="left" prop="jobId" width="160" />
|
||||
<el-table-column label="单据ID" align="left" prop="inOrOutId" width="160" />
|
||||
<el-table-column label="子单据ID" align="left" prop="inOrOutDId" width="160" />
|
||||
|
||||
<!-- <el-table-column label="来源" align="left" prop="spare1" ><!–来源–>
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.origin_type" :value="scope.row.spare1"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="left" prop="spare2" ><!–用途–>
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.turnover_type" :value="scope.row.spare2"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="套账" align="left" prop="spare3" ><!–用途–>
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.account_type" :value="scope.row.spare3"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用途" align="left" prop="spare4" ><!–用途–>
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.purpose_type" :value="scope.row.spare4"/>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
<!-- <el-table-column label="批号" align="left" prop="lotNo" />-->
|
||||
<!-- <el-table-column label="生产图号" align="left" prop="cargoNo" width="160"/>-->
|
||||
<!-- <el-table-column label="单价" align="left" prop="printDate" />-->
|
||||
<!-- <el-table-column label="质量等级" align="left" prop="spare8" ><!–用途–>
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.quality_type" :value="scope.row.spare8"/>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
<el-table-column label="合同号" align="left" prop="spare6" />
|
||||
<el-table-column label="产品号" align="left" prop="spare7" />
|
||||
<el-table-column label="代号" align="left" prop="spare9" />
|
||||
@@ -207,6 +173,28 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :title="deptTitle" :visible.sync="deptOpen" width="400px" append-to-body>
|
||||
<el-form ref="deptForm" :model="deptForm" :rules="deptRules" label-width="80px">
|
||||
<el-form-item label="任务ID">
|
||||
<el-input v-model="deptForm.jobId" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门" prop="departmentId">
|
||||
<el-select v-model="deptForm.departmentId" placeholder="请选择部门">
|
||||
<el-option
|
||||
v-for="dict in getDeptDictOptions(deptForm)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitDeptForm">确 定</el-button>
|
||||
<el-button @click="cancelDept">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
@@ -218,7 +206,7 @@ import {listWarehouse} from "@/api/bas/warehouse";
|
||||
|
||||
export default {
|
||||
name: "MydoJob",
|
||||
dicts: ['execution_phase_type', 'in_job_type', 'on_line_type', 'mydo_job_status','product_type','origin_type','account_type','turnover_type','purpose_type','quality_type'],
|
||||
dicts: ['execution_phase_type', 'in_job_type', 'on_line_type', 'mydo_job_status','product_type','origin_type','account_type','turnover_type','purpose_type','quality_type','sl_dept','el_dept'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@@ -295,6 +283,15 @@ export default {
|
||||
{ required: true, message: "托盘码不能为空", trigger: "blur" }
|
||||
]
|
||||
},
|
||||
// 部门修改弹窗
|
||||
deptOpen: false,
|
||||
deptTitle: "",
|
||||
deptForm: {},
|
||||
deptRules: {
|
||||
departmentId: [
|
||||
{ required: true, message: "部门不能为空", trigger: "change" }
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -312,6 +309,16 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
getDeptDictOptions(row) {
|
||||
const wid = String(row && row.warehouseId != null ? row.warehouseId : "").padStart(2, "0")
|
||||
if (wid === "01" ) {
|
||||
return this.dict.type.sl_dept || []
|
||||
}
|
||||
if (wid === "02" || wid === "03") {
|
||||
return this.dict.type.el_dept || []
|
||||
}
|
||||
return this.dict.type.sl_dept || []
|
||||
},
|
||||
/** 查询任务表列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
@@ -466,6 +473,62 @@ export default {
|
||||
...this.queryParams
|
||||
}, `mydoJob_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
openEditDeptDialog() {
|
||||
if (this.ids.length === 0) {
|
||||
this.$modal.msgError("请选择要修改的任务");
|
||||
return;
|
||||
}
|
||||
if (this.ids.length > 1) {
|
||||
this.$modal.msgError("一次只能修改一条任务");
|
||||
return;
|
||||
}
|
||||
const jobId = this.ids[0];
|
||||
const row = this.mydoJobList.find(item => item.jobId === jobId);
|
||||
if (!row) {
|
||||
this.$modal.msgError("未找到选中任务数据");
|
||||
return;
|
||||
}
|
||||
if (row.status !== '1') {
|
||||
this.$modal.msgError("只能修改未执行的任务");
|
||||
return;
|
||||
}
|
||||
this.deptForm = {
|
||||
jobId: row.jobId,
|
||||
departmentId: row.departmentId,
|
||||
warehouseId: row.warehouseId
|
||||
};
|
||||
this.deptTitle = "修改任务部门";
|
||||
this.deptOpen = true;
|
||||
},
|
||||
cancelDept() {
|
||||
this.deptOpen = false;
|
||||
this.resetDeptForm();
|
||||
},
|
||||
resetDeptForm() {
|
||||
this.deptForm = {
|
||||
jobId: null,
|
||||
departmentId: null,
|
||||
warehouseId: null
|
||||
};
|
||||
this.resetForm("deptForm");
|
||||
},
|
||||
submitDeptForm() {
|
||||
this.$refs["deptForm"].validate(valid => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
const row = this.mydoJobList.find(item => item.jobId === this.deptForm.jobId);
|
||||
// 构造更新对象,只包含需要更新的字段和主键,或者根据后端要求传全量
|
||||
// 这里为了安全起见,我们拷贝原对象并覆盖 departmentId
|
||||
const updatedRow = Object.assign({}, row, { departmentId: this.deptForm.departmentId });
|
||||
|
||||
updateMydoJob(updatedRow).then(() => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.deptOpen = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 行点击事件处理 */
|
||||
handleRowClick(row) {
|
||||
// 设置当前选中行
|
||||
|
||||
Reference in New Issue
Block a user