|
@@ -31,7 +31,7 @@
|
|
|
<a-card size="small" :bordered="false" class="chainTransferInEdit-cont">
|
|
|
<!-- 筛选条件 -->
|
|
|
<div class="table-page-search-wrapper">
|
|
|
- <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
+ <a-form layout="inline" @keyup.enter.native="getProductList(1)">
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="产品编码" prop="productCode">
|
|
@@ -57,7 +57,7 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 24px;">
|
|
|
- <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="chainTransferInEdit-refresh">查询</a-button>
|
|
|
+ <a-button type="primary" @click="getProductList(1)" :disabled="disabled" id="chainTransferInEdit-refresh">查询</a-button>
|
|
|
<a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="chainTransferInEdit-reset">重置</a-button>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
@@ -73,17 +73,16 @@
|
|
|
:dataSource="loadData"
|
|
|
:scroll="{ x: 1255 }"
|
|
|
bordered>
|
|
|
- <!-- 调入仓库 -->
|
|
|
- <template slot="warehouse" slot-scope="text, record">
|
|
|
- <a-select id="chainTransferInEdit-warehouse" placeholder="请选择" allowClear v-model="record.warehouse" style="width: 100%;">
|
|
|
- <a-select-option v-for="item in typeData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
|
|
|
- </a-select>
|
|
|
- </template>
|
|
|
- <!-- 调入仓位 -->
|
|
|
- <template slot="warehouseLoc" slot-scope="text, record">
|
|
|
- <a-select id="chainTransferInEdit-warehouseLoc" placeholder="请选择" allowClear v-model="record.warehouseLoc" style="width: 100%;">
|
|
|
- <a-select-option v-for="item in typeData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
|
|
|
- </a-select>
|
|
|
+ <!-- 仓库仓位 -->
|
|
|
+ <template slot="warehouse" slot-scope="text, record, index">
|
|
|
+ <a-cascader
|
|
|
+ @change="e => changeWarehouseCascade(e, record, index)"
|
|
|
+ v-model="record.warehouseCascade"
|
|
|
+ :options="warehouseCascadeData"
|
|
|
+ :fieldNames="{ label: 'name', value: 'id', children: 'warehouseLocationList' }"
|
|
|
+ id="chainTransferInEdit-warehouseCascade"
|
|
|
+ placeholder="请选择仓库仓位"
|
|
|
+ style="width: 100%;" />
|
|
|
</template>
|
|
|
</a-table>
|
|
|
</a-card>
|
|
@@ -103,6 +102,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
+import { getOperationalPrecision } from '@/libs/tools.js'
|
|
|
import { dealerProductTypeList } from '@/api/dealerProductType'
|
|
|
import { warehouseCascadeList } from '@/api/warehouse'
|
|
|
import { allocLinkagePutDetailSn, allocLinkagePutDetailList, allocLinkagePutDetailCount } from '@/api/allocLinkagePut'
|
|
@@ -111,23 +111,28 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
queryParam: {
|
|
|
-
|
|
|
+ productCode: '', // 产品编码
|
|
|
+ productName: '', // 产品名称
|
|
|
+ productTypeSn1: '', // 产品分类1
|
|
|
+ productTypeSn2: '', // 产品分类2
|
|
|
+ productTypeSn3: '' // 产品分类3
|
|
|
},
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
productTypeList: [], // 产品分类 下拉数据
|
|
|
productType: [],
|
|
|
+ warehouseCascadeData: [], // 仓库仓位
|
|
|
+ warehouseCascade: [], // 仓库仓位
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
|
|
|
- { title: '产品编码', dataIndex: 'creatDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品名称', dataIndex: 'custNahme', align: 'center', ellipsis: true },
|
|
|
- { title: '原厂编码', dataIndex: 'totalP', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '成本价(¥)', dataIndex: 'custsN2agme', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '调入数量', scopedSlots: { customRender: 'transferOutQuantity' }, width: 100, align: 'center' },
|
|
|
- { title: '单位', dataIndex: 'custsNsagme', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '成本小计(¥)', dataIndex: 'custsNagme', width: 115, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '仓库', scopedSlots: { customRender: 'warehouse' }, width: 140, align: 'center' },
|
|
|
- { title: '仓位', scopedSlots: { customRender: 'warehouseLoc' }, width: 140, align: 'center' }
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '成本价(¥)', dataIndex: 'putCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '调入数量', dataIndex: 'putQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '单位', dataIndex: 'dealerProductEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: 115, align: 'center' },
|
|
|
+ { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: 280, align: 'center' }
|
|
|
],
|
|
|
loadData: [],
|
|
|
pageNo: 1, // 分页页码
|
|
@@ -146,12 +151,12 @@ export default {
|
|
|
methods: {
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
- this.queryParam.orderBundleNo = ''
|
|
|
- this.queryParam.orderBundle.custMobile = ''
|
|
|
- this.queryParam.bundleName = ''
|
|
|
- this.queryParam.itemName = ''
|
|
|
- this.oldTime = undefined
|
|
|
- this.newTime = undefined
|
|
|
+ this.queryParam.productCode = ''
|
|
|
+ this.queryParam.productName = ''
|
|
|
+ this.queryParam.productTypeSn1 = ''
|
|
|
+ this.queryParam.productTypeSn2 = ''
|
|
|
+ this.queryParam.productTypeSn3 = ''
|
|
|
+ this.productType = []
|
|
|
this.getProductList(1)
|
|
|
},
|
|
|
// 基本信息
|
|
@@ -159,7 +164,6 @@ export default {
|
|
|
allocLinkagePutDetailSn({ sn: this.$route.params.sn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.basicInfoData = res.data
|
|
|
- this.getProductList(1)
|
|
|
this.getProductType()
|
|
|
} else {
|
|
|
this.basicInfoData = null
|
|
@@ -167,13 +171,13 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 提交
|
|
|
- handleSubmit () {},
|
|
|
+ handleSubmit () {
|
|
|
+ console.log(this.loadData)
|
|
|
+ },
|
|
|
// 产品列表数据
|
|
|
getProductList (pageNo) {
|
|
|
this.disabled = true
|
|
|
this.pageNo = pageNo || this.pageNo
|
|
|
- // 箭冠品牌 sysFlag传1,非箭冠品牌传0。与新增时所选调出产品类型有关
|
|
|
- // this.queryParam.sysFlag = this.basicInfoData.allocationType == 'JIANGUAN' ? '1' : '0'
|
|
|
const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
|
|
|
allocLinkagePutDetailList(params).then(res => {
|
|
|
if (res.status == 200) {
|
|
@@ -184,6 +188,8 @@ export default {
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
data.list[i].no = no + i + 1
|
|
|
+ // 成本小计 由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
|
|
|
+ data.list[i].costSubtotal = getOperationalPrecision(data.list[i].putCost, data.list[i].putQty)
|
|
|
}
|
|
|
this.loadData = data.list
|
|
|
this.disabled = false
|
|
@@ -214,6 +220,15 @@ export default {
|
|
|
this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
|
|
|
this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
|
|
|
},
|
|
|
+ changeWarehouseCascade (val, opt, ind) {
|
|
|
+ console.log(val, opt, ind)
|
|
|
+ if (val.length < 2) {
|
|
|
+ this.$message.warning('当前仓库无仓位,请选择其他仓库')
|
|
|
+ } else {
|
|
|
+ this.loadData[ind].warehouseSn = val[0] ? val[0] : ''
|
|
|
+ this.loadData[ind].warehouseLocationSn = val[1] ? val[1] : ''
|
|
|
+ }
|
|
|
+ },
|
|
|
// 产品分类 列表
|
|
|
getProductType () {
|
|
|
dealerProductTypeList({ sysFlag: this.basicInfoData.allocationType == 'JIANGUAN' ? '1' : '0' }).then(res => {
|
|
@@ -226,7 +241,11 @@ export default {
|
|
|
},
|
|
|
getWarehouseCascade () {
|
|
|
warehouseCascadeList({}).then(res => {
|
|
|
-
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.warehouseCascadeData = res.data
|
|
|
+ } else {
|
|
|
+ this.warehouseCascadeData = []
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
},
|