| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728 |
- <template>
- <view class="mainBox">
- <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="新增拣货" @clickLeft="back">
- <template slot="float"></template>
- </uni-nav-bar>
- <u-form class="baseForm" labelPosition="left" :model="formData" ref="formRef" labelWidth="220"
- labelAlign="right">
- <u-form-item label="拣货编码" prop="code" borderBottom>
- <u-input disableColor="#ffffff" v-model="formData.code" placeholder="请选择" disabled type="text" />
- </u-form-item>
- <u-form-item class="required-form" label="拣货名称" prop="name" borderBottom>
- <u-input disableColor="#ffffff" v-model="formData.name" placeholder="请选择" type="text" />
- </u-form-item>
- <u-form-item class="required-form" label="关联领料单" prop="documentSource" borderBottom>
- <u-input type="text" placeholder="请选择" v-model="formData.sourceBizNo" @click.native="goToRequisition" />
- </u-form-item>
- </u-form>
- <view class="tabs-container">
- <view class="tabs">
- <view class="tab-item" :class="{ active: activeName === 1 }" @click="activeName = 1">领料产品清单</view>
- <view class="tab-item" :class="{ active: activeName === 2 }">
- <text @click="activeName = 2" class="label">拣货清单</text>
- <u-icon name="scan" size="50" @click="goScanCode"></u-icon>
- </view>
- </view>
- </view>
- <view class="tableBox" v-if="activeName == 1">
- <u-list v-if="productList.length > 0" class="scrollList">
- <u-list-item v-for="(item, index) in productList" :key="index">
- <view class="listBox">
- <view class="listBox-con">
- <view class="listBox-top">
- <view class="listBox-name">
- {{ item.categoryName }}
- </view>
- <view class="listBox-code">
- {{ item.categoryCode }}
- </view>
- </view>
- <view class="listBox-bottom">
- <view>批次号:{{ item.batchNo }}</view>
- <view>包装数量:{{ item.packingQuantity }}</view>
- <view>包装单位:{{ item.packingUnit }}</view>
- <view>计量数量:{{ item.measureQuantity }}</view>
- <view>计量单位:{{ item.measuringUnit }}</view>
- <view>重量:{{ item.weight }}</view>
- <view>重量单位:{{ item.weightUnit }}</view>
- <view class="w100">仓库:{{ item.warehouseName }}</view>
- </view>
- </view>
- </view>
- </u-list-item>
- </u-list>
- <view v-else class="no_data">暂无数据</view>
- </view>
- <view class="tableBox" v-else>
- <u-list v-if="tableList.length > 0" class="scrollList">
- <u-list-item v-for="(item, index) in tableList" :key="index">
- <view class="listBox">
- <view class="listBox-con">
- <view class="listBox-top">
- <view class="listBox-name">
- {{ item.categoryName }}
- </view>
- <view class="listBox-code">
- {{ item.categoryCode }}
- </view>
- </view>
- <view class="listBox-bottom">
- <view>批次号:{{ item.batchNo }}</view>
- <view>包装数量:{{ item.packingQuantity }}</view>
- <view>包装单位:{{ item.packingUnit }}</view>
- <view>计量数量:{{ item.measureQuantity }}</view>
- <view>计量单位:{{ item.measuringUnit }}</view>
- <view>重量:{{ item.weight }}</view>
- <view>重量单位:{{ item.weightUnit }}</view>
- <view class="w100">仓库:{{ item.warehouseName }}</view>
- </view>
- </view>
- </view>
- </u-list-item>
- </u-list>
- <view v-else class="no_data">暂无数据</view>
- </view>
- <view class="footBox">
- <view class="reg" @click="submit">
- <uni-icons custom-prefix="iconfont" size="20" color="#fff"></uni-icons>
- 提交
- </view>
- </view>
- </view>
- </template>
- <script>
- // import ScanCode from '@/components/ScanCode.vue'
- import {
- savePickgoods,
- getCode
- } from '@/api/warehouseManagement'
- export default {
- data() {
- return {
- activeName: 1,
- formData: {
- type: 1, // 入库
- bizType: '1', // 入库场景
- storageTime: '', // 入库时间
- extInfo: {}, // 扩展信息
- sourceBizNo: '', // 来源单据编号
- fromUser: '', // 送货人
- remark: '' // 备注
- },
- productList: [],
- tableList: []
- }
- },
- beforeDestroy() {
- uni.$off('setSelectList')
- uni.$off('requisitionSelect')
- },
- onLoad() {
- this.getCode()
- const userInfo = uni.getStorageSync('userInfo')
- this.formData.createUserName = userInfo.name
- uni.$on('setSelectList', async data => {
- if (data?.length) {
- console.log('setSelectList--data------------', data)
- this.tableList = this.tableList.concat(data)
- setTimeout(() => {
- this.detailOpen = !this.detailOpen
- this.$refs.collapse && this.$refs.collapse.resize()
- }, 0)
- }
- })
- uni.$on('requisitionSelectC', async (data, query) => {
- console.log(data)
- console.log(query)
- this.formData.sourceBizNo = query.sourceBizNo
- this.productList = data
- setTimeout(() => {
- this.detailOpen = !this.detailOpen
- this.$refs.collapse && this.$refs.collapse.resize()
- }, 0)
- })
- // 明细信息填写
- uni.$on('batchNumBack', productList => {
- if (productList?.length) {
- this.productList = productList
- }
- })
- },
- mounted() {
- // this.getAddDetails();
- },
- methods: {
- goScanCode() {
- uni.navigateTo({
- url: '/pages/warehouse/components/scanCodeList'
- })
- },
- async getCode() {
- const code = await getCode('transfer_no')
- this.formData.code = code
- this.$forceUpdate()
- },
- goToRequisition() {
- uni.navigateTo({
- url: '/pages/warehouse/components/requisitionList?type=' + 2
- })
- },
- async submit() {
- if (!this.formData.name) {
- uni.showToast({
- title: '请输入拣货名称',
- icon: 'none'
- })
- return
- }
- if (!this.formData.sourceBizNo) {
- uni.showToast({
- title: '请选择关联领料单',
- icon: 'none'
- })
- return
- }
- if (this.tableList.length <= 0) {
- uni.showToast({
- title: '请扫码录入明细信息',
- icon: 'none'
- })
- return
- }
- if (this.tableList.length !== this.productList.length) {
- uni.showToast({
- title: '请检查拣货清单',
- icon: 'none'
- })
- return
- } else {
- for (let i = 0; i < this.productList.length; i++) {
- let obj = this.tableList.find(item => item.categoryCode == this.productList[i].categoryCode)
- if (!!obj) {
- if (this.productList[i].packingQuantity != obj.packingQuantity || this.productList[i]
- .packingUnit != obj.packingUnit) {
- uni.showToast({
- title: '请检查拣货清单',
- icon: 'none'
- })
- return
- }
- } else {
- uni.showToast({
- title: '请检查拣货清单',
- icon: 'none'
- })
- return
- }
- }
- }
- uni.showLoading({
- title: '保存中...'
- })
- let params = {
- code: this.formData.code,
- name: this.formData.name,
- sourceNo: this.formData.sourceBizNo,
- warehouseId: this.tableList[0].warehouseId,
- warehouseName: this.tableList[0].warehouseName,
- status: 2, // 出库
- info: this.tableList
- }
- savePickgoods(params)
- .then(res => {
- uni.hideLoading()
- uni.showToast({
- icon: 'none',
- title: '提交成功',
- duration: 2000
- })
- })
- .catch(() => {
- uni.hideLoading()
- uni.showToast({
- icon: 'none',
- title: '提交失败',
- duration: 2000
- })
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .mainBox {
- height: 100vh;
- display: flex;
- flex-direction: column;
- /deep/.required-form .u-form-item__body__left__content__label::before {
- content: '*';
- color: red;
- }
- }
- .required-form-text {
- /deep/ .u-form-item__body__right {
- overflow: hidden;
- .u-form-item__body__right__content {
- width: 100%;
- display: inline-block !important;
- width: 100%;
- }
- }
- }
- .tabs-container {
- height: 80rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .tabs {
- display: flex;
- width: 100vw;
- height: 80rpx;
- background-color: #fff;
- display: flex;
- justify-content: flex-start;
- align-items: flex-end;
- margin: 20rpx 0;
- padding: 0 10rpx;
- box-sizing: border-box;
- .tab-item {
- flex: 1;
- display: flex;
- justify-content: center;
- align-items: center;
- padding: 10rpx 0;
- box-sizing: border-box;
- height: 72rpx;
- .label {
- margin-right: 10rpx;
- }
- &.active {
- background: linear-gradient(180deg, rgba(75, 121, 2, 1) 0%, rgba(255, 255, 255, 1) 12%);
- border-right: 1rpx solid #ccc;
- border-left: 1rpx solid #ccc;
- border-bottom: 1rpx solid #ccc;
- border-radius: 10rpx;
- }
- }
- }
- .picList {
- display: flex;
- align-items: center;
- justify-items: flex-start;
- flex-wrap: wrap;
- }
- /deep/.baseForm {
- .u-form-item__body {
- padding: 4px !important;
- }
- .assetType_box {
- padding: 12rpx 18rpx;
- width: 100%;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- }
- /deep/.picList .u-image {
- margin-right: 10rpx;
- margin-bottom: 10rpx;
- }
- /deep/.cLine .u-line:nth-child(1) {
- border-bottom: none !important;
- }
- .detail-box {
- position: relative;
- display: flex;
- justify-content: space-between;
- align-items: center;
- /deep/uni-button {
- margin: 0 !important;
- width: 180rpx;
- }
- .selectEnterType {
- margin-left: 10rpx !important;
- }
- }
- .footBox {
- height: 80rpx;
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- view {
- width: 100%;
- height: 100%;
- text-align: center;
- color: #fff;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .reg {
- background: $u-success-dark;
- }
- .add {
- background: $uni-color-primary;
- }
- .uni-icons {
- margin-right: 8rpx !important;
- }
- }
- .tableBox {
- flex: 1;
- overflow: hidden;
- display: flex;
- flex-direction: column;
- .scrollList {
- flex: 1;
- height: 100% !important;
- .listBox {
- display: flex;
- padding: 20rpx;
- border-bottom: 2rpx solid #e5e5e5;
- .listBox-con {
- width: 100%;
- align-items: center;
- padding: 0 18rpx 0 0;
- .listBox-top {
- width: 100%;
- display: flex;
- justify-content: space-between;
- padding-bottom: 10rpx;
- .listBox-name,
- .listBox-code {
- display: inline-block;
- font-size: $uni-font-size-sm;
- font-weight: bold;
- }
- }
- .listBox-bottom {
- width: 100%;
- display: flex;
- justify-content: space-between;
- font-size: $uni-font-size-sm;
- flex-wrap: wrap;
- >view {
- width: 50%;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- line-height: 24px;
- }
- .input_view {
- display: flex;
- align-items: center;
- justify-content: center;
- .u-input {
- height: 36rpx;
- padding: 0 !important;
- margin-right: 10rpx;
- border: 1px solid #ddd;
- }
- }
- .w100 {
- width: 100%;
- }
- }
- }
- }
- }
- .no_data {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .list {
- padding: 20rpx 10rpx;
- border-bottom: 1px #f2f2f2 solid;
- position: relative;
- &.code {
- .label {
- width: 120rpx !important;
- }
- }
- .listTit {
- width: 100%;
- display: flex;
- justify-content: space-between;
- align-items: center;
- /deep/uni-button {
- margin-right: 20rpx;
- width: 100rpx;
- &.assets {
- width: 180rpx;
- }
- }
- .name {
- width: 50%;
- margin-left: 10px;
- overflow: hidden;
- white-space: nowrap;
- -o-text-overflow: ellipsis;
- text-overflow: ellipsis;
- font-size: 30rpx;
- }
- .btn {
- display: flex;
- justify-content: flex-end;
- }
- .weight {
- width: 30%;
- font-size: 30rpx;
- margin-left: auto;
- margin-right: 60rpx;
- position: relative;
- display: flex;
- input {
- margin-right: 10rpx;
- border: 1px solid black;
- width: 40%;
- height: 20rpx;
- }
- }
- .weight::after {
- position: absolute;
- right: -30rpx;
- top: 50%;
- content: '';
- background: #eee;
- width: 1px;
- height: 28rpx;
- margin-top: -14rpx;
- }
- }
- .z_list {
- max-height: 500rpx;
- .material {
- margin-top: 10rpx;
- .left {
- width: 40rpx;
- }
- .zdy_check {
- width: 30rpx;
- height: 30rpx;
- border: 2rpx solid #c8c9cc;
- border-radius: 4rpx;
- }
- .check_active {
- background: $theme-color;
- border: 2rpx solid $theme-color;
- /deep/ .u-icon__icon {
- color: #fff !important;
- }
- }
- .content_table {
- width: 670rpx;
- border: 2rpx solid $border-color;
- .item {
- display: flex;
- border-bottom: 2rpx solid $border-color;
- .lable {
- width: 200rpx;
- text-align: center;
- background-color: #f7f9fa;
- font-size: 26rpx;
- border-right: 2rpx solid $border-color;
- flex-shrink: 0;
- }
- .ww80 {
- width: 80rpx;
- }
- .content {
- width: 500rpx;
- min-height: 64rpx;
- font-size: 28rpx;
- line-height: 28rpx;
- font-style: normal;
- font-weight: 400;
- padding: 18rpx 8rpx;
- box-sizing: border-box;
- word-wrap: break-word;
- flex-grow: 1 !important;
- }
- .input_box {
- padding: 0 !important;
- }
- .content_num {
- display: flex;
- align-items: center;
- padding: 0 4rpx;
- /deep/ .uni-input-input {
- width: 200rpx;
- border: 2rpx solid #f0f8f2;
- background: #f0f8f2;
- color: $theme-color;
- }
- .unit {
- padding: 0 4rpx;
- font-size: 24rpx;
- color: #404446;
- }
- }
- .ww400 {
- /deep/ .uni-input-input {
- width: 400rpx;
- }
- }
- .pd4 {
- padding: 4rpx 8rpx;
- }
- &:last-child {
- border-bottom: none;
- }
- }
- .ww55 {
- width: 55%;
- }
- .ww45 {
- width: 45%;
- }
- .ww50 {
- width: 50%;
- }
- .ww30 {
- width: 30%;
- }
- .ww70 {
- width: 70%;
- }
- .ww80 {
- width: 80%;
- }
- .ww20 {
- width: 20%;
- }
- .check {
- width: 30rpx;
- height: 30rpx;
- }
- .tag_box {
- padding: 2rpx 10rpx;
- margin-right: 12rpx;
- background: #e6a23c;
- font-size: 22rpx;
- color: #fff;
- border-radius: 4rpx;
- }
- }
- }
- }
- .more {
- position: absolute;
- bottom: 26rpx;
- right: 30rpx;
- font-size: 28rpx;
- color: #666;
- }
- }
- }
- .selectTime {
- display: flex;
- justify-content: flex-end;
- margin-bottom: 10rpx;
- .timeBox {
- display: flex;
- width: 500rpx;
- .firstBtn {
- margin-right: 10rpx;
- }
- }
- }
- .textBox {
- border: 1px #f2f2f2 solid;
- height: 160px;
- display: block;
- width: auto !important;
- }
- .saveBtn {
- width: 50%;
- margin: 40rpx auto;
- }
- .top-css {
- border-bottom: 1px solid rgb(207, 204, 204);
- }
- </style>
|