|
@@ -12,6 +12,8 @@
|
|
|
<el-radio-button v-if="$checkBtnRole('receipt', $route.meta.roles)" label="receipt">发票</el-radio-button>
|
|
|
<el-radio-button label="warehouse">仓租费配置</el-radio-button>
|
|
|
<el-radio-button label="radius">商用登录地图半径</el-radio-button>
|
|
|
+ <el-radio-button label="forcedHold">强制仓</el-radio-button>
|
|
|
+
|
|
|
</el-radio-group>
|
|
|
|
|
|
<div v-show="formType === 'first'">
|
|
@@ -341,6 +343,41 @@
|
|
|
</div>
|
|
|
<el-button type="primary" size="small" @click="submitForm('radius')">确 定</el-button>
|
|
|
</div>
|
|
|
+ <div v-show="formType === 'forcedHold'">
|
|
|
+ <div style="margin: 40px 0 30px;">
|
|
|
+ <el-form ref="form" :model="forcedHoldForm" label-width="50px" label-position="left">
|
|
|
+ <el-row>
|
|
|
+ <el-col>
|
|
|
+ <el-form-item label="仓库">
|
|
|
+ <el-select
|
|
|
+ v-model="forcedHoldForm.warehouse"
|
|
|
+ style="width: 50%"
|
|
|
+ placeholder="请选择仓库"
|
|
|
+ size="mini"
|
|
|
+ @change="()=> this.forcedHoldForm.category = []"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in warehouseList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col>
|
|
|
+ <el-form-item label="品类">
|
|
|
+ <el-checkbox-group v-model="forcedHoldForm.category">
|
|
|
+ <el-checkbox v-for="item in categoryList" :key="item.id" :label="item.id">{{ item.name }}
|
|
|
+ </el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <el-button type="primary" size="small" @click="submitForcedHold">确 定</el-button>
|
|
|
+ </div>
|
|
|
<!-- //弹窗 -->
|
|
|
<el-dialog :title="title" :visible.sync="dialogForm" width="30%" :show-close="false" :close-on-click-modal="false">
|
|
|
<el-form ref="addForm" size="mini" :rules="rules" :model="addForm" label-width="120px">
|
|
@@ -360,7 +397,17 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getDictList, editDictList, addDictList, deleDictList, updateReceipt, getStockCostDict, updateStockCostDict } from '@/api/common'
|
|
|
+import {
|
|
|
+ getDictList,
|
|
|
+ editDictList,
|
|
|
+ addDictList,
|
|
|
+ deleDictList,
|
|
|
+ updateReceipt,
|
|
|
+ getStockCostDict,
|
|
|
+ updateStockCostDict, getStockForceDetail, updateStockForceDetail
|
|
|
+} from '@/api/common'
|
|
|
+import { getKingDeeCategory } from '@/api/basic_data/material'
|
|
|
+import { getListStockV2 } from '@/api/basic_data/warehouse'
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
@@ -400,6 +447,10 @@ export default {
|
|
|
radiusForm: {
|
|
|
input1: {}
|
|
|
},
|
|
|
+ forcedHoldForm: {
|
|
|
+ warehouse: '',
|
|
|
+ category: []
|
|
|
+ },
|
|
|
stockCostDict: {},
|
|
|
sixthForm: [],
|
|
|
seventhForm: [],
|
|
@@ -419,7 +470,9 @@ export default {
|
|
|
this.choiceDate = minDate.getTime()
|
|
|
if (maxDate) this.choiceDate = ''
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ categoryList: [],
|
|
|
+ warehouseList: []
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -506,13 +559,40 @@ export default {
|
|
|
// return index >= 0 ? true : false;
|
|
|
return true
|
|
|
},
|
|
|
-
|
|
|
+ // 获取品类数据
|
|
|
+ async getCategoryList() {
|
|
|
+ const res = await getKingDeeCategory()
|
|
|
+ this.categoryList = res.data
|
|
|
+ },
|
|
|
+ // 获取仓库列表
|
|
|
+ getListStockV2() {
|
|
|
+ getListStockV2({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: -1
|
|
|
+ }).then(res => {
|
|
|
+ this.warehouseList = res.data.records
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getStockForceDetail() {
|
|
|
+ getStockForceDetail().then(res => {
|
|
|
+ this.forcedHoldForm = {
|
|
|
+ warehouse: res.data.stockCorrespondId,
|
|
|
+ category: res.data.stockForceCategories.map(k => k.categoryId)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
changeType(val) {
|
|
|
if (this.formType === 'receipt') return
|
|
|
if (val === 'warehouse') {
|
|
|
this.getStockCostDict()
|
|
|
return
|
|
|
}
|
|
|
+ if (val === 'forcedHold') {
|
|
|
+ this.getListStockV2()
|
|
|
+ this.getCategoryList()
|
|
|
+ this.getStockForceDetail()
|
|
|
+ return
|
|
|
+ }
|
|
|
this.getDetail(val)
|
|
|
},
|
|
|
getStockCostDict() {
|
|
@@ -540,7 +620,7 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
this[type + 'Form'].input1 = data[0]
|
|
|
- console.log( this[type + 'Form'].input1, 999)
|
|
|
+ console.log(this[type + 'Form'].input1, 999)
|
|
|
// this[type + "Form"].input2 = data[1];
|
|
|
} else {
|
|
|
this[type + 'Form'].input1 = data[0]
|
|
@@ -565,7 +645,6 @@ export default {
|
|
|
if (type == 'eigth') {
|
|
|
this.eigthForm = res.data
|
|
|
}
|
|
|
-
|
|
|
})
|
|
|
},
|
|
|
getDetail(type) {
|
|
@@ -617,6 +696,32 @@ export default {
|
|
|
this.value1 = ''
|
|
|
})
|
|
|
},
|
|
|
+ submitForcedHold() {
|
|
|
+ if (!this.forcedHoldForm.warehouse) {
|
|
|
+ this.$errorMsg('请选择仓库')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.forcedHoldForm.category.length) {
|
|
|
+ this.$errorMsg('请选择品类')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const temp = this.warehouseList.find(k => k.id === this.forcedHoldForm.warehouse)
|
|
|
+ const stockForceCategories = this.forcedHoldForm.category.map(k => {
|
|
|
+ return {
|
|
|
+ categoryId: k,
|
|
|
+ correspondId: temp.id,
|
|
|
+ correspondName: temp.name
|
|
|
+ }
|
|
|
+ })
|
|
|
+ updateStockForceDetail({
|
|
|
+ stockCorrespondId: temp.id,
|
|
|
+ stockCorrespondName: temp.name,
|
|
|
+ stockForceCategories
|
|
|
+ }).then(_res => {
|
|
|
+ this.getStockForceDetail()
|
|
|
+ this.$successMsg('操作成功')
|
|
|
+ })
|
|
|
+ },
|
|
|
submitStockForm() {
|
|
|
if (!this.stockCostDict.dictValue) {
|
|
|
this.$errorMsg('请输入总库存')
|
|
@@ -641,10 +746,12 @@ export default {
|
|
|
.demo-table-expand {
|
|
|
font-size: 0;
|
|
|
}
|
|
|
+
|
|
|
.demo-table-expand label {
|
|
|
width: 80px;
|
|
|
color: #99a9bf;
|
|
|
}
|
|
|
+
|
|
|
.demo-table-expand .el-form-item {
|
|
|
margin-right: 0;
|
|
|
margin-bottom: 0;
|