|
@@ -258,6 +258,8 @@
|
|
|
<el-button v-if="isAuth('pur:commDetail:updatePurCommissionDetail') && (Number(scope.row.approvalState) === 3) && (Number(scope.row.purchaseState) === 1)" type="text" size="small" @click="outsourceHandle(scope.row)">委外</el-button>
|
|
|
<el-button v-if="isAuth('pur:commDetail:infoPutIn') && (Number(scope.row.approvalState) === 3) && (Number(scope.row.purchaseState) === 2||(Number(scope.row.purchaseState) === 5))" type="text" size="small" @click="inBound(scope.row)">入库</el-button>
|
|
|
<el-button v-if="isAuth('pur:commDetail:infoPutInAgain') && (Number(scope.row.approvalState) === 3) && (Number(scope.row.purchaseState) === 5)" type="text" size="small" @click="inBound(scope.row)">再次入库</el-button>
|
|
|
+ <el-button type="text" size="small" @click="exportHandle(scope.row.purchaseId)">导出</el-button>
|
|
|
+
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -286,6 +288,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import Vue from 'vue'
|
|
|
import AddOrUpdate from './outsource-add-or-update'
|
|
|
import Detail from './outsource-detail'
|
|
|
import { getOutsourceList } from '@/api/sale'
|
|
@@ -340,7 +343,7 @@ export default {
|
|
|
],
|
|
|
// 审批状态
|
|
|
optionsState: [],
|
|
|
- selectedRows:[],
|
|
|
+ selectedRows: [],
|
|
|
batchBtnDisabled: false,
|
|
|
batchIncomeBtnDisabled: false
|
|
|
}
|
|
@@ -562,34 +565,34 @@ export default {
|
|
|
this.$refs.amountMaskSetting.init()
|
|
|
})
|
|
|
},
|
|
|
- //监听批量选择的行
|
|
|
- handleSelectionChange(rows){
|
|
|
+ // 监听批量选择的行
|
|
|
+ handleSelectionChange (rows) {
|
|
|
this.selectedRows = rows
|
|
|
this.batchBtnDisabled = false
|
|
|
this.batchIncomeBtnDisabled = false
|
|
|
- //(Number(scope.row.approvalState) === 3) && (Number(scope.row.purchaseState) === 1)
|
|
|
- //控制批量操作按钮
|
|
|
-
|
|
|
- for(let index=0;index<this.selectedRows.length;index++){
|
|
|
+ // (Number(scope.row.approvalState) === 3) && (Number(scope.row.purchaseState) === 1)
|
|
|
+ // 控制批量操作按钮
|
|
|
+
|
|
|
+ for (let index = 0; index < this.selectedRows.length; index++) {
|
|
|
let item = this.selectedRows[index]
|
|
|
- if(Number(item.approvalState) === 3 && Number(item.purchaseState) === 1){
|
|
|
-
|
|
|
+ if (Number(item.approvalState) === 3 && Number(item.purchaseState) === 1) {
|
|
|
+
|
|
|
} else {
|
|
|
this.batchBtnDisabled = true
|
|
|
}
|
|
|
|
|
|
- if(Number(item.approvalState) === 3 && (Number(item.purchaseState) === 2 || Number(item.purchaseState) === 5)){
|
|
|
-
|
|
|
+ if (Number(item.approvalState) === 3 && (Number(item.purchaseState) === 2 || Number(item.purchaseState) === 5)) {
|
|
|
+
|
|
|
} else {
|
|
|
this.batchIncomeBtnDisabled = true
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- //批量委外
|
|
|
- batchHandle(){
|
|
|
- if(this.selectedRows.length == 0){
|
|
|
- this.$message.error("请先勾选数据")
|
|
|
- return
|
|
|
+ // 批量委外
|
|
|
+ batchHandle () {
|
|
|
+ if (this.selectedRows.length == 0) {
|
|
|
+ this.$message.error('请先勾选数据')
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
this.outsourceVisible = true
|
|
@@ -597,15 +600,15 @@ export default {
|
|
|
this.$refs.refOutsource.init(this.selectedRows)
|
|
|
})
|
|
|
},
|
|
|
- //批量入库
|
|
|
- batchIncomeHandle(){
|
|
|
- if(this.selectedRows.length == 0){
|
|
|
- this.$message.error("请先勾选数据")
|
|
|
- return
|
|
|
+ // 批量入库
|
|
|
+ batchIncomeHandle () {
|
|
|
+ if (this.selectedRows.length == 0) {
|
|
|
+ this.$message.error('请先勾选数据')
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
let list = []
|
|
|
- for(let index=0;index<this.selectedRows.length;index++){
|
|
|
+ for (let index = 0; index < this.selectedRows.length; index++) {
|
|
|
let item = this.selectedRows[index]
|
|
|
let dataForm = {
|
|
|
...item,
|
|
@@ -622,6 +625,9 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.inbound.init(0, false, list)
|
|
|
})
|
|
|
+ },
|
|
|
+ exportHandle (val) {
|
|
|
+ location.href = this.$http.adornUrl(`/biz-service/purCommDetail/exportExcel/${val}?_token=${Vue.cookie.get('token')}`)
|
|
|
}
|
|
|
}
|
|
|
}
|