| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- <template>
- <ele-modal
- title="弹窗示例"
- :maxable="true"
- custom-class="ele-dialog-form long-dialog-form"
- :centered="true"
- :visible.sync="visible"
- :close-on-click-modal="false"
- width="85%"
- append-to-body
- @close="handleClose"
- >
- <ele-pro-table
- style="min-height: 400px"
- ref="fileTable"
- :columns="columns"
- :datasource="workList"
- >
- <template v-slot:starttime="{ row, $index }">
- <el-date-picker
- v-model="row.starttime"
- type="datetime"
- value-format="yyyy-MM-dd HH:mm:ss"
- placeholder="选择开始日期"
- >
- </el-date-picker>
- </template>
- <template v-slot:endtime="{ row, $index }">
- <el-date-picker
- v-model="row.endtime"
- type="datetime"
- value-format="yyyy-MM-dd HH:mm:ss"
- placeholder="选择结束日期"
- >
- </el-date-picker>
- </template>
- <template v-slot:wuping="{ row }">
- <el-button type="primary" @click="goDetails(row, 'wuping')"
- >物品({{ dataLeng(row, 'wuping') }})</el-button
- >
- </template>
- <template v-slot:zysx="{ row }">
- <el-button type="primary" @click="goDetails(row, 'zysx')"
- >注意事项({{ dataLeng(row, 'zysx') }})</el-button
- >
- </template>
- <template v-slot:action="{ row }">
- <el-link type="primary" @click="saveData(row)" :underline="false"
- >保存</el-link
- >
- </template>
- <!-- 表头工具栏 -->
- </ele-pro-table>
- <Details
- v-if="detailsVisible"
- :detailsVisible="detailsVisible"
- @close="close"
- :list="list"
- />
- </ele-modal>
- </template>
- <script>
- import Details from './details.vue';
- import { listByParam } from '@/api/produce/workOrder';
- export default {
- components: { Details },
- data() {
- return {
- visible: false,
- columns: [
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true
- },
- {
- label: '编码',
- prop: 'code',
- width: 110,
- align: 'center',
- showOverflowTooltip: true
- },
- {
- label: '名称',
- prop: 'name',
- width: 180,
- align: 'center',
- showOverflowTooltip: true
- },
- {
- label: '内容',
- prop: 'defaultValue',
- minWidth: 300,
- align: 'center',
- showOverflowTooltip: true
- },
- {
- slot: 'wuping',
- label: '物品',
- prop: 'wuping',
- width: 130,
- align: 'center',
- showOverflowTooltip: true
- },
- {
- slot: 'zysx',
- label: '注意事项',
- prop: 'zysx',
- width: 130,
- align: 'center',
- showOverflowTooltip: true
- },
- {
- label: '工时',
- prop: 'hs',
- width: 100,
- align: 'center',
- showOverflowTooltip: true
- },
- {
- label: '开始时间',
- slot: 'starttime',
- prop: 'starttime',
- width: 250,
- align: 'center',
- showOverflowTooltip: true
- },
- {
- label: '结束时间',
- slot: 'endtime',
- prop: 'endtime',
- width: 250,
- align: 'center',
- showOverflowTooltip: true
- },
- {
- columnKey: 'action',
- slot: 'action',
- label: '操作',
- align: 'center',
- width: 130,
- resizable: false,
- showOverflowTooltip: true
- }
- ],
- workList: [
- {
- name: '哈哈哈哈哈哈哈',
- timeFlag: false
- },
- {
- name: '哈哈哈哈哈哈哈',
- time: '',
- timeFlag: true
- },
- {
- name: '哈哈哈哈哈哈哈',
- wuping: [
- {
- code: '物品'
- }
- ]
- },
- {
- name: '哈哈哈哈哈哈哈',
- zysx: [
- {
- code: '注意事项'
- }
- ]
- },
- {
- name: '哈哈哈哈哈哈哈'
- },
- {
- name: '哈哈哈哈哈哈哈'
- },
- {
- name: '哈哈哈哈哈哈哈'
- },
- {
- name: '哈哈哈哈哈哈哈'
- }
- ],
- detailsVisible: false,
- list: []
- };
- },
- computed: {
- dataLeng() {
- return (row, type) => {
- if (!row[type]) {
- return 0;
- }
- return row[type].length;
- };
- }
- },
- methods: {
- open(id) {
- console.log(id, 'id ----');
- this.visible = true;
- this.getList(id);
- },
- getList(id) {
- listByParam(id)
- .then((res) => {
- console.log(res, 'res ---');
- })
- .catch((err) => {
- console.log(err, 'err');
- });
- },
- // 保存
- saveData(row) {
- // 注意判断时间 是否填写
- console.log('这里做最后的提交', row);
- },
- handleClose() {
- this.visible = false;
- },
- close() {
- this.detailsVisible = false;
- },
- goDetails(row, type) {
- if (!row[type] || row[type].length == 0) {
- return this.$message.warning('暂无详细数据');
- }
- this.list = row[type];
- this.detailsVisible = true;
- }
- }
- };
- </script>
|