|
|
|
@ -10,39 +10,58 @@ |
|
|
|
<view v-if="formData.productPicture !=''"> |
|
|
|
<img :src="formData.productPicture" alt="" class="upload-img"> |
|
|
|
</view> |
|
|
|
<u-upload :fileList="formData.productPicture" @afterRead="afterRead" @delete="deletePic" name="1" multiple |
|
|
|
:maxCount="1"></u-upload> |
|
|
|
<u-upload :fileList="formData.productPicture" @afterRead="afterRead" @delete="deletePic" name="1" |
|
|
|
multiple :maxCount="1"></u-upload> |
|
|
|
</uni-forms-item> |
|
|
|
<uni-forms-item label="货号" name="productSn" required> |
|
|
|
<uni-easyinput :clearable='false' type="text" v-model="formData.productSn" @blur="getSnIsRepeat" placeholder="请输入货号" trim="all" /> |
|
|
|
<uni-easyinput :clearable='false' type="text" v-model="formData.productSn" @blur="getSnIsRepeat" |
|
|
|
placeholder="请输入货号" trim="all" /> |
|
|
|
<uni-icons type="refresh" color="#777" size='36' @tap="$refs.SNDialog.open('center')"></uni-icons> |
|
|
|
</uni-forms-item> |
|
|
|
<uni-forms-item label="采购价" name="price"> |
|
|
|
<input type="digit" class="content-input" v-model="formData.purchasePrice" @focus="obtainPrice($event,'purchasePrice')" @blur="changessPrice($event,'purchasePrice')" placeholder="请输入采购价"> |
|
|
|
<input type="digit" class="content-input" v-model="formData.purchasePrice" |
|
|
|
@focus="obtainPrice($event,'purchasePrice')" @blur="changessPrice($event,'purchasePrice')" |
|
|
|
placeholder="请输入采购价"> |
|
|
|
</uni-forms-item> |
|
|
|
<uni-forms-item label="批发价" name="wholesalePrice"> |
|
|
|
<!-- <uni-easyinput type="digit" v-model="formData.wholesalePrice" placeholder="请输入批发价" trim="all" /> --> |
|
|
|
<input type="digit" class="content-input" v-model="formData.wholesalePrice" @focus="obtainPrice($event,'wholesalePrice')" @blur="changessPrice($event,'wholesalePrice')" placeholder="请输入批发价"> |
|
|
|
<input type="digit" class="content-input" v-model="formData.wholesalePrice" |
|
|
|
@focus="obtainPrice($event,'wholesalePrice')" @blur="changessPrice($event,'wholesalePrice')" |
|
|
|
placeholder="请输入批发价"> |
|
|
|
</uni-forms-item> |
|
|
|
<uni-forms-item label="分类" name="categoryId"> |
|
|
|
<!-- <uni-data-select class="uni-data-select" :localdata="categoryList" v-model="formData.categoryId" |
|
|
|
placeholder="请选择分类" @change="categoryChange(formData.categoryId)"></uni-data-select> --> |
|
|
|
<uni-forms-item label="商品分类" name="categoryId"> |
|
|
|
<view class="content-list"> |
|
|
|
<view class="list-val"> |
|
|
|
<input type="text" placeholder="请选择分类" disabled :value="typeItem.categoryName" |
|
|
|
style="border-bottom: 1px solid #fff;text-align: center;" |
|
|
|
@tap="goGategoryLow"> |
|
|
|
<input type="text" placeholder="请选择商品分类" disabled :value="typeItem.categoryName" |
|
|
|
style="border-bottom: 1px solid #fff;text-align: center;" @tap="goGategoryLow"> |
|
|
|
<uni-icons type="right" size="16" |
|
|
|
style="margin-left: 40rpx;line-height: 70rpx;"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-forms-item> |
|
|
|
<!-- <uni-forms-item label="客户价格" name="categoryId" v-if="customerCategoryList != null"> |
|
|
|
<view class="content-list"> |
|
|
|
<view class="list-val"> |
|
|
|
<input type="text" placeholder="根据客户分类自定义价格" disabled :value="formData.userCategoryName" |
|
|
|
style="border-bottom: 1px solid #fff;text-align: center;" @tap="addCustomPrice"> |
|
|
|
<uni-icons type="right" size="16" |
|
|
|
style="margin-left: 40rpx;line-height: 70rpx;"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-forms-item> |
|
|
|
<view style="display: flex;" v-if="customerCategoryList != null"> |
|
|
|
<view class="" style="width: 28%;"></view> |
|
|
|
<view class="" style="width: 72%;min-height: 80rpx;padding: 0 10px 20rpx 0;"> |
|
|
|
<view v-for="(item,index) in customerCategoryList" :key="index"> |
|
|
|
{{item.categoryName}}:{{item.categoryPrice}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
<uni-forms-item label="添加规格" name="categoryId"> |
|
|
|
<view class="content-list"> |
|
|
|
<view class="list-val"> |
|
|
|
<input type="text" placeholder="点击选择规格" disabled |
|
|
|
style="border-bottom: 1px solid #fff;text-align: center;" |
|
|
|
@tap="ejectRuleSelect"> |
|
|
|
style="border-bottom: 1px solid #fff;text-align: center;" @tap="ejectRuleSelect"> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-forms-item> |
|
|
|
@ -51,7 +70,8 @@ |
|
|
|
{{item.attributeName}} |
|
|
|
</view> |
|
|
|
<view class="" style="width: 72%;min-height: 80rpx;padding: 0 10px 20rpx 0;"> |
|
|
|
<view v-for="(item1,index1) in item.productAttributeValueVoList" :key="index1" style="float: left;padding-right: 20rpx;"> |
|
|
|
<view v-for="(item1,index1) in item.productAttributeValueVoList" :key="index1" |
|
|
|
style="float: left;padding-right: 20rpx;"> |
|
|
|
{{item1.value}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -61,11 +81,13 @@ |
|
|
|
<u-icon name="camera" size="36" @tap.stop='scanCodeAdd'></u-icon> |
|
|
|
</uni-forms-item> |
|
|
|
<uni-forms-item label="多图上传" name="productPicture"> |
|
|
|
<view class="upload-img" @tap="pictureAdd" style="background: #eee;text-align: center;line-height: 160rpx;"> |
|
|
|
<view class="upload-img" @tap="pictureAdd" |
|
|
|
style="background: #eee;text-align: center;line-height: 160rpx;"> |
|
|
|
<uni-icons type="camera" size="28" color="#777"></uni-icons> |
|
|
|
</view> |
|
|
|
<view style="overflow-x: scroll;display: flex;width: 350rpx;"> |
|
|
|
<view v-if="formData.productPictures !=''" v-for="(item,index) in formData.productPictures" :key="index" style="width: 160rpx;height: 160rpx;margin-left: 20rpx;"> |
|
|
|
<view v-if="formData.productPictures !=''" v-for="(item,index) in formData.productPictures" |
|
|
|
:key="index" style="width: 160rpx;height: 160rpx;margin-left: 20rpx;"> |
|
|
|
<img :src="item.productPicture" alt="" class="upload-img"> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -73,7 +95,8 @@ |
|
|
|
</uni-forms-item> |
|
|
|
<uni-forms-item label="市场价" name="price"> |
|
|
|
<!-- <uni-easyinput type="digit" v-model="formData.price" placeholder="请输入零售价" trim="all" /> --> |
|
|
|
<input type="digit" class="content-input" v-model="formData.price" @focus="obtainPrice($event,'price')" @blur="changessPrice($event,'price')" placeholder="请输入零售价"> |
|
|
|
<input type="digit" class="content-input" v-model="formData.price" |
|
|
|
@focus="obtainPrice($event,'price')" @blur="changessPrice($event,'price')" placeholder="请输入零售价"> |
|
|
|
</uni-forms-item> |
|
|
|
<uni-forms-item label="尾货预警" name="salesWeek"> |
|
|
|
<!-- <uni-easyinput type="digit" v-model="formData.salesWeek" placeholder="请输入零售价" trim="all" /> --> |
|
|
|
@ -98,7 +121,8 @@ |
|
|
|
点击选择已有规则 |
|
|
|
</view> |
|
|
|
<view style="width: 90%;margin: 0 auto;"> |
|
|
|
<view v-for="(item,index) in snList" @tap="generateSn(item.value)" :key="index" style="height: 80rpx;line-height: 80rpx;font-size: 28rpx;border-bottom: 1px solid #eee;display: flex;"> |
|
|
|
<view v-for="(item,index) in snList" @tap="generateSn(item.value)" :key="index" |
|
|
|
style="height: 80rpx;line-height: 80rpx;font-size: 28rpx;border-bottom: 1px solid #eee;display: flex;"> |
|
|
|
<view style="width: 90%;">{{index + 1}} 、 {{item.text}}</view> |
|
|
|
<uni-icons type="right" size="16" style="width: 10%;text-align: center;"></uni-icons> |
|
|
|
</view> |
|
|
|
@ -106,7 +130,8 @@ |
|
|
|
<view style="height: 80rpx;font-size: 36rpx;font-weight: bold;line-height: 80rpx;text-align: center;"> |
|
|
|
生成新规则 |
|
|
|
</view> |
|
|
|
<view style="height: 80rpx;font-size: 22rpx;font-weight: bold;line-height: 80rpx;color:red;text-align: center;"> |
|
|
|
<view |
|
|
|
style="height: 80rpx;font-size: 22rpx;font-weight: bold;line-height: 80rpx;color:red;text-align: center;"> |
|
|
|
*如生成新的货号规则,可在下方输入框新增 |
|
|
|
</view> |
|
|
|
<view class="sn-content-list"> |
|
|
|
@ -145,11 +170,11 @@ |
|
|
|
<li v-for="(item,index) in defaultList" :key="index"> |
|
|
|
<view class="title-fur"> |
|
|
|
<view class="name">{{item.name}}</view> |
|
|
|
<u-icon size="20" name="plus" color="#5fd9ee" |
|
|
|
@tap="toggle(index) "></u-icon> |
|
|
|
<u-icon size="20" name="plus" color="#5fd9ee" @tap="toggle(index) "></u-icon> |
|
|
|
</view> |
|
|
|
<view class="content-fur"> |
|
|
|
<view class="content-low" :class="item1.checked?'checked':''" v-for="(item1,index1) in item.list" :key="index1" |
|
|
|
<view class="content-low" :class="item1.checked?'checked':''" |
|
|
|
v-for="(item1,index1) in item.list" :key="index1" |
|
|
|
@tap.stop="isCheckPrec(item,item1.value,index1)">{{item1.value}}</view> |
|
|
|
</view> |
|
|
|
</li> |
|
|
|
@ -202,12 +227,32 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
<!-- 维护客户价格弹出层 --> |
|
|
|
<uni-popup ref="customPopup" background-color="#fff"> |
|
|
|
<view class="popup-content" style="height: auto;max-height: 600rpx;margin-bottom: 0;"> |
|
|
|
<view v-for="(item,index) in customerCategoryList" :key="index"> |
|
|
|
<view style="height: 60rpx;line-height: 60rpx;"> |
|
|
|
{{item.categoryName}} |
|
|
|
</view> |
|
|
|
<input type="number" v-model='item.categoryPrice' placeholder="请输入客户价格" style="height: 60rpx;padding-left: 20rpx;border: 1px solid #eee;border-radius: 10rpx;"> |
|
|
|
</view> |
|
|
|
<view @tap="updateCate" style="text-align:center;margin-top:20rpx;width: 100%;height: 60rpx;line-height: 60rpx;background: #088FEB;color: #fff;"> |
|
|
|
确认 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
<!-- 给供应商回款的弹层 --> |
|
|
|
<uni-popup ref="warnPopup" background-color="#fff"> |
|
|
|
<view class="popup-content" style="width: 500rpx;height: 300rpx;"> |
|
|
|
<view class="popup-content" style="width: 500rpx;height: 510rpx;"> |
|
|
|
<view style="font-size: 36rpx;font-weight: bold;text-align: center;">提示</view> |
|
|
|
<view style="width:100%;font-weight:bold;text-align: center;font-size: 28rpx;margin: 20rpx 0;"> |
|
|
|
您维护采购价后,现在有{{(guigeNum * differencePurchasePrice).toFixed(2)}}的差额,是否自动给供应商“{{dataList.supplierName}}”回款? |
|
|
|
<view |
|
|
|
style="width:100%;font-weight:bold;font-size: 28rpx;line-height: 40rpx;margin: 20rpx 0;display: flex;flex-direction: column;"> |
|
|
|
<text>历次入库总数量:{{guigeNum}}</text> |
|
|
|
<text style="margin: 20rpx 0;">差价:{{guigeNum}} * ({{oldPurchasePrice}} - {{formData.purchasePrice}}) |
|
|
|
= {{zPrice}}</text> |
|
|
|
<view>是否使用此<input type="text" v-model="zPrice" |
|
|
|
style="width: 150rpx;border-bottom:1px solid #000;color:red;text-align:center;display: inline-block;"> |
|
|
|
(金额可修改)金额,给供应商“{{dataList.supplierName}}”回款?</view> |
|
|
|
</view> |
|
|
|
<view class="popup-bottom" style="position: absolute;"> |
|
|
|
<view class="popup-bottom-left"> |
|
|
|
@ -240,7 +285,7 @@ |
|
|
|
productName: '', |
|
|
|
price: 0, |
|
|
|
productSn: '', |
|
|
|
purchasePrice:'', |
|
|
|
purchasePrice: 0, |
|
|
|
wholesalePrice: 0, |
|
|
|
productPicture: '', |
|
|
|
productIntro: '', |
|
|
|
@ -385,12 +430,15 @@ |
|
|
|
guigeNum: 0, //总共有多少件库存 |
|
|
|
differencePurchasePrice: 0, //旧采购价和新维护采购价的差额差额 |
|
|
|
oldPurchasePrice: 0, |
|
|
|
|
|
|
|
userType: '', |
|
|
|
typeItem: {}, |
|
|
|
arrtChange: [], |
|
|
|
categoryId: '', |
|
|
|
dataList: [], |
|
|
|
zPrice: 0, |
|
|
|
type: 'add', |
|
|
|
customerCategoryList:[], |
|
|
|
multipleList: [], |
|
|
|
rules: { |
|
|
|
categoryId: { |
|
|
|
@ -474,7 +522,8 @@ |
|
|
|
}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.type = 'edit' |
|
|
|
|
|
|
|
this.customerCategoryList = JSON.parse(res.result.customerCategoryRule) |
|
|
|
console.log('customerCategoryList',this.customerCategoryList) |
|
|
|
this.formData.attrId = res.result.attrId |
|
|
|
this.formData.productName = res.result.productName |
|
|
|
this.formData.barcode = res.result.barcode |
|
|
|
@ -494,8 +543,11 @@ |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
}).catch((res) => {}) |
|
|
|
}else{ |
|
|
|
this.getCustomerCategoryList() |
|
|
|
} |
|
|
|
this.userType = uni.getStorageSync('type') |
|
|
|
|
|
|
|
this.getGategoryList() |
|
|
|
this.getSnList() |
|
|
|
}, |
|
|
|
@ -551,7 +603,7 @@ |
|
|
|
supplierCollection() { |
|
|
|
this.tui.request('/app/debt/recharge', "post", { |
|
|
|
userId: this.dataList.supplierId, |
|
|
|
amountOwed:(this.guigeNum * this.differencePurchasePrice).toFixed(2), |
|
|
|
amountOwed: this.zPrice, |
|
|
|
userType: '1' |
|
|
|
}, false, false).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
@ -563,6 +615,31 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
//获取客户分类 |
|
|
|
getCustomerCategoryList(){ |
|
|
|
this.tui.request("/app/customerCategory/getCustomerCategoryListByShopId", "POST", { |
|
|
|
shopId:uni.getStorageSync('shopId') |
|
|
|
}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
if(res.result.length > 0){ |
|
|
|
this.customerCategoryList = res.result |
|
|
|
for(let i=0;i<this.customerCategoryList.length;i++){ |
|
|
|
let data = { |
|
|
|
categoryName:this.customerCategoryList[i].categoryName, |
|
|
|
categoryId:this.customerCategoryList[i].id, |
|
|
|
categoryPrice:"" |
|
|
|
} |
|
|
|
this.customerCategoryList[i] = data |
|
|
|
} |
|
|
|
}else{ |
|
|
|
this.customerCategoryList = null |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
}).catch((res) => {}) |
|
|
|
}, |
|
|
|
//进入页面,查询货号列表 |
|
|
|
getSnList() { |
|
|
|
// snList |
|
|
|
@ -593,9 +670,19 @@ |
|
|
|
}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
if (res.result.length > 0) { |
|
|
|
console.log(this.formData.categoryId) |
|
|
|
if(this.formData.categoryId != '' && this.formData.categoryId != undefined){ |
|
|
|
for(let i=0;i<res.result.length;i++){ |
|
|
|
if(res.result[i].id == this.formData.categoryId){ |
|
|
|
this.typeItem = res.result[i] |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
this.typeItem = res.result[0] |
|
|
|
this.formData.categoryId = this.typeItem.id |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
@ -643,6 +730,7 @@ |
|
|
|
}) |
|
|
|
|
|
|
|
for (let i = 0; i < lists.length; i++) { |
|
|
|
console.log(lists[i].url) |
|
|
|
const result = await this.uploadFilePromise(lists[i].url) |
|
|
|
let item = this[`fileList${event.name}`][fileListLen] |
|
|
|
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, { |
|
|
|
@ -663,19 +751,37 @@ |
|
|
|
this.formData.purchasePrice = '' |
|
|
|
} |
|
|
|
}, |
|
|
|
addCustomPrice(){ |
|
|
|
this.$refs.customPopup.open() |
|
|
|
}, |
|
|
|
generateSn(value) { |
|
|
|
this.tui.request("/app/productSn/getNewProductSn", "POST", { |
|
|
|
snPre: value |
|
|
|
}, false, true).then((res1) => { |
|
|
|
if (res1.code == 200) { |
|
|
|
this.tui.request('/app/product/getByProductSn', "post", { |
|
|
|
productSn: res1.result |
|
|
|
}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.formData.productSn = res.result |
|
|
|
if (res.result != '') { |
|
|
|
this.generateSn(value) |
|
|
|
} else { |
|
|
|
this.formData.productSn = res1.result |
|
|
|
this.$forceUpdate() |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
}).catch((res) => {}) |
|
|
|
this.$refs.SNDialog.close() |
|
|
|
}, |
|
|
|
updateCate(){ |
|
|
|
this.$refs.customPopup.close() |
|
|
|
this.$forceUpdate() |
|
|
|
}, |
|
|
|
async startGetSn() { |
|
|
|
var that = this; |
|
|
|
if (this.prefixRule == '') { |
|
|
|
@ -698,7 +804,8 @@ |
|
|
|
content: "货号已经被删除,是否重新启用?", |
|
|
|
success: function(res) { |
|
|
|
if (res.confirm) { |
|
|
|
that.tui.request("/app/productSn/useAgainProductSn", "POST", { |
|
|
|
that.tui.request("/app/productSn/useAgainProductSn", |
|
|
|
"POST", { |
|
|
|
id: res1.result.id |
|
|
|
}, false, true).then((res2) => { |
|
|
|
if (res2.code == 200) { |
|
|
|
@ -706,7 +813,8 @@ |
|
|
|
setTimeout(res => { |
|
|
|
that.$refs.SNDialog.close() |
|
|
|
that.getSnList() |
|
|
|
that.generateSn(this.prefixRule) |
|
|
|
that.generateSn(this |
|
|
|
.prefixRule) |
|
|
|
}, 1000) |
|
|
|
} else { |
|
|
|
that.tui.toast(res2.message) |
|
|
|
@ -832,6 +940,12 @@ |
|
|
|
if (e.target.value == '') { |
|
|
|
this.formData.purchasePrice = this.linshiPrice |
|
|
|
} else { |
|
|
|
this.formData.purchasePrice = e.target.value |
|
|
|
console.log('改变', this.formData) |
|
|
|
if (this.dataList == '') { |
|
|
|
uni.hideLoading() |
|
|
|
return |
|
|
|
} |
|
|
|
this.differencePurchasePrice = Number(this.oldPurchasePrice) - Number(e.target.value) |
|
|
|
this.tui.request("/app/purchase/getPurchaseListByProductId", "post", { |
|
|
|
productId: this.dataList.id, |
|
|
|
@ -843,19 +957,24 @@ |
|
|
|
for (let i = 0; i < res.result.records.length; i++) { |
|
|
|
this.guigeNum += Number(res.result.records[i].purchase.totalAmount) |
|
|
|
} |
|
|
|
|
|
|
|
setTimeout(res => { |
|
|
|
this.zPrice = this.guigeNum * this.differencePurchasePrice |
|
|
|
if (this.zPrice != 0) { |
|
|
|
this.$refs.warnPopup.open() |
|
|
|
} |
|
|
|
|
|
|
|
uni.hideLoading() |
|
|
|
},1000) |
|
|
|
}, 300) |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
}).catch((res) => {}) |
|
|
|
this.formData.purchasePrice = e.target.value |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
uni.hideLoading() |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
toggle(index) { |
|
|
|
@ -865,9 +984,14 @@ |
|
|
|
uploadFilePromise(url) { |
|
|
|
let that = this; |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
uni.compressImage({ |
|
|
|
src: url, |
|
|
|
quality: 50, |
|
|
|
success: res => { |
|
|
|
|
|
|
|
let a = uni.uploadFile({ |
|
|
|
url: that.tui.interfaceUrl() + '/upload/file', |
|
|
|
filePath: url, |
|
|
|
filePath: res.tempFilePath, |
|
|
|
name: 'file', |
|
|
|
header: { |
|
|
|
"content-type": "multipart/form-data", |
|
|
|
@ -881,6 +1005,9 @@ |
|
|
|
this.formData.productPicture = path.result |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
categoryChange(e) { |
|
|
|
@ -906,7 +1033,8 @@ |
|
|
|
for (let m = 0; m < this.multipleList[0].productAttributeValueVoList.length; m++) { |
|
|
|
let isTrue = true |
|
|
|
for (let i = 0; i < this.defaultList[0].list.length; i++) { |
|
|
|
if(this.defaultList[0].list[i].value == this.multipleList[0].productAttributeValueVoList[m].value){ |
|
|
|
if (this.defaultList[0].list[i].value == this.multipleList[0].productAttributeValueVoList[m] |
|
|
|
.value) { |
|
|
|
isTrue = false |
|
|
|
this.defaultList[0].list[i].checked = true |
|
|
|
} else { |
|
|
|
@ -921,7 +1049,8 @@ |
|
|
|
for (let m = 0; m < this.multipleList[1].productAttributeValueVoList.length; m++) { |
|
|
|
let isTrue = true |
|
|
|
for (let i = 0; i < this.defaultList[1].list.length; i++) { |
|
|
|
if(this.defaultList[1].list[i].value == this.multipleList[1].productAttributeValueVoList[m].value){ |
|
|
|
if (this.defaultList[1].list[i].value == this.multipleList[1].productAttributeValueVoList[m] |
|
|
|
.value) { |
|
|
|
isTrue = false |
|
|
|
this.defaultList[1].list[i].checked = true |
|
|
|
} else { |
|
|
|
@ -950,7 +1079,6 @@ |
|
|
|
url = '/app/product/edit' |
|
|
|
this.formData.id = that.dataList.id |
|
|
|
this.formData.stockCount = that.dataList.stockCount |
|
|
|
this.formData.purchasePrice = that.dataList.purchasePrice |
|
|
|
this.formData.supplierId = that.dataList.supplierId |
|
|
|
this.formData.supplierName = that.dataList.supplierName |
|
|
|
this.formData.delFlag = that.dataList.delFlag |
|
|
|
@ -958,13 +1086,14 @@ |
|
|
|
url = '/app/product/save' |
|
|
|
if (this.userType == 1) { |
|
|
|
this.formData.purchasePrice = '' |
|
|
|
}else{ |
|
|
|
this.formData.purchasePrice = 0 |
|
|
|
} |
|
|
|
} |
|
|
|
if (res.productPicture == '') { |
|
|
|
res.productPicture = '' |
|
|
|
} |
|
|
|
if(this.customerCategoryList != null){ |
|
|
|
this.formData.customerCategoryRule = JSON.stringify(this.customerCategoryList) |
|
|
|
} |
|
|
|
this.formData.productCategoryVo = { |
|
|
|
productAttributeOfAddVos: this.multipleList.length > 0 ? this.multipleList : [{ |
|
|
|
attributeName: '颜色', |
|
|
|
@ -980,6 +1109,7 @@ |
|
|
|
}] |
|
|
|
}] |
|
|
|
} |
|
|
|
console.log('purchasePrice', this.formData) |
|
|
|
that.tui.request(url, "post", this.formData, false, false).then((res1) => { |
|
|
|
if (res1.code == 200) { |
|
|
|
if (that.dataList != '') { //编辑商品 |
|
|
|
@ -1082,7 +1212,8 @@ |
|
|
|
}, false, true).then((res1) => { |
|
|
|
if (res1.code == 200) { |
|
|
|
if (res1.result != '') { |
|
|
|
that.tui.toast('当前条码已被商品:“'+res1.result[0].productName+'”占用,请重新输入') |
|
|
|
that.tui.toast('当前条码已被商品:“' + res1.result[0].productName + |
|
|
|
'”占用,请重新输入') |
|
|
|
} else { |
|
|
|
that.formData.barcode = res.result; |
|
|
|
} |
|
|
|
@ -1129,7 +1260,8 @@ |
|
|
|
for (var i = 0; i < this.multipleList.length; i++) { |
|
|
|
if (this.multipleList[i].attributeName == item.name) { //同种分类 |
|
|
|
for (var m = 0; m < this.multipleList[i].productAttributeValueVoList.length; m++) { |
|
|
|
if(this.multipleList[i].productAttributeValueVoList[m].value == item.list[index].value){ //规格相同 |
|
|
|
if (this.multipleList[i].productAttributeValueVoList[m].value == item.list[index] |
|
|
|
.value) { //规格相同 |
|
|
|
this.multipleList[i].productAttributeValueVoList.splice(m, 1) |
|
|
|
return; |
|
|
|
} else { //规格不同 |
|
|
|
@ -1194,6 +1326,7 @@ |
|
|
|
float: left; |
|
|
|
font-size: 25rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.formBox { |
|
|
|
margin: 20rpx; |
|
|
|
padding: 20rpx 26rpx; |
|
|
|
@ -1221,19 +1354,23 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.upload-img { |
|
|
|
width: 160rpx; |
|
|
|
height: 160rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.checked { |
|
|
|
background: #60F3FF !important; |
|
|
|
color: #fff !important; |
|
|
|
border-radius: 5px !important; |
|
|
|
} |
|
|
|
|
|
|
|
.content-list { |
|
|
|
height: 70rpx; |
|
|
|
border: 1px solid #eee; |
|
|
|
} |
|
|
|
|
|
|
|
.sn-content-list { |
|
|
|
width: 95%; |
|
|
|
margin: 0 auto; |
|
|
|
@ -1246,6 +1383,7 @@ |
|
|
|
border-bottom: none; |
|
|
|
height: auto; |
|
|
|
} |
|
|
|
|
|
|
|
.sn-list-name { |
|
|
|
width: 200rpx; |
|
|
|
text-align: left; |
|
|
|
@ -1259,6 +1397,7 @@ |
|
|
|
height: 80rpx; |
|
|
|
line-height: 80rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.sn-list-val input { |
|
|
|
width: 400rpx; |
|
|
|
height: 60rpx; |
|
|
|
@ -1269,6 +1408,7 @@ |
|
|
|
padding-left: 20rpx; |
|
|
|
border-bottom: 1px solid #088FEB; |
|
|
|
} |
|
|
|
|
|
|
|
button { |
|
|
|
height: 90rpx; |
|
|
|
line-height: 90rpx; |
|
|
|
@ -1277,6 +1417,7 @@ |
|
|
|
background: #5fd9ee; |
|
|
|
border-radius: 10px; |
|
|
|
} |
|
|
|
|
|
|
|
.content-input { |
|
|
|
width: auto; |
|
|
|
position: relative; |
|
|
|
@ -1289,6 +1430,7 @@ |
|
|
|
padding-left: 20rpx; |
|
|
|
border-radius: 5px; |
|
|
|
} |
|
|
|
|
|
|
|
.add-popup-content { |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
@ -1323,11 +1465,13 @@ |
|
|
|
text-align: center; |
|
|
|
background: linear-gradient(90deg, #60F3FF, #088FEB); |
|
|
|
} |
|
|
|
|
|
|
|
.title-fur { |
|
|
|
width: 95%; |
|
|
|
height: 70rpx; |
|
|
|
margin: 0 auto; |
|
|
|
border-bottom: 1px solid #eee; |
|
|
|
|
|
|
|
.name { |
|
|
|
font-size: 30rpx; |
|
|
|
width: 90%; |
|
|
|
@ -1336,6 +1480,7 @@ |
|
|
|
line-height: 70rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.content-fur { |
|
|
|
padding-bottom: 25rpx; |
|
|
|
} |
|
|
|
@ -1352,6 +1497,7 @@ |
|
|
|
margin: 20rpx 0 0 20rpx; |
|
|
|
border-radius: 5px; |
|
|
|
} |
|
|
|
|
|
|
|
.type-popup { |
|
|
|
width: 500rpx; |
|
|
|
height: auto; |
|
|
|
@ -1360,6 +1506,7 @@ |
|
|
|
position: relative; |
|
|
|
margin-bottom: 40rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.popup-content { |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
@ -1375,6 +1522,7 @@ |
|
|
|
background: #fff; |
|
|
|
height: 50rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.popup-bottom { |
|
|
|
width: 95%; |
|
|
|
height: 100rpx; |
|
|
|
@ -1395,6 +1543,7 @@ |
|
|
|
width: 50%; |
|
|
|
line-height: 100rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.bottom-btn { |
|
|
|
width: 70%; |
|
|
|
line-height: 35px; |
|
|
|
|