|
@@ -12,6 +12,7 @@ import {
|
|
|
} from '@/api/purchasingManagement.js'
|
|
|
import { commonTemplateDownload } from '@/api/common.js'
|
|
|
import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
|
|
|
+import { storageListPageV2 } from "@/api/storage";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -34,7 +35,8 @@ export default {
|
|
|
materialNormList: [],
|
|
|
peijianList: [],
|
|
|
websitPurchaseInList: [],
|
|
|
- listPageV2Data: []
|
|
|
+ listPageV2Data: [],
|
|
|
+ cangkuList: []
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -224,6 +226,7 @@ export default {
|
|
|
materialNormList({
|
|
|
isShowStockQty: true,
|
|
|
websitId: this.formData.websitId,
|
|
|
+ storageId: this.formData.storageId,
|
|
|
pageNum: 1,
|
|
|
pageSize: -1,
|
|
|
params: [
|
|
@@ -760,10 +763,10 @@ export default {
|
|
|
<el-descriptions
|
|
|
border
|
|
|
title=""
|
|
|
- column={2}
|
|
|
+ column={4}
|
|
|
colon={false}
|
|
|
labelStyle={{ width: '8%' }}
|
|
|
- contentStyle={{ width: '42%' }}
|
|
|
+ contentStyle={{ width: '17%' }}
|
|
|
style="margin-top:-1px"
|
|
|
>
|
|
|
<el-descriptions-item label="网点名称">
|
|
@@ -779,29 +782,15 @@ export default {
|
|
|
disabled={this.formDialogType >= 2}
|
|
|
onChange={val => {
|
|
|
this.formData.items = []
|
|
|
+ this.formData.storageId = ""
|
|
|
+ this.formData.storageName = ""
|
|
|
+ this.cangkuList = []
|
|
|
+ this.getStorageListPageV2(val)
|
|
|
if (val) {
|
|
|
this.formData['websitName'] = this.getWebsitList.find(item => item.websitId == val).name
|
|
|
} else {
|
|
|
this.formData['websitName'] = ''
|
|
|
}
|
|
|
- if (~['partsStorage', 'partsReturn'].indexOf(this.$route?.name)) {
|
|
|
- if (val) {
|
|
|
- peijianList({
|
|
|
- isShowStockQty: true,
|
|
|
- websitId: val,
|
|
|
- pageNum: 1,
|
|
|
- pageSize: -1,
|
|
|
- params: [
|
|
|
- { param: 'a.status', compare: '=', value: 'ON' },
|
|
|
- { param: 'a.norm_type', compare: '=', value: 'M' }
|
|
|
- ]
|
|
|
- }).then(res => {
|
|
|
- this.peijianList = res.data.records
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.peijianList = []
|
|
|
- }
|
|
|
- }
|
|
|
this.getorderlist()
|
|
|
this.$nextTick(this.jiaoyan)
|
|
|
}}
|
|
@@ -843,6 +832,57 @@ export default {
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</el-descriptions-item>
|
|
|
+ <el-descriptions-item label={!!~['returnAuxiliaryMaterials', 'partsReturn'].indexOf(this.$route?.name)?'出库仓库':"入库仓库"}>
|
|
|
+ <div class="redbordererr">
|
|
|
+ <el-form-item label="" lebel-width="0px" prop={`storageId`} rules={required}>
|
|
|
+ <el-select
|
|
|
+ style="width:100%"
|
|
|
+ disabled={this.formDialogType === 2 || !(!this.formData.id || (this.formDialogType === 1) || (this.formDialogType === 3 && this.formData.isImport==true && !!this.formData.id))}
|
|
|
+ value={this.formData.storageId}
|
|
|
+ onInput={val => {
|
|
|
+ this.formData.storageId = val
|
|
|
+ }}
|
|
|
+ placeholder="请选择"
|
|
|
+ onChange={val => {
|
|
|
+ if (val) {
|
|
|
+ this.formData['storageName'] = this.cangkuList.find(
|
|
|
+ item => item.storageId == val
|
|
|
+ )?.storageName
|
|
|
+ } else {
|
|
|
+ this.formData['storageName'] = ''
|
|
|
+ }
|
|
|
+ if (~['partsStorage', 'partsReturn'].indexOf(this.$route?.name)) {
|
|
|
+ if (val) {
|
|
|
+ peijianList({
|
|
|
+ isShowStockQty: true,
|
|
|
+ websitId: this.formData.websitId,
|
|
|
+ storageId: this.formData.storageId,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: -1,
|
|
|
+ params: [
|
|
|
+ { param: 'a.status', compare: '=', value: 'ON' },
|
|
|
+ { param: 'a.norm_type', compare: '=', value: 'M' }
|
|
|
+ ]
|
|
|
+ }).then(res => {
|
|
|
+ this.peijianList = res.data.records
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.peijianList = []
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$nextTick(this.jiaoyan)
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {this.cangkuList.map(item => (
|
|
|
+ <el-option key={item.storageId} label={item.storageName} value={item.storageId}></el-option>
|
|
|
+ ))}
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="">
|
|
|
+
|
|
|
+ </el-descriptions-item>
|
|
|
</el-descriptions>
|
|
|
{!!~['returnAuxiliaryMaterials', 'partsReturn'].indexOf(this.$route?.name) ? (
|
|
|
<el-descriptions
|
|
@@ -893,6 +933,7 @@ export default {
|
|
|
materialNormList({
|
|
|
isShowStockQty: true,
|
|
|
websitId: this.formData.websitId,
|
|
|
+ storageId: this.formData.storageId,
|
|
|
pageNum: 1,
|
|
|
pageSize: -1,
|
|
|
params: [
|
|
@@ -1103,18 +1144,39 @@ export default {
|
|
|
selectionChange(data) {
|
|
|
this.recordSelected = data
|
|
|
},
|
|
|
+ // 获取
|
|
|
+ getStorageListPageV2(websitId){
|
|
|
+ if(websitId){
|
|
|
+ storageListPageV2({
|
|
|
+ "pageNum":1,
|
|
|
+ "pageSize":-1,
|
|
|
+ "params":[
|
|
|
+ {"param":"a.websit_id","compare":"=","value": websitId},
|
|
|
+ {"param":"a.type","compare":"like","value": (()=>{
|
|
|
+ if(~['auxiliaryMaterialsStorage', 'returnAuxiliaryMaterials'].indexOf(this.$route?.name)){
|
|
|
+ return "辅材"
|
|
|
+ }else if (~['partsStorage', 'partsReturn'].indexOf(this.$route?.name)) {
|
|
|
+ return "配件"
|
|
|
+ }
|
|
|
+ return ""
|
|
|
+ })()},
|
|
|
+ {"param":"a.status","compare":"=","value":"true"},
|
|
|
+ ]
|
|
|
+ }).then(res => {
|
|
|
+ this.cangkuList = res.data.records
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
// 打开
|
|
|
openForm() {
|
|
|
+ this.getStorageListPageV2(this?.formData?.websitId)
|
|
|
this.getorderlist(false)
|
|
|
-
|
|
|
var req = [getWebsit({ type: 'C', status: true })]
|
|
|
-
|
|
|
var runs = [
|
|
|
res => {
|
|
|
this.getWebsitList = res.data.filter(item => item.type == 'C')
|
|
|
}
|
|
|
]
|
|
|
- console.log(this.$route?.name)
|
|
|
if (~['auxiliaryMaterialsStorage', 'returnAuxiliaryMaterials'].indexOf(this.$route?.name)) {
|
|
|
req.push(
|
|
|
...[
|
|
@@ -1156,7 +1218,6 @@ export default {
|
|
|
]
|
|
|
)
|
|
|
}
|
|
|
-
|
|
|
if (~['auxiliaryMaterialsStorage', 'returnAuxiliaryMaterials'].indexOf(this.$route?.name)) {
|
|
|
req.push(
|
|
|
...[
|
|
@@ -1194,6 +1255,7 @@ export default {
|
|
|
peijianList({
|
|
|
isShowStockQty: true,
|
|
|
websitId: this.formData.websitId,
|
|
|
+ storageId: this.formData.storageId,
|
|
|
pageNum: 1,
|
|
|
pageSize: -1,
|
|
|
params: [
|
|
@@ -1211,7 +1273,6 @@ export default {
|
|
|
]
|
|
|
)
|
|
|
}
|
|
|
-
|
|
|
Promise.all(req).then(ress => {
|
|
|
ress.forEach((res, index) => {
|
|
|
runs[index](res)
|