Commit 5ef52c2e authored by chenzj's avatar chenzj

工作中心发料

parent d97b60b7
...@@ -12,9 +12,6 @@ ...@@ -12,9 +12,6 @@
<el-button size="mini" type="text" icon="el-icon-delete" @click="deleteRow($index)">删除</el-button> <el-button size="mini" type="text" icon="el-icon-delete" @click="deleteRow($index)">删除</el-button>
<el-button size="mini" type="text" icon="el-icon-update" @click="updateRow($index)">修改</el-button> <el-button size="mini" type="text" icon="el-icon-update" @click="updateRow($index)">修改</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -37,34 +34,7 @@ ...@@ -37,34 +34,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- <el-row>
<el-col :span="12">
<el-form-item label="工作中心编码" prop="workstationCode">
<el-input v-model="form.workstationCode" placeholder="请输入工作中心编码">
<el-button slot="append" icon="el-icon-search" @click="handleWorkstationSelect" />
</el-input>
</el-form-item>
<WorkstationSelect ref="brSelectworkstation"
@onSelected="val => onWorkstationSelect(val, 'workstation')"
:workstationCode="form.workstationCode">
</WorkstationSelect>
</el-col>
<el-col :span="12">
<el-form-item label="工作单元" prop="workunitCode">
<el-input v-model="form.workunitCode" placeholder="工作单元">
<el-button slot="append" icon="el-icon-search"
@click="$refs.codeSelect.showFlag = true"></el-button>
</el-input>
</el-form-item>
</el-col>
</el-row>
<WorkstationSelect ref="brSelectworkstation"
@onSelected="val => onWorkstationSelect(val, 'workstation')"
:workstationCode="form.workstationCode">
</WorkstationSelect>
<codeSelect ref="codeSelect" :workstationId="form.workstationId"
@onSelected="val => onWorkstationSelect(val, 'unit')"></codeSelect> -->
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="申请数量" prop="applyNum"> <el-form-item label="申请数量" prop="applyNum">
...@@ -79,23 +49,18 @@ ...@@ -79,23 +49,18 @@
</div> </div>
</el-dialog> </el-dialog>
<!--
<pagination v-show="total > 0 && $attrs.optType !== 'add'" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" /> -->
</div> </div>
</template> </template>
<script> <script>
import WorkstationSelect from "@/components/workstationSelect/simpletableSingle.vue"; import codeSelect from "./codeSelect.vue";
import ItemSelect from "@/components/itemSelect/single.vue"; import ItemSelect from "@/components/itemSelect/single.vue";
export default { export default {
name: "TmToolRequestItem", name: "TmToolRequestItem",
dicts: [ dicts: [
"warehouse_desc" "warehouse_desc"
], ],
components: { ItemSelect, WorkstationSelect }, components: { ItemSelect, codeSelect },
props: { props: {
id: { id: {
type: String, type: String,
...@@ -135,11 +100,6 @@ export default { ...@@ -135,11 +100,6 @@ export default {
sapItemCode: null, sapItemCode: null,
itemName: null, itemName: null,
applyNum: null, applyNum: null,
workstationCode: null,
workunitCode: null,
workstationCode: null,
workstationId: null,
workstationName: null,
}, },
// 表单参数 // 表单参数
form: { form: {
...@@ -147,11 +107,6 @@ export default { ...@@ -147,11 +107,6 @@ export default {
sapItemCode: null, sapItemCode: null,
itemName: null, itemName: null,
applyNum: null, applyNum: null,
workstationCode: null,
workunitCode: null,
workstationCode: null,
workstationId: null,
workstationName: null,
}, },
currentRowIdx: undefined, currentRowIdx: undefined,
...@@ -160,12 +115,6 @@ export default { ...@@ -160,12 +115,6 @@ export default {
sapItemCode: [ sapItemCode: [
{ required: true, message: "产品编码不能为空", trigger: "blur" } { required: true, message: "产品编码不能为空", trigger: "blur" }
], ],
workstationCode: [
{ required: true, message: "工作中心编码不能为空", trigger: "blur" }
],
workunitCode: [
{ required: true, message: "工作单元编码不能为空", trigger: "blur" }
],
applyNum: [ applyNum: [
{ required: true, message: "申请数量不能为空", trigger: "blur" } { required: true, message: "申请数量不能为空", trigger: "blur" }
], ],
...@@ -225,45 +174,30 @@ export default { ...@@ -225,45 +174,30 @@ export default {
/**表单提交 */ /**表单提交 */
submitForm() { submitForm() {
if(this.form.sapItemCode==null){
this.open = true;
this.$modal.confirm('物料编码不能为空');
return;
}
if(this.form.applyNum==0){ if(this.form.applyNum==0){
this.open = true; this.open = true;
this.$modal.confirm('申请数量需要输入数字'); this.$modal.confirm('申请数量需要输入数字');
return; return;
} }
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.optType == "add") { if (this.optType == "add") {
this.tableData.unshift(JSON.parse(JSON.stringify(this.form))); this.tableData.unshift(JSON.parse(JSON.stringify(this.form)));
}else if(this.optType == "edit"){ }else if(this.optType == "edit"){
this.$set(this.tableData, this.indexs, JSON.parse(JSON.stringify(this.form))) this.tableData[this.indexs]=JSON.parse(JSON.stringify(this.form));
} }
this.showFlag = false; this.showFlag = false;
} }
}); });
this.open = false; this.open = false;
}, },
handleWorkstationSelect() {
this.$refs.brSelectworkstation.showFlag = true;
},
onWorkstationSelect(row, type) {
console.log('row', type, row)
if (row != undefined && row != null) {
if (type === 'unit') {
// this.form.workunitName = row.workunitName
this.$set(this.form, 'workunitCode', row.workunitCode)
this.form.workstationId = row.workstationId;
this.form.workstationCode = row.workstationCode;
this.form.workstationName = row.workstationName;
} else {
this.form.workstationId = row.workstationId;
this.form.workstationCode = row.workstationCode;
this.form.workstationName = row.workstationName;
}
}
},
/**删除行 */ /**删除行 */
deleteRow(index) { deleteRow(index) {
this.tableData.splice(index, 1); this.tableData.splice(index, 1);
...@@ -272,7 +206,7 @@ export default { ...@@ -272,7 +206,7 @@ export default {
updateRow(index){ updateRow(index){
console.log(index); console.log(index);
this.indexs=index; this.indexs=index;
this.form = JSON.parse(JSON.stringify(this.tableData[index])); this.form = this.tableData[index];
this.open = true; this.open = true;
this.optType = "edit"; this.optType = "edit";
}, },
......
...@@ -359,14 +359,11 @@ export default { ...@@ -359,14 +359,11 @@ export default {
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {
taskCode: [ workstationCode: [
{ required: true, message: "任务单号称不能为空", trigger: "blur" } { required: true, message: "工作中心不能为空", trigger: "blur" }
],
arrangeCode: [
{ required: true, message: "编排单号称不能为空", trigger: "blur" }
], ],
createTime: [ createTime: [
{ required: true, message: "编排单号称不能为空", trigger: "blur" } { required: true, message: "申请时间不能为空", trigger: "blur" }
], ],
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment