From 8611a1ba1696e76cced04ff5d658ba138a05dafd Mon Sep 17 00:00:00 2001 From: zenglf <18502938215@163.com> Date: 星期六, 19 八月 2023 14:37:32 +0800 Subject: [PATCH] 设备管理前端代码提交 截止 20230819 13:55 分 --- src/views/spare/SparePartPurchaseStorageList.vue | 244 +++++++++++++++++++++++------------------------- 1 files changed, 119 insertions(+), 125 deletions(-) diff --git a/src/views/spare/SparePartPurchaseStorageList.vue b/src/views/spare/SparePartPurchaseStorageList.vue index 2ced304..a1c86d4 100644 --- a/src/views/spare/SparePartPurchaseStorageList.vue +++ b/src/views/spare/SparePartPurchaseStorageList.vue @@ -1,6 +1,6 @@ <template> <a-card - title="澶囦欢鍏ュ簱" + title='澶囦欢鍏ュ簱' :bordered='false' > <div class='table-page-search-wrapper'> @@ -67,28 +67,16 @@ @click='handleAdd' type='primary' icon='plus' - >鏂板</a-button> + >鏂板 + </a-button> - - - <a-popconfirm - :title='`纭畾瑕佹彁浜ゅ悧?`' - @confirm='handleSubmit'> - <a-button type='primary' icon='check' - v-if="selectedRowKeys.length > 0 && (selectionRows[0].status ==='0' || selectionRows[0].status==='3')"> - 鎻愪氦 - </a-button> - </a-popconfirm> - - - <a-popconfirm - :title='`纭畾瑕佹挙鍥炲悧?`' - @confirm='handleRevocation'> - <a-button v-if="selectedRowKeys.length > 0 && selectionRows[0].status==='1'" - type='primary' icon='rollback'>鎾ゅ洖 - </a-button> - </a-popconfirm> - + <a-button @click='handleSubmit' type='primary' icon='check' + v-if="selectedRowKeys.length > 0 && (selectionRows[0].status ==='0' || selectionRows[0].status==='3')"> + 鎻愪氦 + </a-button> + <a-button v-if="selectedRowKeys.length > 0 && selectionRows[0].status==='1'" + @click='handleRevocation' type='primary' icon='rollback'>鎾ゅ洖 + </a-button> <!-- <a-dropdown v-if='selectedRowKeys.length > 0'> <a-menu slot='overlay'> <a-menu-item @@ -125,81 +113,29 @@ :scroll="{ x: 'calc(1400px + 50%)', y: 900 }" :columns='columns' :dataSource='dataSource' + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" :pagination='ipagination' :loading='loading' :customRow='clickThenSelect' @change='handleTableChange' > - - - <span - slot='action' - slot-scope='text, record' - > - <a v-if="record.status === '0'" @click='handleEdit(record)'>缂栬緫</a> +<span + slot='action' + slot-scope='text, record' +> + <a v-if="record.status === '0' || record.status === '3'" @click='handleEdit(record)'>缂栬緫</a> <a v-if="record.status === '1'" @click='handleApprove(record)'>瀹℃壒</a> - - <a-divider v-if="record.status === '0'" type='vertical' /> - <a-dropdown v-if="record.status === '0'"> - <a class='ant-dropdown-link'>鏇村 <a-icon type='down' /></a> - <a-menu slot='overlay'> - <a-menu-item> - <a-popconfirm title='纭畾鍒犻櫎鍚�?' - @confirm='() => handleDelete(record.id)'> - <a>鍒犻櫎</a> - </a-popconfirm> - </a-menu-item> - - </a-menu> - </a-dropdown> - </span> - - - <!-- :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}' --> - -<!-- <span - slot='action' - slot-scope='text, record' - > - <a - v-if="record.status === '0'" - @click='handleEdit(record)' - >缂栬緫</a> - - <a-divider - v-if="record.status === '0'" - type='vertical' - /> - <a-popconfirm - title="纭畾鎻愪氦鍏ュ簱鍗曞悧?" - @confirm="() => handleSubmit(record)" - > - <a v-if="record.status === '0'">鎻愪氦</a> - </a-popconfirm> - <a-popconfirm - title="纭畾閫氳繃鍚�?" - @confirm="() => handlePass(record)" - > - <a v-if="record.status === '1'">閫氳繃</a> - </a-popconfirm> - <a-divider - v-if="record.status === '1'" - type="vertical" - /> - <a-popconfirm - title="纭畾鎾ゅ洖鍚�?" - @confirm="() => handleReset(record)" - > - <a v-if="record.status === '1'">鎾ゅ洖</a> - </a-popconfirm> - <a-divider - v-if="record.status === '0'" - type="vertical" - /> - <a-dropdown v-if="record.status === '0'"> + <a-divider + v-if="record.status == '0' || record.status == '3' || record.status == '1'" + type='vertical' + /> + <a-dropdown> <a class='ant-dropdown-link'>鏇村 <a-icon type='down' /></a> <a-menu slot='overlay'> <a-menu-item> + <a @click='handleDetail(record)'>璇︽儏</a> + </a-menu-item> + <a-menu-item v-if="record.status == '0'||record.status == '3'"> <a-popconfirm title='纭畾鍒犻櫎鍚�?' @confirm='() => handleDelete(record.id)' @@ -209,20 +145,77 @@ </a-menu-item> </a-menu> </a-dropdown> - </span>--> + </span> + + + <!-- :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}' --> + + <!-- <span + slot='action' + slot-scope='text, record' + > + <a + v-if="record.status === '0'" + @click='handleEdit(record)' + >缂栬緫</a> + + <a-divider + v-if="record.status === '0'" + type='vertical' + /> + <a-popconfirm + title="纭畾鎻愪氦鍏ュ簱鍗曞悧?" + @confirm="() => handleSubmit(record)" + > + <a v-if="record.status === '0'">鎻愪氦</a> + </a-popconfirm> + <a-popconfirm + title="纭畾閫氳繃鍚�?" + @confirm="() => handlePass(record)" + > + <a v-if="record.status === '1'">閫氳繃</a> + </a-popconfirm> + <a-divider + v-if="record.status === '1'" + type="vertical" + /> + <a-popconfirm + title="纭畾鎾ゅ洖鍚�?" + @confirm="() => handleReset(record)" + > + <a v-if="record.status === '1'">鎾ゅ洖</a> + </a-popconfirm> + <a-divider + v-if="record.status === '0'" + type="vertical" + /> + <a-dropdown v-if="record.status === '0'"> + <a class='ant-dropdown-link'>鏇村 <a-icon type='down' /></a> + <a-menu slot='overlay'> + <a-menu-item> + <a-popconfirm + title='纭畾鍒犻櫎鍚�?' + @confirm='() => handleDelete(record.id)' + > + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span>--> </a-table> <a-tabs - type="card" - defaultActiveKey="1" + type='card' + defaultActiveKey='1' > <a-tab-pane tab='澶囦欢淇℃伅' - key="1" + key='1' > <div - class="table-operator" - style="margin:-16px" + class='table-operator' + style='margin:-16px' > <spare-part-purchase-storage-detail :sparePartPurchaseStorageId='sparePartPurchaseStorageId' /> </div> @@ -265,54 +258,54 @@ key: 'rowIndex', width: 60, align: 'center', - customRender: function (t, r, index) { + customRender: function(t, r, index) { return parseInt(index) + 1 } }, { title: '鍏ュ簱鍗曠紪鐮�', align: 'center', - dataIndex: 'num', + dataIndex: 'num' }, { title: '鐘舵��', align: 'center', - dataIndex: 'status_dictText', + dataIndex: 'status_dictText' }, { title: '鍏ュ簱绫诲瀷', align: 'center', - dataIndex: 'type_dictText', + dataIndex: 'type_dictText' }, { title: '閲囪喘閮ㄩ棬', align: 'center', - dataIndex: 'departId_dictText', + dataIndex: 'departId_dictText' }, { title: '浠撳簱', align: 'center', - dataIndex: 'warehouseId_dictText', + dataIndex: 'warehouseId_dictText' }, { title: '鍒涘缓浜�', align: 'center', - dataIndex: 'createBy', + dataIndex: 'createBy' }, { title: '鍒涘缓鏃ユ湡', align: 'center', - dataIndex: 'createTime', + dataIndex: 'createTime' }, { title: '鏇存柊浜�', align: 'center', - dataIndex: 'updateBy', + dataIndex: 'updateBy' }, { title: '鏇存柊鏃ユ湡', align: 'center', - dataIndex: 'updateTime', + dataIndex: 'updateTime' }, { title: '鎿嶄綔', @@ -320,14 +313,14 @@ align: 'center', fixed: 'right', scopedSlots: { customRender: 'action' }, - width: 200, + width: 200 } ], url: { list: '/spare/sparePartPurchaseStorage/list', delete: '/spare/sparePartPurchaseStorage/delete', deleteBatch: '/spare/sparePartPurchaseStorage/deleteBatch', - auditOperation: "/spare/sparePartPurchaseStorage/auditOperation", + auditOperation: '/spare/sparePartPurchaseStorage/auditOperation', /*鏂板*/ submit: '/spare/sparePartPurchaseStorage/submit', @@ -380,36 +373,36 @@ this.selectionRows = selectionRows }, -/* handleSubmit(record) { - const that = this; - requestPut(that.url.auditOperation, { id: record.id, status: '1' }).then((res) => { - if (res.success) { - that.$message.success("鎻愪氦鎴愬姛!") - that.loadData() - } else { - that.$message.warning("鎻愪氦澶辫触!") - } - }) - },*/ + /* handleSubmit(record) { + const that = this; + requestPut(that.url.auditOperation, { id: record.id, status: '1' }).then((res) => { + if (res.success) { + that.$message.success("鎻愪氦鎴愬姛!") + that.loadData() + } else { + that.$message.warning("鎻愪氦澶辫触!") + } + }) + },*/ handlePass(record) { - const that = this; + const that = this requestPut(that.url.auditOperation, { id: record.id, status: '2' }).then((res) => { if (res.success) { - that.$message.success("瀹℃牳閫氳繃!") + that.$message.success('瀹℃牳閫氳繃!') that.loadData() } else { - that.$message.warning("瀹℃牳澶辫触!") + that.$message.warning('瀹℃牳澶辫触!') } }) }, handleReset(record) { - const that = this; + const that = this requestPut(that.url.auditOperation, { id: record.id, status: '0' }).then((res) => { if (res.success) { - that.$message.success("鎾ゅ洖鎴愬姛!") + that.$message.success('鎾ゅ洖鎴愬姛!') that.loadData() } else { - that.$message.warning("鎾ゅ洖澶辫触!") + that.$message.warning('鎾ゅ洖澶辫触!') } }) }, @@ -454,14 +447,15 @@ searchReset() { this.sparePartPurchaseStorageId = '-1' this.queryParam = {} - this.loadData(1); - }, + this.loadData(1) + } } } </script> <style scoped> @import '~@assets/less/common.less'; + .table-operator .ant-btn { margin: 10px 8px 8px 10px; } -- Gitblit v1.9.3