|
@@ -15,7 +15,7 @@
|
|
|
|
|
|
<a-col :md="6" :sm="8">
|
|
|
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
|
|
- <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
|
|
+ <a-button type="primary" @click="getSupplierList" icon="search">查询</a-button>
|
|
|
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
|
|
<a @click="handleToggleSearch" style="margin-left: 8px">
|
|
|
{{ toggleSearchStatus ? '收起' : '展开' }}
|
|
@@ -44,13 +44,13 @@
|
|
|
<a-table
|
|
|
bordered
|
|
|
v-if="suplierListData"
|
|
|
- :rowKey=" (row, index) => {return index;}"
|
|
|
+ :row-key="record => record.id"
|
|
|
:columns="suplierListColumns"
|
|
|
:data-source="suplierListData"
|
|
|
:loading="loading"
|
|
|
:pagination="pagination"
|
|
|
@change="handleTableChange"
|
|
|
- :rowSelection="{ onChange: onSelectChange }"
|
|
|
+ :rowSelection="{ selectedRowKeys: selectedRowKeys,onChange: onSelectChange }"
|
|
|
:scroll="{ x: 1500,y: 500 }"
|
|
|
>
|
|
|
<!-- 供应商编码 -->
|
|
@@ -63,12 +63,12 @@
|
|
|
</a-form-model-item>
|
|
|
</template>
|
|
|
<!-- 供应商名称 -->
|
|
|
- <template slot="supplierName" slot-scope="text, record, index" >
|
|
|
- <a-form-model-item prop="supplierName" :rules="rules.supplierName" v-if="record.status == '0'">
|
|
|
- <a-input style="width:100%" type="text" v-model="record.supplierName" />
|
|
|
+ <template slot="supplier" slot-scope="text, record, index" >
|
|
|
+ <a-form-model-item prop="supplier" :rules="rules.supplier" v-if="record.status == '0'">
|
|
|
+ <a-input style="width:100%" type="text" v-model="record.supplier" />
|
|
|
</a-form-model-item>
|
|
|
- <a-form-model-item prop="supplierName" :rules="rules.supplierName" v-if="record.status == '1'">
|
|
|
- <span>{{record.supplierName}}</span>
|
|
|
+ <a-form-model-item prop="supplier" :rules="rules.supplier" v-if="record.status == '1'">
|
|
|
+ <span>{{record.supplier}}</span>
|
|
|
</a-form-model-item>
|
|
|
</template>
|
|
|
<!-- 产能额度(月) -->
|
|
@@ -77,7 +77,7 @@
|
|
|
<a-input style="width:100%" type="text" v-model="record.capacityQuota" />
|
|
|
</a-form-model-item>
|
|
|
<a-form-model-item prop="capacityQuota" :rules="rules.capacityQuota" v-if="record.status == '1'">
|
|
|
- <span>{{record.supplierName}}</span>
|
|
|
+ <span>{{record.capacityQuota}}</span>
|
|
|
</a-form-model-item>
|
|
|
</template>
|
|
|
<!-- 工时(月) -->
|
|
@@ -90,21 +90,21 @@
|
|
|
</a-form-model-item>
|
|
|
</template>
|
|
|
<!-- 供应商状态 -->
|
|
|
- <template slot="supplierStatus" slot-scope="text, record, index" >
|
|
|
- <a-form-model-item prop="supplierStatus" :rules="rules.supplierStatus" v-if="record.status == '0'">
|
|
|
- <a-input style="width:100%" type="text" v-model="record.supplierStatus" />
|
|
|
+ <template slot="supplierState" slot-scope="text, record, index" >
|
|
|
+ <a-form-model-item prop="supplierState" :rules="rules.supplierState" v-if="record.status == '0'">
|
|
|
+ <a-input style="width:100%" type="text" v-model="record.supplierState" />
|
|
|
</a-form-model-item>
|
|
|
- <a-form-model-item prop="supplierStatus" :rules="rules.supplierStatus" v-if="record.status == '1'">
|
|
|
- <span>{{record.supplierStatus}}</span>
|
|
|
+ <a-form-model-item prop="supplierState" :rules="rules.supplierState" v-if="record.status == '1'">
|
|
|
+ <span>{{record.supplierState}}</span>
|
|
|
</a-form-model-item>
|
|
|
</template>
|
|
|
<!-- 备注 -->
|
|
|
- <template slot="memo" slot-scope="text, record, index" >
|
|
|
- <a-form-model-item prop="memo" :rules="rules.memo" v-if="record.status == '0'">
|
|
|
- <a-input style="width:100%" type="text" v-model="record.memo" />
|
|
|
+ <template slot="remarks" slot-scope="text, record, index" >
|
|
|
+ <a-form-model-item prop="remarks" :rules="rules.remarks" v-if="record.status == '0'">
|
|
|
+ <a-input style="width:100%" type="text" v-model="record.remarks" />
|
|
|
</a-form-model-item>
|
|
|
- <a-form-model-item prop="memo" :rules="rules.memo" v-if="record.status == '1'">
|
|
|
- <span>{{record.memo}}</span>
|
|
|
+ <a-form-model-item prop="remarks" :rules="rules.remarks" v-if="record.status == '1'">
|
|
|
+ <span>{{record.remarks}}</span>
|
|
|
</a-form-model-item>
|
|
|
</template>
|
|
|
</a-table>
|
|
@@ -117,7 +117,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
import JEllipsis from '@/components/jeecg/JEllipsis'
|
|
|
import moment from 'moment'
|
|
|
|
|
|
-import { supplierList } from '@api/reportForms/supplier-capacity'
|
|
|
+import { supplierList,addSupplierList,editSupplierList,deleteSupplierList } from '@api/reportForms/supplier-capacity'
|
|
|
|
|
|
export default {
|
|
|
name: 'PreBookList', // 预托书列表
|
|
@@ -141,7 +141,7 @@ export default {
|
|
|
dataIndex: 'supplier',
|
|
|
width: 120,
|
|
|
className: 'replacecolor' ,
|
|
|
- scopedSlots: { customRender: 'supplierName' },
|
|
|
+ scopedSlots: { customRender: 'supplier' },
|
|
|
},
|
|
|
{
|
|
|
title: '产能额度(月)',
|
|
@@ -162,14 +162,14 @@ export default {
|
|
|
dataIndex: 'supplierState',
|
|
|
width: 120,
|
|
|
className: 'replacecolor' ,
|
|
|
- scopedSlots: { customRender: 'supplierStatus' },
|
|
|
+ scopedSlots: { customRender: 'supplierState' },
|
|
|
},
|
|
|
{
|
|
|
title: '备注',
|
|
|
dataIndex: 'remarks',
|
|
|
width: 120,
|
|
|
className: 'replacecolor' ,
|
|
|
- scopedSlots: { customRender: 'memo' },
|
|
|
+ scopedSlots: { customRender: 'remarks' },
|
|
|
},
|
|
|
|
|
|
],
|
|
@@ -180,15 +180,13 @@ export default {
|
|
|
loading: false, // 表格加载
|
|
|
|
|
|
// 查询条件
|
|
|
- queryParam: {
|
|
|
- supplier: '',//供应商
|
|
|
- pageNo: '' // 点击的页数
|
|
|
- },
|
|
|
+ queryParam: { },
|
|
|
pagination: {
|
|
|
// total: '',
|
|
|
// current: 0,
|
|
|
// pageSize: 0
|
|
|
},
|
|
|
+ defaultMode:'add'
|
|
|
|
|
|
}
|
|
|
},
|
|
@@ -221,14 +219,20 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ //重置
|
|
|
+ searchReset(){
|
|
|
+ this.queryParam = {}
|
|
|
+ this.getSupplierList()
|
|
|
+ },
|
|
|
+
|
|
|
addLine(){
|
|
|
var line ={
|
|
|
supplierCode:'',
|
|
|
- supplierName:'',
|
|
|
+ supplier:'',
|
|
|
capacityQuota:'',
|
|
|
workingHours:'',
|
|
|
- supplierStatus:'',
|
|
|
- memo:'',
|
|
|
+ supplierState:'',
|
|
|
+ remarks:'',
|
|
|
status : '0'
|
|
|
}
|
|
|
this.suplierListData.unshift(line)
|
|
@@ -240,22 +244,65 @@ export default {
|
|
|
this.$message.error('一次只允许修改一行数据');
|
|
|
}else{
|
|
|
this.suplierListData.map(item =>{
|
|
|
- if(item.supplierStatus == this.selectedRows[0].supplierStatus){
|
|
|
+ if(item.supplierState == this.selectedRows[0].supplierState){
|
|
|
item.status = '0'
|
|
|
}
|
|
|
})
|
|
|
+ this.defaultMode = 'edit'
|
|
|
this.$forceUpdate()
|
|
|
|
|
|
}
|
|
|
},
|
|
|
delectLLine(){
|
|
|
-
|
|
|
+ var ids = this.selectedRowKeys.toString()
|
|
|
+ deleteSupplierList({ids}).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success('删除成功');
|
|
|
+ this.getSupplierList()
|
|
|
+ }else{
|
|
|
+ this.$message.error(res.message);
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
saveLine(){
|
|
|
+ if(this.defaultMode == 'add'){
|
|
|
+ var syCapacityControl = this.suplierListData[0]
|
|
|
+ addSupplierList(syCapacityControl).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success('新增成功');
|
|
|
+ this.getSupplierList()
|
|
|
+ }else{
|
|
|
+ this.$message.error(res.message);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ var newObj = this.selectedRows[0]
|
|
|
+ editSupplierList(newObj).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success('修改成功');
|
|
|
+ this.getSupplierList()
|
|
|
+ this.selectedRowKeys = []
|
|
|
+ this.selectedRows = []
|
|
|
+ }else{
|
|
|
+ this.$message.error(res.message);
|
|
|
+ }
|
|
|
+ //清空勾选恢复默认
|
|
|
+ this.selectedRowKeys = []
|
|
|
+ this.selectedRows = []
|
|
|
+ this.defaultMode = 'add'
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
},
|
|
|
cancelLine(){
|
|
|
-
|
|
|
+ if(this.defaultMode == 'add'){
|
|
|
+ this.suplierListData.shift()
|
|
|
+ }else {
|
|
|
+ this.getSupplierList()
|
|
|
+ this.defaultMode ='add'
|
|
|
+ this.selectedRowKeys=[]
|
|
|
+ this.selectedRows = []
|
|
|
+ }
|
|
|
},
|
|
|
subitLine(){
|
|
|
|
|
@@ -269,6 +316,12 @@ export default {
|
|
|
this.selectedRows = rows
|
|
|
|
|
|
},
|
|
|
+ // 分页、排序、筛选变化时触发
|
|
|
+ handleTableChange(pagination, filters, sorter) {
|
|
|
+ // console.log('当前页信息>>>>',pagination)
|
|
|
+ this.queryParam.pageNo = pagination.current
|
|
|
+ this.getSupplierList()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|