|
@@ -308,8 +308,16 @@
|
|
|
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
+// 组件
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import { getOperationalPrecision } from '@/libs/tools.js'
|
|
|
+import ProductType from '../../common/productType.js'
|
|
|
+import ProductBrand from '../../common/productBrand.js'
|
|
|
+import Print from '@/views/common/print.vue'
|
|
|
+import importGuideModal from './importGuideModal.vue'
|
|
|
+import newProduct from '@/views/productManagement/productInfo/edit.vue'
|
|
|
+import { hdPrint } from '@/libs/JGPrint'
|
|
|
+// 接口
|
|
|
import {
|
|
|
sparePartsPurDetail,
|
|
|
sparePartsPurDetailList,
|
|
@@ -320,14 +328,8 @@ import {
|
|
|
sparePartsPurDetailPrint,
|
|
|
sparePartsPurDeleteAll,
|
|
|
sparePartsPurDetailInsertBatch } from '@/api/sparePartsPur'
|
|
|
-import { bulkProductList } from '@/api/dealerProduct'
|
|
|
+import { bulkProductList, dealerProductList } from '@/api/dealerProduct'
|
|
|
import { warehouseCascadeList } from '@/api/warehouse'
|
|
|
-import ProductType from '../../common/productType.js'
|
|
|
-import ProductBrand from '../../common/productBrand.js'
|
|
|
-import Print from '@/views/common/print.vue'
|
|
|
-import importGuideModal from './importGuideModal.vue'
|
|
|
-import newProduct from '@/views/productManagement/productInfo/edit.vue'
|
|
|
-import { hdPrint } from '@/libs/JGPrint'
|
|
|
export default {
|
|
|
name: 'BulkWarehousingEdit',
|
|
|
components: { STable, VSelect, Print, ProductType, ProductBrand, newProduct, importGuideModal },
|
|
@@ -464,29 +466,33 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
// 是否新增产品
|
|
|
- isAddNewProduct (data) {
|
|
|
+ async isAddNewProduct (data) {
|
|
|
const _this = this
|
|
|
if (data.length == 0) {
|
|
|
- _this.$confirm({
|
|
|
- title: '提示',
|
|
|
- content: '该产品信息不存在,是否马上新增?',
|
|
|
- centered: true,
|
|
|
- onOk () {
|
|
|
- _this.paramsData = {
|
|
|
- supplierName: _this.basicInfoData.supplierName,
|
|
|
- code: _this.queryParam.code,
|
|
|
- name: _this.queryParam.name,
|
|
|
- origCode: _this.queryParam.origCode,
|
|
|
- putCost: 0,
|
|
|
- putQty: 1,
|
|
|
- warehouse: []
|
|
|
+ const res = await dealerProductList({ code: _this.queryParam.code, enabledFlag: 0, pageNo: 1, pageSize: 50 })
|
|
|
+ const disableList = res.data.list
|
|
|
+ if (disableList && disableList.length == 0) {
|
|
|
+ _this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: '该产品信息不存在,是否马上新增?',
|
|
|
+ centered: true,
|
|
|
+ onOk () {
|
|
|
+ _this.paramsData = {
|
|
|
+ supplierName: _this.basicInfoData.supplierName,
|
|
|
+ code: _this.queryParam.code,
|
|
|
+ name: _this.queryParam.name,
|
|
|
+ origCode: _this.queryParam.origCode,
|
|
|
+ putCost: 0,
|
|
|
+ putQty: 1,
|
|
|
+ warehouse: []
|
|
|
+ }
|
|
|
+ _this.showNewProduct = true
|
|
|
+ _this.$nextTick(() => {
|
|
|
+ _this.$refs.newProduct.pageInit()
|
|
|
+ })
|
|
|
}
|
|
|
- _this.showNewProduct = true
|
|
|
- _this.$nextTick(() => {
|
|
|
- _this.$refs.newProduct.pageInit()
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
+ }
|
|
|
} else {
|
|
|
// 新添加的产品自动添加到已选产品中
|
|
|
if (data.length == 1 && this.showNewProduct) {
|
|
@@ -551,24 +557,24 @@ export default {
|
|
|
// 添加/编辑
|
|
|
handleAdd (row, isEdit) {
|
|
|
const _this = this
|
|
|
- if (!isEdit && (row.enabledFlag || row.enabledFlag == 0)) {
|
|
|
- this.$message.warning('产品已禁用,不能添加!')
|
|
|
- return
|
|
|
- }
|
|
|
if (!isEdit && !(row.putCost || row.putCost == 0)) {
|
|
|
- this.$message.warning('请输入成本价后再添加!')
|
|
|
+ _this.$message.warning('请输入成本价后再添加!')
|
|
|
return
|
|
|
}
|
|
|
if (!isEdit && !row.putQty) {
|
|
|
- this.$message.warning('请输入数量后再添加!')
|
|
|
+ _this.$message.warning('请输入数量后再添加!')
|
|
|
return
|
|
|
}
|
|
|
if (!isEdit && !row.warehouseSn) {
|
|
|
- this.$message.warning('请选择仓库后再添加!')
|
|
|
+ _this.$message.warning('请选择仓库后再添加!')
|
|
|
return
|
|
|
}
|
|
|
if (!isEdit && !row.warehouseLocationSn) {
|
|
|
- this.$message.warning('请选择仓位后再添加!')
|
|
|
+ _this.$message.warning('请选择仓位后再添加!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!isEdit && row.enabledFlag == 0) {
|
|
|
+ _this.$message.warning('产品已禁用,不能添加!')
|
|
|
return
|
|
|
}
|
|
|
// if (!isEdit && row.enabledFlag == '0') {
|
|
@@ -582,7 +588,7 @@ export default {
|
|
|
// })
|
|
|
// return
|
|
|
// }
|
|
|
- this.saveFormData(row, isEdit)
|
|
|
+ _this.saveFormData(row, isEdit)
|
|
|
},
|
|
|
// 保存
|
|
|
saveFormData (row, isEdit) {
|