|
@@ -39,7 +39,7 @@
|
|
|
class="col"
|
|
|
style="padding: 0 5px;flex: 1;display: flex;align-items: flex-start;"
|
|
|
v-if="
|
|
|
- formData.applyPurType === 0 || formData.applyPurType === '物料'
|
|
|
+ formData.type === 0 || formData.type === '物料'
|
|
|
"
|
|
|
>
|
|
|
<div class="label" style="width: 70px;">采购部门:</div>
|
|
@@ -84,7 +84,7 @@
|
|
|
>
|
|
|
<div class="label" style="width: 70px;">申购类型:</div>
|
|
|
<div class="value" v-if="type === 'add'">
|
|
|
- <Select v-model="formData.applyPurType">
|
|
|
+ <Select v-model="formData.type">
|
|
|
<Option
|
|
|
v-for="item in purTypeList"
|
|
|
:value="item.value"
|
|
@@ -94,7 +94,7 @@
|
|
|
</Select>
|
|
|
</div>
|
|
|
<div class="value" v-if="type === 'form'" style="flex: 1;">
|
|
|
- {{ formData.applyPurType }}
|
|
|
+ {{ formData.type }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -107,16 +107,16 @@
|
|
|
style="padding: 0 5px;flex: 1;display: flex;align-items: flex-start;"
|
|
|
>
|
|
|
<div class="label" style="width: 70px;">
|
|
|
- <!-- {{ formData.applyPurType === 0 ? '申购说明:' : '申购内容' }} -->
|
|
|
+ <!-- {{ formData.type === 0 ? '申购说明:' : '申购内容' }} -->
|
|
|
申购说明:
|
|
|
</div>
|
|
|
<div class="value" v-if="type === 'add'">
|
|
|
- <Input v-model="formData.applyAccount" type="textarea" />
|
|
|
+ <Input v-model="formData.remark" type="textarea" />
|
|
|
</div>
|
|
|
<div class="value" v-if="type === 'form'" style="flex: 1;">
|
|
|
{{
|
|
|
- formData.applyPurType === '物料'
|
|
|
- ? formData.applyAccount
|
|
|
+ formData.type === '物料'
|
|
|
+ ? formData.remark
|
|
|
: formData.purchaseContent
|
|
|
}}
|
|
|
</div>
|
|
@@ -126,7 +126,7 @@
|
|
|
<!-- 副标题 -->
|
|
|
<div
|
|
|
class="sub"
|
|
|
- v-if="formData.applyPurType === 0 || formData.applyPurType === '物料'"
|
|
|
+ v-if="formData.type === 0 || formData.type === '物料'"
|
|
|
style="margin-bottom: 5px;display: flex;justify-content: space-between;align-items: center;"
|
|
|
>
|
|
|
<span
|
|
@@ -142,7 +142,7 @@
|
|
|
<!-- 申购明细表格 -->
|
|
|
<div
|
|
|
class="table"
|
|
|
- v-if="formData.applyPurType === 0 || formData.applyPurType === '物料'"
|
|
|
+ v-if="formData.type === 0 || formData.type === '物料'"
|
|
|
>
|
|
|
<table style="border-collapse:collapse;border:none;width: 100%;">
|
|
|
<tr>
|
|
@@ -182,7 +182,7 @@
|
|
|
操作
|
|
|
</th>
|
|
|
</tr>
|
|
|
- <tr v-for="(item, index) in materialList" :key="index">
|
|
|
+ <tr v-for="(item, index) in applyDetailsList" :key="index">
|
|
|
<td
|
|
|
style="padding: 5px;text-align: center;border:solid #dcdee2 1px;position: relative;font-size: 12px;"
|
|
|
>
|
|
@@ -206,10 +206,10 @@
|
|
|
<td
|
|
|
style="padding: 5px;text-align: center;border:solid #dcdee2 1px;position: relative;font-size: 12px;"
|
|
|
>
|
|
|
- <span v-if="type === 'form'">{{ item.purchaseQty }}</span>
|
|
|
+ <span v-if="type === 'form'">{{ item.quantity }}</span>
|
|
|
<Input
|
|
|
v-if="type === 'add'"
|
|
|
- v-model="item.purchaseQty"
|
|
|
+ v-model="item.quantity"
|
|
|
type="number"
|
|
|
/>
|
|
|
</td>
|
|
@@ -314,7 +314,7 @@ export default {
|
|
|
return {
|
|
|
selectedList: [], // 用于表格勾选回填
|
|
|
materialShow: false,
|
|
|
- materialList: [],
|
|
|
+ applyDetailsList: [],
|
|
|
purchaseFlowsList: [],
|
|
|
modal: false,
|
|
|
formData: {},
|
|
@@ -353,11 +353,11 @@ export default {
|
|
|
value: {
|
|
|
handler (n) {
|
|
|
this.modal = n
|
|
|
- this.$set(this.formData, 'applyPurType', 0)
|
|
|
+ this.$set(this.formData, 'type', 0)
|
|
|
if (n) {
|
|
|
if (this.type === 'form') {
|
|
|
this.formData = { ...this.data }
|
|
|
- this.materialList = this.formData.purDetails
|
|
|
+ this.applyDetailsList = this.formData.purDetails
|
|
|
this.getApplyPurchaseFlows()
|
|
|
console.log(this.formData)
|
|
|
}
|
|
@@ -372,26 +372,26 @@ export default {
|
|
|
methods: {
|
|
|
// 删除已添加物料
|
|
|
delRow (index) {
|
|
|
- this.materialList.splice(index, 1)
|
|
|
+ this.applyDetailsList.splice(index, 1)
|
|
|
this.selectedList.splice(index, 1)
|
|
|
},
|
|
|
// 添加物料
|
|
|
getselectedList (data) {
|
|
|
console.log('end--------------data')
|
|
|
console.log(data)
|
|
|
- this.materialList = []
|
|
|
+ this.applyDetailsList = []
|
|
|
this.selectedList = data
|
|
|
// 数据去重添加
|
|
|
for (const select of data) {
|
|
|
let flag = false
|
|
|
- for (const item of this.materialList) {
|
|
|
+ for (const item of this.applyDetailsList) {
|
|
|
if (select.code === item.materialCode) {
|
|
|
flag = true
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
if (!flag) {
|
|
|
- this.materialList.push({
|
|
|
+ this.applyDetailsList.push({
|
|
|
materialCode: select.code,
|
|
|
materialName: select.name,
|
|
|
spec: select.spec
|
|
@@ -401,22 +401,24 @@ export default {
|
|
|
},
|
|
|
// 申购提交
|
|
|
cfm () {
|
|
|
- this.formData.materialList = this.materialList
|
|
|
+ this.formData.applyDetailsList = this.applyDetailsList
|
|
|
// 选择申购类型不同时提交不同的字段
|
|
|
- if (this.formData.applyPurType === 1) {
|
|
|
- this.formData.purchaseContent = this.formData.applyAccount
|
|
|
+ if (this.formData.type === 1) {
|
|
|
+ this.formData.purchaseContent = this.formData.remark
|
|
|
}
|
|
|
- AddApplyPurchase(this.formData).then(res => {
|
|
|
- if (res.code === 0) {
|
|
|
- this.$Message.info('新增成功!')
|
|
|
- this.$emit('cfm')
|
|
|
- this.cancel()
|
|
|
- }
|
|
|
- })
|
|
|
+ this
|
|
|
+ .$post('/api/storage-restructure/applyPurchase/addFlowCreate', this.formData).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$Message.info('新增成功!')
|
|
|
+ this.$emit('cfm')
|
|
|
+ this.cancel()
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
},
|
|
|
cancel () {
|
|
|
this.formData = {}
|
|
|
- this.materialList = []
|
|
|
+ this.applyDetailsList = []
|
|
|
this.selectedList = []
|
|
|
this.modal = false
|
|
|
},
|
|
@@ -440,7 +442,7 @@ export default {
|
|
|
if (this.modal && this.type === 'form') {
|
|
|
console.log('???', this.modal, this.type)
|
|
|
this.formData = { ...this.data }
|
|
|
- this.materialList = this.formData.purDetails
|
|
|
+ this.applyDetailsList = this.formData.purDetails
|
|
|
}
|
|
|
}
|
|
|
}
|