|
@@ -10,7 +10,7 @@
|
|
|
<el-input placeholder="请输入" v-model="name"></el-input>
|
|
<el-input placeholder="请输入" v-model="name"></el-input>
|
|
|
</div>
|
|
</div>
|
|
|
<!-- 数据表格 -->
|
|
<!-- 数据表格 -->
|
|
|
- <!-- :highlight-current-row="isSingle" -->
|
|
|
|
|
|
|
+ <!-- :highlight-current-row="isSingle" -->
|
|
|
<ele-pro-table
|
|
<ele-pro-table
|
|
|
ref="table"
|
|
ref="table"
|
|
|
:columns="columns"
|
|
:columns="columns"
|
|
@@ -21,19 +21,16 @@
|
|
|
:selection.sync="selectionList"
|
|
:selection.sync="selectionList"
|
|
|
:datasource="datasourceShow"
|
|
:datasource="datasourceShow"
|
|
|
:current.sync="current"
|
|
:current.sync="current"
|
|
|
- highlight-current-row
|
|
|
|
|
|
|
+ highlight-current-row
|
|
|
height="45vh"
|
|
height="45vh"
|
|
|
- @row-click="choose"
|
|
|
|
|
|
|
+ @row-click="choose"
|
|
|
>
|
|
>
|
|
|
- <template v-slot:select="{ row }">
|
|
|
|
|
- <el-radio
|
|
|
|
|
- class="radio"
|
|
|
|
|
- v-model="radio"
|
|
|
|
|
- :label="row.id"
|
|
|
|
|
- ><i></i
|
|
|
|
|
- ></el-radio>
|
|
|
|
|
- </template>
|
|
|
|
|
- </ele-pro-table>
|
|
|
|
|
|
|
+ <template v-slot:select="{ row }">
|
|
|
|
|
+ <el-radio class="radio" v-model="radio" :label="row.id"
|
|
|
|
|
+ ><i></i
|
|
|
|
|
+ ></el-radio>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </ele-pro-table>
|
|
|
<div class="footer" slot="footer">
|
|
<div class="footer" slot="footer">
|
|
|
<el-button @click="cancel">取消</el-button>
|
|
<el-button @click="cancel">取消</el-button>
|
|
|
<el-button @click="confirm" type="primary">确定</el-button>
|
|
<el-button @click="confirm" type="primary">确定</el-button>
|
|
@@ -42,10 +39,10 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
- import { getDeviceList , getPlanDeviceList } from '@/api/productionPlan/order';
|
|
|
|
|
|
|
+ import { getDeviceList, getPlanDeviceList } from '@/api/productionPlan/order';
|
|
|
export default {
|
|
export default {
|
|
|
props: ['produceVersionId'],
|
|
props: ['produceVersionId'],
|
|
|
- data () {
|
|
|
|
|
|
|
+ data() {
|
|
|
return {
|
|
return {
|
|
|
visible: false,
|
|
visible: false,
|
|
|
current: null,
|
|
current: null,
|
|
@@ -55,11 +52,11 @@
|
|
|
datasource: [],
|
|
datasource: [],
|
|
|
isSingle: false,
|
|
isSingle: false,
|
|
|
callback: null,
|
|
callback: null,
|
|
|
- radio:'',
|
|
|
|
|
|
|
+ radio: ''
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
- columns () {
|
|
|
|
|
|
|
+ columns() {
|
|
|
const list = [
|
|
const list = [
|
|
|
{
|
|
{
|
|
|
label: '设备编码',
|
|
label: '设备编码',
|
|
@@ -96,15 +93,15 @@
|
|
|
|
|
|
|
|
if (!this.isSingle) {
|
|
if (!this.isSingle) {
|
|
|
list.push({
|
|
list.push({
|
|
|
- slot: 'select',
|
|
|
|
|
- prop: 'select',
|
|
|
|
|
- label: '选择',
|
|
|
|
|
- align: 'center'
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ slot: 'select',
|
|
|
|
|
+ prop: 'select',
|
|
|
|
|
+ label: '选择',
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
return list;
|
|
return list;
|
|
|
},
|
|
},
|
|
|
- datasourceShow () {
|
|
|
|
|
|
|
+ datasourceShow() {
|
|
|
return this.datasource?.filter((item) => {
|
|
return this.datasource?.filter((item) => {
|
|
|
if (this.name) {
|
|
if (this.name) {
|
|
|
return item.name.includes(this.name);
|
|
return item.name.includes(this.name);
|
|
@@ -115,20 +112,20 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- open (val,list = []) {
|
|
|
|
|
|
|
+ open(val, list = []) {
|
|
|
this.memoList = list;
|
|
this.memoList = list;
|
|
|
this.isSingle = false;
|
|
this.isSingle = false;
|
|
|
this.visible = true;
|
|
this.visible = true;
|
|
|
this._getList(val);
|
|
this._getList(val);
|
|
|
},
|
|
},
|
|
|
- openSingle (list = [], callback) {
|
|
|
|
|
|
|
+ openSingle(list = [], callback) {
|
|
|
this.memoList = list;
|
|
this.memoList = list;
|
|
|
this.callback = callback;
|
|
this.callback = callback;
|
|
|
this.isSingle = true;
|
|
this.isSingle = true;
|
|
|
this.visible = true;
|
|
this.visible = true;
|
|
|
this._getList();
|
|
this._getList();
|
|
|
},
|
|
},
|
|
|
- handleDone ({ data }) {
|
|
|
|
|
|
|
+ handleDone({ data }) {
|
|
|
if (this.memoList.length) {
|
|
if (this.memoList.length) {
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
if (this.isSingle) {
|
|
if (this.isSingle) {
|
|
@@ -144,38 +141,37 @@
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- async _getList (val) {
|
|
|
|
|
- const fn = val?getPlanDeviceList:getDeviceList
|
|
|
|
|
|
|
+ async _getList(val) {
|
|
|
|
|
+ const fn = val ? getPlanDeviceList : getDeviceList;
|
|
|
const data = await fn({
|
|
const data = await fn({
|
|
|
name: this.name,
|
|
name: this.name,
|
|
|
produceVersionId: this.produceVersionId
|
|
produceVersionId: this.produceVersionId
|
|
|
});
|
|
});
|
|
|
this.datasource = data || [];
|
|
this.datasource = data || [];
|
|
|
},
|
|
},
|
|
|
- confirm () {
|
|
|
|
|
|
|
+ confirm() {
|
|
|
if (this.isSingle) {
|
|
if (this.isSingle) {
|
|
|
if (!this.current) return this.$message.error('请选择数据');
|
|
if (!this.current) return this.$message.error('请选择数据');
|
|
|
|
|
|
|
|
this.callback && this.callback(this.current);
|
|
this.callback && this.callback(this.current);
|
|
|
} else {
|
|
} else {
|
|
|
- if (!this.current)
|
|
|
|
|
- return this.$message.error('请选择数据');
|
|
|
|
|
|
|
+ if (!this.current) return this.$message.error('请选择数据');
|
|
|
this.$emit('success', [this.current]);
|
|
this.$emit('success', [this.current]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.cancel();
|
|
this.cancel();
|
|
|
},
|
|
},
|
|
|
- cancel () {
|
|
|
|
|
|
|
+ cancel() {
|
|
|
this.$refs.table.clearSelection();
|
|
this.$refs.table.clearSelection();
|
|
|
- this.radio = ''
|
|
|
|
|
- this.current = null
|
|
|
|
|
|
|
+ this.radio = '';
|
|
|
|
|
+ this.current = null;
|
|
|
this.visible = false;
|
|
this.visible = false;
|
|
|
},
|
|
},
|
|
|
- // 单击获取id
|
|
|
|
|
- choose (row) {
|
|
|
|
|
- this.current = row;
|
|
|
|
|
- this.radio = row.id;
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ // 单击获取id
|
|
|
|
|
+ choose(row) {
|
|
|
|
|
+ this.current = row;
|
|
|
|
|
+ this.radio = row.id;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|