|
@@ -21,19 +21,28 @@
|
|
<u-form-item label="原厂编码"><u-input v-model.trim="form.productOrigCode" placeholder="请输入原厂编码" input-align="right" /></u-form-item>
|
|
<u-form-item label="原厂编码"><u-input v-model.trim="form.productOrigCode" placeholder="请输入原厂编码" input-align="right" /></u-form-item>
|
|
<u-form-item label="产品名称"><u-input v-model.trim="form.productName" placeholder="请输入产品名称" input-align="right" /></u-form-item>
|
|
<u-form-item label="产品名称"><u-input v-model.trim="form.productName" placeholder="请输入产品名称" input-align="right" /></u-form-item>
|
|
<u-form-item label="产品品牌"><u-input v-model="brandName" @click="brandModal=true" disabled placeholder="请选择产品品牌" input-align="right" /></u-form-item>
|
|
<u-form-item label="产品品牌"><u-input v-model="brandName" @click="brandModal=true" disabled placeholder="请选择产品品牌" input-align="right" /></u-form-item>
|
|
|
|
+ <u-form-item label="产品分类"><u-input v-model="productTypeNameArr" @click="showTypeModal=true" disabled placeholder="请选择产品分类" input-align="right" /></u-form-item>
|
|
<u-form-item label="只查看有库存"><u-switch slot="right" v-model="form.zeroQtyFlag"></u-switch></u-form-item>
|
|
<u-form-item label="只查看有库存"><u-switch slot="right" v-model="form.zeroQtyFlag"></u-switch></u-form-item>
|
|
</u-form>
|
|
</u-form>
|
|
|
|
+ <view class="form-footer-btn">
|
|
|
|
+ <u-button size="medium" hover-class="none" @click="handleClean">清空</u-button>
|
|
|
|
+ <u-button size="medium" hover-class="none" :custom-style="customBtnStyle" @click="handleSearch">查询</u-button>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
<!-- 产品品牌 -->
|
|
<!-- 产品品牌 -->
|
|
<productBrand :openModal="brandModal" :itemSn="form.productBrandSn" @choose="brandChoose" @clean="brandClean" @close="brandModal=false" />
|
|
<productBrand :openModal="brandModal" :itemSn="form.productBrandSn" @choose="brandChoose" @clean="brandClean" @close="brandModal=false" />
|
|
|
|
+ <!-- 产品分类 -->
|
|
|
|
+ <productType :openModal="showTypeModal" :nowData="nowData" @choose="typeChoose" @clean="typeClean" @close="showTypeModal=false" />
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import productBrand from '@/pages/common/productBrand.vue'
|
|
import productBrand from '@/pages/common/productBrand.vue'
|
|
|
|
+ import productType from '@/pages/common/productType.vue'
|
|
|
|
+ import { dealerProductTypeList } from '@/api/dealerProductType'
|
|
import { stockCount } from '@/api/stock'
|
|
import { stockCount } from '@/api/stock'
|
|
export default{
|
|
export default{
|
|
- components: { productBrand },
|
|
|
|
|
|
+ components: { productBrand, productType },
|
|
data(){
|
|
data(){
|
|
return {
|
|
return {
|
|
form: {
|
|
form: {
|
|
@@ -41,14 +50,34 @@
|
|
productName: '', // 产品名称
|
|
productName: '', // 产品名称
|
|
productOrigCode: '', // 原厂编码
|
|
productOrigCode: '', // 原厂编码
|
|
productBrandSn: undefined, // 产品品牌
|
|
productBrandSn: undefined, // 产品品牌
|
|
- productTypeSn1: '', // 产品分类1
|
|
|
|
- productTypeSn2: '', // 产品分类2
|
|
|
|
- productTypeSn3: '', // 产品分类3
|
|
|
|
|
|
+ productTypeSn1: undefined, // 产品分类1
|
|
|
|
+ productTypeSn2: undefined, // 产品分类2
|
|
|
|
+ productTypeSn3: undefined, // 产品分类3
|
|
zeroQtyFlag: false // 库存情况
|
|
zeroQtyFlag: false // 库存情况
|
|
},
|
|
},
|
|
totalData: null,
|
|
totalData: null,
|
|
brandModal: false,
|
|
brandModal: false,
|
|
- brandName: ''
|
|
|
|
|
|
+ brandName: '',
|
|
|
|
+ showTypeModal: false,
|
|
|
|
+ nowData: {
|
|
|
|
+ data: [],
|
|
|
|
+ indArr: [],
|
|
|
|
+ nowInd: 0
|
|
|
|
+ },
|
|
|
|
+ customBtnStyle: { // 自定义按钮样式
|
|
|
|
+ borderColor: this.$config('primaryColor'),
|
|
|
|
+ backgroundColor: this.$config('primaryColor'),
|
|
|
|
+ color: '#fff'
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ productTypeNameArr: function() {
|
|
|
|
+ let str = ''
|
|
|
|
+ this.nowData.data.map(item => {
|
|
|
|
+ str += item.productTypeName+' / '
|
|
|
|
+ })
|
|
|
|
+ return str ? str.substr(0, str.length-3) : ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
@@ -65,6 +94,29 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 表单清空
|
|
|
|
+ handleClean(){
|
|
|
|
+ this.form.productCode = ''
|
|
|
|
+ this.form.productName = ''
|
|
|
|
+ this.form.productOrigCode = ''
|
|
|
|
+ this.form.productBrandSn = undefined
|
|
|
|
+ this.form.productTypeSn1 = undefined
|
|
|
|
+ this.form.productTypeSn2 = undefined
|
|
|
|
+ this.form.productTypeSn3 = undefined
|
|
|
|
+ this.form.zeroQtyFlag = false
|
|
|
|
+ console.log(this.form)
|
|
|
|
+ },
|
|
|
|
+ // 查询
|
|
|
|
+ handleSearch(){
|
|
|
|
+ let params = JSON.parse(JSON.stringify(this.form))
|
|
|
|
+ if (params.zeroQtyFlag) {
|
|
|
|
+ params.zeroQtyFlag = '0'
|
|
|
|
+ } else {
|
|
|
|
+ params.zeroQtyFlag = ''
|
|
|
|
+ }
|
|
|
|
+ console.log(params)
|
|
|
|
+ },
|
|
|
|
+ // 选择品牌
|
|
brandChoose(data){
|
|
brandChoose(data){
|
|
this.brandName = data.brandName
|
|
this.brandName = data.brandName
|
|
this.form.productBrandSn = data.brandSn
|
|
this.form.productBrandSn = data.brandSn
|
|
@@ -73,6 +125,28 @@
|
|
brandClean(){
|
|
brandClean(){
|
|
this.brandName = ''
|
|
this.brandName = ''
|
|
this.form.productBrandSn = undefined
|
|
this.form.productBrandSn = undefined
|
|
|
|
+ },
|
|
|
|
+ // 选择分类
|
|
|
|
+ typeChoose(obj){
|
|
|
|
+ this.nowData = {
|
|
|
|
+ data: obj.data,
|
|
|
|
+ indArr: obj.indArr,
|
|
|
|
+ nowInd: obj.nowInd
|
|
|
|
+ }
|
|
|
|
+ this.form.productTypeSn1 = this.nowData.data[0]&&this.nowData.data[0].productTypeSn ? this.nowData.data[0].productTypeSn : undefined
|
|
|
|
+ this.form.productTypeSn2 = this.nowData.data[0]&&this.nowData.data[1].productTypeSn ? this.nowData.data[1].productTypeSn : undefined
|
|
|
|
+ this.form.productTypeSn3 = this.nowData.data[0]&&this.nowData.data[2].productTypeSn ? this.nowData.data[2].productTypeSn : undefined
|
|
|
|
+ },
|
|
|
|
+ // 清空分类
|
|
|
|
+ typeClean(){
|
|
|
|
+ this.nowData = {
|
|
|
|
+ data: [],
|
|
|
|
+ indArr: [],
|
|
|
|
+ nowInd: 0
|
|
|
|
+ }
|
|
|
|
+ this.form.productTypeSn1 = undefined
|
|
|
|
+ this.form.productTypeSn2 = undefined
|
|
|
|
+ this.form.productTypeSn3 = undefined
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -114,6 +188,16 @@
|
|
margin: 0 20upx 0 10upx;
|
|
margin: 0 20upx 0 10upx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ .form-footer-btn{
|
|
|
|
+ margin: 60upx 30upx 30upx;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ }
|
|
|
|
+ .form-footer-btn uni-button{
|
|
|
|
+ width: 40%;
|
|
|
|
+ margin: 0 auto;
|
|
|
|
+ font-size: 30upx;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|