| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292 |
- <template>
- <view class="app-content">
- <form @submit="commitForm">
- <view class="module-com input-line-wrap">
- <tui-list-cell class="line-cell" :hover="false">
- <view class="tui-title required">店名</view>
- <input v-model="form.name" placeholder-class="phcolor" class="tui-input" name="name" placeholder="店名、姓名或公司名" maxlength="50" type="text" />
- </tui-list-cell>
- <tui-list-cell class="line-cell" :hover="false">
- <view class="tui-title">手机号</view>
- <input v-model="form.mobile" placeholder-class="phcolor" class="tui-input" name="mobile" placeholder="对方手机号" maxlength="50" type="text" />
- </tui-list-cell>
- <tui-list-cell class="line-cell" :hover="false">
- <view class="tui-title">微信号</view>
- <input v-model="form.wx" placeholder-class="phcolor" class="tui-input" name="wx" placeholder="对方微信号" maxlength="50" type="text" />
- </tui-list-cell>
- <tui-list-cell class="line-cell" :hover="false">
- <view class="tui-title">身份证号</view>
- <input v-model="form.no" placeholder-class="phcolor" class="tui-input" name="no" placeholder="对方身份证号或营业执照号" maxlength="50" type="text" />
- </tui-list-cell>
- <tui-list-cell class="line-cell" :hover="false">
- <view class="tui-title required">欠款日期</view>
- <input v-model="form.date" placeholder-class="phcolor" class="tui-input" name="date" placeholder="选账单交易日期" maxlength="50" type="text" />
- </tui-list-cell>
- <tui-list-cell class="line-cell" :hover="false">
- <view class="tui-title required">欠款金额</view>
- <input v-model="form.amount" placeholder-class="phcolor" class="tui-input" name="amount" placeholder="对方欠款金额" maxlength="50" type="digit" />
- </tui-list-cell>
- </view>
- <view class="module-com input-line-wrap goods-wrap">
- <view class="module-tit">
- <span>图片证据</span>
- <span class="app-color-3">(微信聊天截图、销售单拍照等,最多5张)</span>
- </view>
- <view class="module-det">
- <htz-image-upload :max="5" :compress="true" v-model="currentImgData" :headers="headers"
- @uploadSuccess="imgUploadSuccess" @imgDelete="imgDeleteFn" :action="getLoginInfo.imgUploadApi">
- </htz-image-upload>
- </view>
- </view>
- <view class="module-com input-line-wrap summary-wrap">
- <view class="module-tit">其他说明</view>
- <view class="module-det" style="padding-bottom: 20upx">
- <textarea v-model="form.briefContent" class="goods-summary" placeholder-class="phcolor" placeholder="补充说明" />
- </view>
- </view>
- <view class="app-footer">
- <button class="admin-button-com middle default" @click="goBack">取消</button>
- <button class="admin-button-com middle blue" formType="submit">保存</button>
- </view>
- </form>
- </view>
- </template>
- <script>
- import { mapGetters } from "vuex";
- import TuiListCell from "@/components/plugin/list-cell";
- import AppUploader from "@/components/app-uploader";
- const form = require("@/utils/formValidation.js");
- import { addGoodsData } from "@/api/goods"
- import htzImageUpload from '@/components/htz-image-upload/htz-image-upload.vue'
- export default {
- name: "add",
- components: { TuiListCell, AppUploader,htzImageUpload },
- mixins: [],
- data() {
- return {
- headers:{token:''},
- form: {
- name: "",
- wx:"",
- mobile:"",
- amount: "",
- date:"",
- no:""
- },
- currentImgData:[]
- };
- },
- onLoad() {
- const token = uni.getStorageSync('token')
- this.headers.token = token
- },
- methods: {
- goBack(){
- uni.navigateBack({delta:1})
- },
- imgDeleteFn(res){
- const index = res.index
- this.form.shopImg.splice(index,1)
- },
- imgUploadSuccess(res) {
- var _res = JSON.parse(res.data)
- if(_res.code == 1){
- this.currentImgData.push(_res.data.smallUrl)
- this.form.shopImg.push(_res.data.shortUrl)
- }
- },
- init() {
- },
- confirmFn() {
- let that = this
- if (this.$util.isEmpty(this.form.shopImg)) {
- this.$msg("请上传图片");
- return false;
- }
- this.form.cover = this.form.shopImg[0]
- that.$util.confirmModal({content:'确认添加?提交后不可修改'},() => {
- uni.showLoading({mask:true})
- let form = JSON.parse(JSON.stringify(this.form));
- addGoodsData({...form,itemList:JSON.stringify(product) }).then(res => {
- uni.hideLoading()
- this.$msg("添加成功")
- setTimeout(function(){
- uni.navigateBack({})
- },1500)
- })
- })
- },
- commitForm(e) {
- this.confirmFn()
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .app-content {
- min-height: calc(100vh - 100upx);
- padding-bottom: 100upx;
- }
- .module-com {
- margin-bottom: 20upx;
- background-color: #fff;
- color: $fontColor2;
- .module-tit {
- padding: 20upx 30upx;
- font-size: 28upx;
- }
- .module-det {
- padding: 0 30upx;
- }
- }
- .category-wrap {
- align-items: flex-start;
- padding-bottom: 0 !important;
- .tui-input {
- @include disFlex(center, flex-start);
- flex-wrap: wrap;
- .admin-button-com {
- margin-right: 20upx;
- margin-bottom: 20upx;
- position: relative;
- z-index: 9999;
- }
- }
- }
- .summary-wrap {
- .goods-summary {
- height: 200upx;
- }
- }
- .app-footer {
- justify-content: space-evenly;
- z-index: 9999;
- .admin-button-com {
- width: 46%;
- padding-top:30upx;
- padding-bottom:30upx;
- }
- }
- .commodity-view {
- display: flex;
- flex-direction: column;
- .commodity-list {
- padding: 25upx;
- .commodity-item {
- display: flex;
- margin-bottom: 20upx;
- .item-icon {
- flex-shrink: 0;
- width: 120upx;
- height: 120upx;
- }
- .item-info {
- display: flex;
- flex-direction: column;
- justify-content: center;
- flex: 1;
- margin-left: 20upx;
- .info-line {
- margin-bottom: 20upx;
- display: flex;
- justify-content: space-between;
- align-items: flex-end;
- .item-name {
- color: black;
- font-size: 30upx;
- font-weight: 700;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- width:360upx;
- }
- .item-price {
- padding-right:30upx;
- color: #333;
- .price {
- font-size: 28upx;
- }
- }
- .item-type {
- color: #999;
- font-size: 24upx;
- }
- .item-count {
- color: #666;
- font-size: 24upx;
- }
- }
- }
- }
- }
- .summary-bar {
- padding: 0 20upx;
- height: 90upx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- border-top: 1px solid #eeeeee;
- .operate-view {
- display: flex;
- align-items: center;
- color: #3385ff;
- font-size: 26upx;
- .iconfont {
- margin-right: 20upx;
- font-size: 40upx;
- }
- }
- .describe-view {
- display: flex;
- align-items: center;
- color: #333;
- font-size: 24upx;
- .price {
- font-weight: bold;
- font-size: 30upx;
- }
- }
- }
- }
- .infoAEdit {
- display: flex;
- justify-content: space-between;
- height: 60upx;
- line-height: 80upx;
- font-size: 28;
- font-weight: 700;
- color: #666;
- padding: 0 20upx;
- .iconfont {
- margin-right: 15upx;
- font-size: 30upx;
- }
- & > .editFlr {
- position: relative;
- color: #1890f3;
- font-size: 26upx;
- &:after {
- content: "";
- position: absolute;
- left: 0;
- top: 0;
- }
- }
- }
- </style>
|