|
@@ -40,6 +40,13 @@
|
|
|
<el-tab-pane v-if="formDialogType > 0 && joinCode" label="条码信息" name="codeInfo"></el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</zj-form-module>
|
|
|
+ <zj-form-module
|
|
|
+ title="计划单明细"
|
|
|
+ label-width="100px"
|
|
|
+ :form-data="formData"
|
|
|
+ :form-items="formItemsFeicTes"
|
|
|
+ >
|
|
|
+ </zj-form-module>
|
|
|
</zj-form-container>
|
|
|
</div>
|
|
|
</zj-page-fill>
|
|
@@ -54,6 +61,23 @@
|
|
|
</zj-page-container>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
+
|
|
|
+ <el-dialog title="提示" :visible.sync="dialogVisible" width="1000px" :before-close="handleCloseTes">
|
|
|
+ <div style="width: 960px; height: 680px">
|
|
|
+ <template-page
|
|
|
+ v-if="dialogVisible"
|
|
|
+ ref="pageRefTes"
|
|
|
+ :get-list="getListTes"
|
|
|
+ :table-attributes="tableAttributesTes"
|
|
|
+ :table-events="tableEventsTes"
|
|
|
+ >
|
|
|
+ </template-page>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="quedingtianjia">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</template-page>
|
|
|
</template>
|
|
|
|
|
@@ -74,17 +98,20 @@ import {
|
|
|
goodsPurchaseConfirm,
|
|
|
goodsPurchaseDel
|
|
|
} from '@/api/goodsPurchasedStored.js'
|
|
|
+import { goodsPlanItemList } from '@/api/purchaseSchedule.js'
|
|
|
import form_ty from '../mixins/common_form'
|
|
|
import storage_table from '../mixins/storage_table'
|
|
|
import storage_goods from '../mixins/storage_goods'
|
|
|
import storage_codes from '../mixins/storage_codes'
|
|
|
import common from '../mixins/common_code'
|
|
|
+import jihuamingxi from '../mixins/jihuamingxi'
|
|
|
import { delayPerform, firstPerform, intervalPerform, passivePerform, queuePerform } from 'js-perform-lock'
|
|
|
export default {
|
|
|
components: { TemplatePage },
|
|
|
- mixins: [import_mixin, operation_mixin, form_ty, storage_table, storage_goods, storage_codes, common],
|
|
|
+ mixins: [import_mixin, operation_mixin, form_ty, storage_table, storage_goods, storage_codes, common, jihuamingxi],
|
|
|
data() {
|
|
|
return {
|
|
|
+ dialogVisible: false,
|
|
|
pageType: 'list',
|
|
|
pageShow: true,
|
|
|
// 表格属性
|
|
@@ -92,6 +119,15 @@ export default {
|
|
|
// 启用勾选列
|
|
|
selectColumn: false
|
|
|
},
|
|
|
+ tableAttributesTes: {
|
|
|
+ // 启用勾选列
|
|
|
+ selectColumn: true,
|
|
|
+ reserveSelection: true,
|
|
|
+ 'row-key': 'id'
|
|
|
+ },
|
|
|
+ tableEventsTes: {
|
|
|
+ 'selection-change': this.selectionChangeTes
|
|
|
+ },
|
|
|
// 表格事件
|
|
|
tableEvents: {
|
|
|
'selection-change': this.selectionChange
|
|
@@ -123,13 +159,15 @@ export default {
|
|
|
storageName: '',
|
|
|
fileUrl: [],
|
|
|
items: [],
|
|
|
+ planItems: [],
|
|
|
codeInfoList: []
|
|
|
},
|
|
|
activeName: 'goodsInfo',
|
|
|
goods_material_id: '',
|
|
|
joinCode: false,
|
|
|
joinCodeText: JSON.parse(localStorage.getItem('greemall_user')).joinCode,
|
|
|
- logs: []
|
|
|
+ logs: [],
|
|
|
+ tesXuanXiang: []
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -158,6 +196,59 @@ export default {
|
|
|
// 更多参数
|
|
|
moreParameters() {
|
|
|
return []
|
|
|
+ },
|
|
|
+ formItemsFeicTes() {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ md: 24,
|
|
|
+ isShow: true,
|
|
|
+ name: 'slot-component',
|
|
|
+ formItemAttributes: {
|
|
|
+ label: '',
|
|
|
+ prop: '',
|
|
|
+ 'label-width': '0px'
|
|
|
+ },
|
|
|
+ render: (h, { props, onInput }) => {
|
|
|
+ var { value } = props
|
|
|
+ return (
|
|
|
+ <div>
|
|
|
+ {[
|
|
|
+ !!~[0, 1].indexOf(this.formDialogType) ? (
|
|
|
+ <div style="margin-bottom:10px">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ onClick={() => {
|
|
|
+ if (this.formData.venderId) {
|
|
|
+ this.dialogVisible = true
|
|
|
+ this.tesXuanXiang = []
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ type: 'warning',
|
|
|
+ message: '请选择供应商',
|
|
|
+ duration: 5000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 添加
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ ) : null,
|
|
|
+ <zj-table
|
|
|
+ columns={this.teshumingxi}
|
|
|
+ tableData={this.formData.planItems}
|
|
|
+ tableAttributes={{
|
|
|
+ size: 'mini',
|
|
|
+ border: true
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ ]}
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -167,6 +258,9 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
this.pageShow = true
|
|
|
})
|
|
|
+ },
|
|
|
+ 'formData.venderId'() {
|
|
|
+ this.formData.planItems = []
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -188,6 +282,65 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
}),
|
|
|
+
|
|
|
+ getListTes(p, cb) {
|
|
|
+ return goodsPlanItemList({
|
|
|
+ ...p,
|
|
|
+ params: [
|
|
|
+ ...p.params,
|
|
|
+ { param: 'a.vender_id', compare: '=', value: this.formData.venderId },
|
|
|
+ { param: 'b.surplus_qty', compare: '>', value: '0' }
|
|
|
+ ]
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ handleCloseTes() {
|
|
|
+ this.dialogVisible = false
|
|
|
+ },
|
|
|
+
|
|
|
+ selectionChangeTes(data) {
|
|
|
+ this.tesXuanXiang = data
|
|
|
+ },
|
|
|
+
|
|
|
+ quedingtianjia() {
|
|
|
+ this.tesXuanXiang.map(item => {
|
|
|
+ if (!this.formData.planItems.find(v => v.goodsPlanId == item.id)) {
|
|
|
+ this.formData.planItems.unshift({
|
|
|
+ amount: '', //
|
|
|
+ brandId: item.brandId,
|
|
|
+ brandName: item.brandName,
|
|
|
+ enginCode: item.enginCode,
|
|
|
+ enginName: item.enginName,
|
|
|
+ factoryNo: item.factoryNo,
|
|
|
+ goodsMaterialId: item.goodsMaterialId,
|
|
|
+ goodsMaterialName: item.goodsMaterialName,
|
|
|
+ goodsPlanId: item.id,
|
|
|
+ goodsPlanItemId: item.goodsPlanItemId,
|
|
|
+ goodsPurchaseId: '', //
|
|
|
+ goodsPurchasePlanItemId: '', //
|
|
|
+ inStockQty: item.inStockQty,
|
|
|
+ insideQty: '', //
|
|
|
+ mainId: item.mainId,
|
|
|
+ mainName: item.mainName,
|
|
|
+ orderGoodsType: item.orderGoodsType,
|
|
|
+ qty: item.qty,
|
|
|
+ outQty: '', //
|
|
|
+ partsQty: '', //
|
|
|
+ price: '', //
|
|
|
+ recQty: '', //
|
|
|
+ retQty: '', //
|
|
|
+ seriesName: item.seriesName,
|
|
|
+ smallId: item.smallId,
|
|
|
+ smallName: item.smallName,
|
|
|
+ specsName: item.specsName,
|
|
|
+ surplusQty: item.surplusQty,
|
|
|
+ unit: item.unit
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.dialogVisible = false
|
|
|
+ },
|
|
|
+
|
|
|
changePageType() {
|
|
|
this.goods_material_id = ''
|
|
|
},
|
|
@@ -321,6 +474,16 @@ export default {
|
|
|
message: '仓库不能为空'
|
|
|
})
|
|
|
}
|
|
|
+ try {
|
|
|
+ this.formData.planItems.map((item, index) => {
|
|
|
+ if (!item.recQty || item.recQty == 0) {
|
|
|
+ throw new Error('')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.warning('到货数量必须填写并且大于0')
|
|
|
+ return false
|
|
|
+ }
|
|
|
goodsPurchaseAdd({
|
|
|
...this.formData,
|
|
|
items: this.formData.items.map((item, index) => ({ ...item, index: index + 1 })),
|