| | |
| | | </el-form> |
| | | <div> |
| | | <el-button size="mini" type="primary">获取订单</el-button> |
| | | <el-button size="mini" type="primary" @click="openAdd('新增')">新增</el-button> |
| | | <!-- <el-button size="mini" type="primary" @click="openAdd('新增')">新增</el-button> --> |
| | | </div> |
| | | </div> |
| | | <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 220px)'" |
| | | <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 240px)'" |
| | | :page="page" @pagination="pagination"></lims-table> |
| | | <!-- 新增/编辑 --> |
| | | <el-dialog :title="title" :visible.sync="addDia" width="500px"> |
| | | <el-form :model="addForm" v-if="addDia" ref="addForm" :rules="addRules" label-position="right" |
| | | label-width="120px"> |
| | | <el-form-item label="产品" prop="name"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="addForm.name" |
| | | :disabled="title == '检验'"></el-input> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="addForm.name" disabled></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="来料数量" prop="num"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="addForm.num" :disabled="title == '检验'"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="addForm.num" disabled> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="供货厂家" prop="supplier"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="addForm.supplier" :disabled="title == '检验'"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="addForm.supplier" disabled> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="订单号" prop="orderNum"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="addForm.orderNum" :disabled="title == '检验'"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="addForm.orderNum" disabled> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="SP号" prop="spNum"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="addForm.spNum" :disabled="title == '检验'"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="addForm.spNum" disabled> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input size="small" placeholder="请输入" type="textarea" :rows="2" clearable v-model="addForm.remark" |
| | | :disabled="title == '检验'"> |
| | | disabled> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="外观" prop="inspectionItems" v-if="title == '检验'"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="addForm.inspectionItems"> |
| | | <el-form-item label="外观" prop="inspectionItems"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="addForm.inspectionItems" |
| | | :disabled="title != '检验'"> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="检测结果" prop="result" v-if="title == '检验'"> |
| | | <el-switch v-model="addForm.result" active-text="合格" inactive-text="不合格" active-value="合格" |
| | | inactive-value="不合格"> |
| | | </el-switch> |
| | | <el-form-item label="检测结果" prop="result"> |
| | | <el-select v-model="addForm.result" placeholder="请选择" :disabled="title != '检验'"> |
| | | <el-option label="合格" value="合格"> |
| | | </el-option> |
| | | <el-option label="不合格" value="不合格"> |
| | | </el-option> |
| | | <el-option label="不判断" value="不判断"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="测试文件" prop="file" v-if="title == '检验'"> |
| | | <el-upload action="#" :auto-upload="false" :multiple="false" |
| | | <el-form-item label="测试文件" prop="file"> |
| | | <el-upload action="#" :auto-upload="false" :multiple="false" v-if="title == '检验'" |
| | | accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.pdf,' :on-change="handleChangeUpload"> |
| | | <el-button size="mini" type="primary">上传附件</el-button> |
| | | </el-upload> |
| | | <a @click="handleDown(addForm)" v-else style="color: #3a7bfa;">{{ addForm.fileName }}</a> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <span slot="footer" class="dialog-footer" v-if="title == '检验'"> |
| | | <el-button @click="addDia = false">取 消</el-button> |
| | | <el-button :loading="uploading" type="primary" @click="submitProduct('addForm')">确 认</el-button> |
| | | </span> |
| | |
| | | |
| | | <script> |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import { selectInspection, addOrUpdateInspection, delInspection } from '@/api/business/outsourcedParts.js' |
| | | import { selectInspection, addOrUpdateInspection, delInspection, updateInspection } from '@/api/business/outsourcedParts.js' |
| | | export default { |
| | | components: { limsTable }, |
| | | data() { |
| | | return { |
| | | queryParams: {}, |
| | | tableData: [], |
| | | value: '', |
| | | column: [ |
| | | { label: "委托编号", prop: "entrustmentNo" }, |
| | | { label: "产品", prop: "name" }, |
| | |
| | | dataType: "action", |
| | | label: "操作", |
| | | operation: [ |
| | | { |
| | | name: "编辑", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.openAdd("编辑", row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "删除", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleDelete(row); |
| | | }, |
| | | disabled: (row) => { |
| | | return !!row.ratifyUser |
| | | }, |
| | | }, |
| | | // { |
| | | // name: "编辑", |
| | | // type: "text", |
| | | // clickFun: (row) => { |
| | | // this.openAdd("编辑", row); |
| | | // }, |
| | | // }, |
| | | // { |
| | | // name: "删除", |
| | | // type: "text", |
| | | // clickFun: (row) => { |
| | | // this.handleDelete(row); |
| | | // }, |
| | | // disabled: (row) => { |
| | | // return !!row.ratifyUser |
| | | // }, |
| | | // }, |
| | | { |
| | | name: "检验", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.openAdd('检验', row); |
| | | }, |
| | | disabled: (row) => { |
| | | return row.inspectionStatus > 0 |
| | | }, |
| | | }, |
| | | { |
| | | name: "查看", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.openAdd('查看', row); |
| | | }, |
| | | }, |
| | | ], |
| | |
| | | inspectionItems: [ |
| | | { required: true, message: "请输入外观", trigger: "blur" }, |
| | | ], |
| | | result: [ |
| | | { required: true, message: "请选择检测结果", trigger: "change" }, |
| | | ], |
| | | }, |
| | | uploading: false, |
| | | inspectionTaskState: [] |
| | |
| | | this.getDicts("inspection_task_state").then((response) => { |
| | | this.inspectionTaskState = this.dictToValue(response.data); |
| | | }); |
| | | this.getList() |
| | | }, |
| | | methods: { |
| | | getList() { |
| | |
| | | // 检验 |
| | | let fd = new FormData(); |
| | | //文件信息中raw才是真的文件 |
| | | if (this.file) { |
| | | fd.append("file", this.file.raw); |
| | | if (this.addForm.file) { |
| | | fd.append("file", this.addForm.file.raw); |
| | | } |
| | | fd.append("inspectionItems", this.addForm.inspectionItems); |
| | | fd.append("result", this.addForm.result); |
| | | fd.append("id", this.addForm.id); // 添加id参数 |
| | | updateInspection(fd) |
| | | .then(res => { |
| | | this.uploading = false; |
| | | if (res.code === 200) { |
| | | this.$message.success("检验提交成功"); |
| | | this.refresh(); |
| | | this.addDia = false; |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | this.uploading = false; |
| | | }); |
| | | } |
| | | } else { |
| | | return false; |
| | |
| | | handleChangeUpload(file, fileLists) { |
| | | this.addForm.file = file |
| | | }, |
| | | |
| | | // 下载附件的文件 |
| | | handleDown(row) { |
| | | this.$download.saveAs(row.fileUrl, row.fileName); |
| | | }, |
| | | } |
| | | } |
| | | </script> |