|
@@ -47,7 +47,8 @@
|
|
|
<el-button v-if="isAuth('pur:commDetail:save')" type="primary" @click="addOrUpdateHandle()">新增委外</el-button>
|
|
|
<el-button v-if="isAuth('pur:commDetail:noteChangeConfig')" type="primary" @click="setNoticeChangeHandel()">工作提示通知设置</el-button>
|
|
|
<el-button v-if="isAuth('pur:commDetail:priceConfig')" type="primary" @click="setAmountMaskHandel()">委外金额屏蔽设置</el-button>
|
|
|
- <el-button v-if="isAuth('pur:commDetail:save')" type="primary" @click="batchHandle()">批量委外</el-button>
|
|
|
+ <el-button v-if="isAuth('pur:commDetail:updatePurCommissionDetail')" type="primary" @click="batchHandle()" :disabled="batchBtnDisabled">批量委外</el-button>
|
|
|
+ <el-button v-if="isAuth('pur:commDetail:infoPutIn')" type="primary" @click="batchIncomeHandle()" :disabled="batchIncomeBtnDisabled">批量入库</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<el-table
|
|
@@ -83,6 +84,27 @@
|
|
|
:show-tooltip-when-overflow="true"
|
|
|
label="物料名称">
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="mapNumber"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ min-width="140"
|
|
|
+ :show-tooltip-when-overflow="true"
|
|
|
+ label="图号">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="simplePic"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ min-width="120"
|
|
|
+ label="简图">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-popover placement="right" title="" trigger="hover">
|
|
|
+ <img :src="scope.row.simplePic" style="height: 400px;width: 500px">
|
|
|
+ <img slot="reference" :src="scope.row.simplePic" :alt="scope.row.simplePic" style="max-height: 50px;max-width: 130px">
|
|
|
+ </el-popover>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="productNumber"
|
|
|
header-align="center"
|
|
@@ -274,6 +296,7 @@ import { getDictList } from '@/api/dict'
|
|
|
import StockOrderInbound from '../warehouse/stock-order-inbound'
|
|
|
import OutsourcePop from './outsource-pop'
|
|
|
import AmountMaskSetting from './outsource-amount-mask-setting'
|
|
|
+import { downloadUrl } from '@/api/file'
|
|
|
|
|
|
export default {
|
|
|
name: 'outsource',
|
|
@@ -317,7 +340,9 @@ export default {
|
|
|
],
|
|
|
// 审批状态
|
|
|
optionsState: [],
|
|
|
- selectedRows:[]
|
|
|
+ selectedRows:[],
|
|
|
+ batchBtnDisabled: false,
|
|
|
+ batchIncomeBtnDisabled: false
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
@@ -336,6 +361,9 @@ export default {
|
|
|
this.inboundVisible = false
|
|
|
this.outsourceVisible = false
|
|
|
this.amountMaskSettingVisible = false
|
|
|
+ this.selectedRows = []
|
|
|
+ this.batchBtnDisabled = false
|
|
|
+ this.batchIncomeBtnDisabled = false
|
|
|
},
|
|
|
// 查询
|
|
|
search () {
|
|
@@ -352,6 +380,10 @@ export default {
|
|
|
},
|
|
|
// 获取数据列表
|
|
|
getDataList () {
|
|
|
+ this.selectedRows = []
|
|
|
+ this.batchBtnDisabled = false
|
|
|
+ this.batchIncomeBtnDisabled = false
|
|
|
+
|
|
|
this.dataListLoading = true
|
|
|
let params = {
|
|
|
'current': this.pageIndex,
|
|
@@ -366,6 +398,15 @@ export default {
|
|
|
if (data && data.code === '200' && data.data) {
|
|
|
this.dataList = data.data.records
|
|
|
this.totalPage = Number(data.data.total)
|
|
|
+
|
|
|
+ // 简图格式调整
|
|
|
+ this.dataList.forEach(item => {
|
|
|
+ if (item.attachList2 && item.attachList2.length > 0) {
|
|
|
+ item.simplePic = downloadUrl + item.attachList2[0].url
|
|
|
+ } else {
|
|
|
+ item.simplePic = ''
|
|
|
+ }
|
|
|
+ })
|
|
|
} else {
|
|
|
this.dataList = []
|
|
|
this.totalPage = 0
|
|
@@ -524,13 +565,63 @@ export default {
|
|
|
//监听批量选择的行
|
|
|
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++){
|
|
|
+ let item = this.selectedRows[index]
|
|
|
+ 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)){
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.batchIncomeBtnDisabled = true
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
//批量委外
|
|
|
batchHandle(){
|
|
|
+ if(this.selectedRows.length == 0){
|
|
|
+ this.$message.error("请先勾选数据")
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
this.outsourceVisible = true
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.refOutsource.init(this.selectedRows)
|
|
|
})
|
|
|
+ },
|
|
|
+ //批量入库
|
|
|
+ batchIncomeHandle(){
|
|
|
+ if(this.selectedRows.length == 0){
|
|
|
+ this.$message.error("请先勾选数据")
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ let list = []
|
|
|
+ for(let index=0;index<this.selectedRows.length;index++){
|
|
|
+ let item = this.selectedRows[index]
|
|
|
+ let dataForm = {
|
|
|
+ ...item,
|
|
|
+ buttonType: '1',
|
|
|
+ sourceCategory: '3', // 入库依据类别
|
|
|
+ materialName: item.productName,
|
|
|
+ tableId: item.purComDetailId, // 主表ID
|
|
|
+ specifications: item.specificationExplian
|
|
|
+ }
|
|
|
+ list.push(dataForm)
|
|
|
+ }
|
|
|
+
|
|
|
+ this.inboundVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.inbound.init(0, false, list)
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|