|
@@ -24,9 +24,15 @@
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
<!--列表-->
|
|
<!--列表-->
|
|
- <el-table :data="allocations" :height="tableHeight" highlight-current-row v-loading="listLoading" style="width: 100%;">
|
|
|
|
|
|
+ <el-table
|
|
|
|
+ :data="allocations"
|
|
|
|
+ :height="tableHeight"
|
|
|
|
+ highlight-current-row
|
|
|
|
+ v-loading="listLoading"
|
|
|
|
+ style="width: 100%;"
|
|
|
|
+ >
|
|
<el-table-column type="index" width="60"></el-table-column>
|
|
<el-table-column type="index" width="60"></el-table-column>
|
|
- <el-table-column prop="id" label="云模设备号" width="120" sortable></el-table-column>
|
|
|
|
|
|
+ <el-table-column prop="id" label="云模盒编号" width="120" sortable></el-table-column>
|
|
<el-table-column prop="power" label="电量" width="80" sortable></el-table-column>
|
|
<el-table-column prop="power" label="电量" width="80" sortable></el-table-column>
|
|
<el-table-column prop="useLife" label="倒计时" width="100" sortable></el-table-column>
|
|
<el-table-column prop="useLife" label="倒计时" width="100" sortable></el-table-column>
|
|
<el-table-column prop="equipmentName" label="模具名称" width="100" sortable></el-table-column>
|
|
<el-table-column prop="equipmentName" label="模具名称" width="100" sortable></el-table-column>
|
|
@@ -46,7 +52,7 @@
|
|
@click="enable(scope.$index)"
|
|
@click="enable(scope.$index)"
|
|
:disabled="scope.row.state == true"
|
|
:disabled="scope.row.state == true"
|
|
>启用</el-button>
|
|
>启用</el-button>
|
|
- <el-button size="small">修改</el-button>
|
|
|
|
|
|
+ <el-button size="small" @click="showEdit(5)">修改</el-button>
|
|
<el-button type="danger" size="small">删除</el-button>
|
|
<el-button type="danger" size="small">删除</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -81,16 +87,16 @@
|
|
:inline="true"
|
|
:inline="true"
|
|
class="demo-form-inline"
|
|
class="demo-form-inline"
|
|
>
|
|
>
|
|
- <el-form-item label="设备号" prop="typeNumber">
|
|
|
|
|
|
+ <el-form-item label="设备号">
|
|
<el-input v-model="newAllocation.equipmentNo" autocomplete="off" placeholder="请填写"></el-input>
|
|
<el-input v-model="newAllocation.equipmentNo" autocomplete="off" placeholder="请填写"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="所属公司" prop="name">
|
|
|
|
|
|
+ <el-form-item label="所属公司">
|
|
<el-input v-model="newAllocation.belongCompanyId" autocomplete="off" placeholder="请填写"></el-input>
|
|
<el-input v-model="newAllocation.belongCompanyId" autocomplete="off" placeholder="请填写"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button @click.native="addFormVisible = false">取消</el-button>
|
|
<el-button @click.native="addFormVisible = false">取消</el-button>
|
|
- <el-button type="primary" @click="addMould">提交</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="addMould()">提交</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
@@ -110,17 +116,22 @@
|
|
:inline="true"
|
|
:inline="true"
|
|
class="demo-form-inline"
|
|
class="demo-form-inline"
|
|
>
|
|
>
|
|
- <el-form-item label="设备号" prop="typeNumber">
|
|
|
|
|
|
+ <el-form-item label="设备号">
|
|
<el-input v-model="newAllocation.equipmentNo" autocomplete="off" placeholder="请填写"></el-input>
|
|
<el-input v-model="newAllocation.equipmentNo" autocomplete="off" placeholder="请填写"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="所属公司" prop="name">
|
|
|
|
|
|
+ <el-form-item label="所属公司">
|
|
<el-input v-model="newAllocation.belongCompanyId" autocomplete="off" placeholder="请填写"></el-input>
|
|
<el-input v-model="newAllocation.belongCompanyId" autocomplete="off" placeholder="请填写"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="设备名称">
|
|
|
|
+ <el-input v-model="newAllocation.equipmentName" autocomplete="off" placeholder="请填写"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="使用年限">
|
|
|
|
+ <el-input v-model="newAllocation.useLife" autocomplete="off" placeholder="请填写"></el-input>
|
|
|
|
+ </el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button @click.native="editFormVisible = false">取消</el-button>
|
|
<el-button @click.native="editFormVisible = false">取消</el-button>
|
|
- <!-- 这里少了几个属性别忘了加上了 -->
|
|
|
|
- <el-button type="primary">提交</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="editMould">提交</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</section>
|
|
</section>
|
|
@@ -192,37 +203,77 @@ export default {
|
|
showAllocation() {
|
|
showAllocation() {
|
|
this.addFormVisible = true;
|
|
this.addFormVisible = true;
|
|
this.newAllocation = {
|
|
this.newAllocation = {
|
|
- id: "", //设备编号
|
|
|
|
- useLife: "", //使用年限
|
|
|
|
- equipmentName: "", //设备名称
|
|
|
|
- equipmentNo: "", //设备id
|
|
|
|
- belongCompanyId: "" //所属公司ID
|
|
|
|
|
|
+ id: "",
|
|
|
|
+ useLife: "",
|
|
|
|
+ equipmentName: "",
|
|
|
|
+ equipmentNo: "",
|
|
|
|
+ belongCompanyId: ""
|
|
};
|
|
};
|
|
},
|
|
},
|
|
//修改界面
|
|
//修改界面
|
|
- showEdit() {
|
|
|
|
|
|
+ showEdit(equipmentId) {
|
|
this.editFormVisible = true;
|
|
this.editFormVisible = true;
|
|
this.newAllocation = {
|
|
this.newAllocation = {
|
|
- id: "", //设备编号
|
|
|
|
- useLife: "", //使用年限
|
|
|
|
- equipmentName: "", //设备名称
|
|
|
|
- equipmentNo: "", //设备id
|
|
|
|
- belongCompanyId: "" //所属公司ID
|
|
|
|
|
|
+ id: equipmentId,
|
|
|
|
+ useLife: "",
|
|
|
|
+ equipmentName: "",
|
|
|
|
+ equipmentNo: "",
|
|
|
|
+ belongCompanyId: ""
|
|
};
|
|
};
|
|
},
|
|
},
|
|
//添加模具
|
|
//添加模具
|
|
- addMould(){
|
|
|
|
- //添加模具调用
|
|
|
|
- this.$refs.addForm.validate(valid => {
|
|
|
|
|
|
+ addMould() {
|
|
|
|
+ this.$refs.newAllocation.validate(valid => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ this.editLoading = true;
|
|
|
|
+ this.http.post(
|
|
|
|
+ this.port.base.editMould,
|
|
|
|
+ {
|
|
|
|
+ equipmentNo: this.newAllocation.equipmentNo,
|
|
|
|
+ belongCompanyId: this.newAllocation.belongCompanyId
|
|
|
|
+ },
|
|
|
|
+ res => {
|
|
|
|
+ this.editLoading = false;
|
|
|
|
+ this.editFormVisible = false;
|
|
|
|
+ if (res.code == "ok") {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "添加成功",
|
|
|
|
+ type: "success"
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: res.msg,
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ error => {
|
|
|
|
+ this.editLoading = false;
|
|
|
|
+ this.editFormVisible = false;
|
|
|
|
+ this.$message({
|
|
|
|
+ message: error,
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ //编辑模具
|
|
|
|
+ editMould() {
|
|
|
|
+ this.$refs.newAllocation.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
this.editLoading = true;
|
|
this.editLoading = true;
|
|
this.http.post(
|
|
this.http.post(
|
|
this.port.base.editMould,
|
|
this.port.base.editMould,
|
|
{
|
|
{
|
|
- id: this.newAllocation.id,
|
|
|
|
- belongCompanyId: this.newAllocation,belongCompanyId
|
|
|
|
|
|
+ equipmentNo: this.newAllocation.equipmentNo,
|
|
|
|
+ equipmentName: this.newAllocation.equipmentName,
|
|
|
|
+ belongCompanyId: this.newAllocation.belongCompanyId,
|
|
|
|
+ useLife: this.newAllocation.useLife
|
|
},
|
|
},
|
|
res => {
|
|
res => {
|
|
|
|
+ console.log(res);
|
|
this.editLoading = false;
|
|
this.editLoading = false;
|
|
this.editFormVisible = false;
|
|
this.editFormVisible = false;
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
@@ -230,7 +281,6 @@ export default {
|
|
message: "添加成功",
|
|
message: "添加成功",
|
|
type: "success"
|
|
type: "success"
|
|
});
|
|
});
|
|
- this.getRoles();
|
|
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|