|
@@ -21,7 +21,7 @@
|
|
|
|
|
|
<div class="table-operator" style="margin-bottom: 8px;">
|
|
|
<a-button v-if="$auth('purchase-purchase-orders-add')" type="primary" icon="plus" @click="$refs.baseForm.base()">新增</a-button>
|
|
|
- <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('purchase-purchase-orders-del')">
|
|
|
+ <!-- <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('purchase-purchase-orders-del')">
|
|
|
<a-menu slot="overlay">
|
|
|
<a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
|
|
|
<a-menu-item key="1"><a-icon type="delete" /><a>删除</a></a-menu-item>
|
|
@@ -30,7 +30,7 @@
|
|
|
<a-button style="margin-left: 8px">
|
|
|
批量操作 <a-icon type="down" />
|
|
|
</a-button>
|
|
|
- </a-dropdown>
|
|
|
+ </a-dropdown> -->
|
|
|
</div>
|
|
|
|
|
|
<s-table
|
|
@@ -45,24 +45,37 @@
|
|
|
showPagination="auto"
|
|
|
>
|
|
|
<span slot="action" slot-scope="record">
|
|
|
-
|
|
|
+ <a @click="handleView(record)">查看</a>
|
|
|
+ <operation-button
|
|
|
+ v-if=" record.status===1"
|
|
|
+ @click="handleEdit(record)"
|
|
|
+ >修改</operation-button>
|
|
|
+ <operation-button
|
|
|
+ v-if=" record.status===1"
|
|
|
+ :type="2"
|
|
|
+ title="是否要删除该条数据?"
|
|
|
+ @confirm="batchDelete(record.id)">删除</operation-button>
|
|
|
</span>
|
|
|
</s-table>
|
|
|
</div>
|
|
|
<BaseForm ref="baseForm" @ok="handleOk"/>
|
|
|
+ <Detail ref="detail" @ok="handleOk"/>
|
|
|
</a-card>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { STable, Ellipsis } from '@/components'
|
|
|
-import { getPurchaseOrderPage2, deletePurchaseOrders } from '@/api/purchase/purchase-order'
|
|
|
+import { getPurchaseOrderPage2, deletePurchaseOrder2, getPurchaseOrderInfo } from '@/api/purchase/purchase-order'
|
|
|
import BaseForm from './modules/BaseForm.vue'
|
|
|
+import Detail from './modules/Detail.vue'
|
|
|
+
|
|
|
export default {
|
|
|
name: 'PurchaseOrderList',
|
|
|
components: {
|
|
|
STable,
|
|
|
Ellipsis,
|
|
|
- BaseForm
|
|
|
+ BaseForm,
|
|
|
+ Detail
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
@@ -142,10 +155,6 @@ export default {
|
|
|
],
|
|
|
// 下拉框map
|
|
|
typeMap: {},
|
|
|
- statusMap: {},
|
|
|
- payTypeMap: {},
|
|
|
- invoiceTypeMap: {},
|
|
|
- moneyTypeMap: {},
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
parameter = {
|
|
@@ -163,12 +172,10 @@ export default {
|
|
|
},
|
|
|
selectedRowKeys: [],
|
|
|
selectedRows: [],
|
|
|
-
|
|
|
options: {
|
|
|
alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
|
|
|
rowSelection: {
|
|
|
- selectedRowKeys: this.selectedRowKeys,
|
|
|
- onChange: this.onSelectChange
|
|
|
+ selectedRowKeys: this.selectedRowKeys
|
|
|
}
|
|
|
},
|
|
|
optionAlertShow: false
|
|
@@ -177,11 +184,6 @@ export default {
|
|
|
created () {
|
|
|
// 下拉框map
|
|
|
this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.LONG_YAN_PURCHASE_TYPE)
|
|
|
-
|
|
|
- this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PURCHASE_ORDER_STATUS)
|
|
|
- this.payTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PURCHASE_PAY_TYPE)
|
|
|
- this.invoiceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PURCHASE_INVOICE_TYPE)
|
|
|
- this.moneyTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.MONEY_TYPE)
|
|
|
this.tableOption()
|
|
|
},
|
|
|
methods: {
|
|
@@ -191,7 +193,6 @@ export default {
|
|
|
alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
|
|
|
rowSelection: {
|
|
|
selectedRowKeys: this.selectedRowKeys,
|
|
|
- onChange: this.onSelectChange,
|
|
|
getCheckboxProps: record => ({
|
|
|
props: {
|
|
|
disabled: false,
|
|
@@ -213,28 +214,13 @@ export default {
|
|
|
this.visible = true
|
|
|
this.$refs.table.refresh()
|
|
|
},
|
|
|
- onSelectChange (selectedRowKeys, selectedRows) {
|
|
|
- this.selectedRowKeys = selectedRowKeys
|
|
|
- this.selectedRows = selectedRows
|
|
|
- },
|
|
|
resetSearchForm () {
|
|
|
this.queryParam = {
|
|
|
}
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
batchDelete (id) {
|
|
|
- let ids = []
|
|
|
- if (this.BaseTool.String.isBlank(id)) {
|
|
|
- const length = this.selectedRows.length
|
|
|
- if (length === 0) {
|
|
|
- this.$message.info('请选择要删除的记录')
|
|
|
- return
|
|
|
- }
|
|
|
- ids = this.selectedRows.map(item => item.id)
|
|
|
- } else {
|
|
|
- ids = [id]
|
|
|
- }
|
|
|
- deletePurchaseOrders(ids).then(res => {
|
|
|
+ deletePurchaseOrder2({ id }).then(res => {
|
|
|
this.$message.info('删除成功')
|
|
|
this.handleOk()
|
|
|
this.$refs.table.clearSelected()
|
|
@@ -242,6 +228,16 @@ export default {
|
|
|
},
|
|
|
handleEnter () {
|
|
|
this.$refs.table.refresh(true)
|
|
|
+ },
|
|
|
+ handleEdit (record) {
|
|
|
+ getPurchaseOrderInfo(record).then(res => {
|
|
|
+ this.$refs.baseForm.base(res.data)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleView (record) {
|
|
|
+ getPurchaseOrderInfo(record).then(res => {
|
|
|
+ this.$refs.detail.base(res.data)
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|