123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432 |
- <template>
- <view class="checkSubmit">
- <view class="commons-title">
- 面料信息
- </view>
- <view class="submit-warp">
- <view class="form-text">
- 日期
- </view>
- <view class="form-box">
- <view>
- <view class="" style="text-align: left;display: flex;justify-content: space-between;">
- <picker mode="date" :value="correctDate" @change="bindDateChange" style="width:100%">
- <view class="uni-input">{{correctDate || '请选择时间'}}</view>
- </picker>
- <uni-icons type="forward" size="20"></uni-icons>
- </view>
- </view>
- </view>
- </view>
- <view class="submit-warp" style="margin-top:40rpx">
- <view class="form-text">
- 喷印人员
- </view>
- <view class="form-box">
- <view>
- <view class="" style="text-align: left;display: flex;justify-content: space-between;">
- <picker :value="correctUser" :range="selectOneList" @change="printingWorkersSelect" range-key="realName" style="width:100%">
- <view class="uni-input">{{printingWorkersName || '请选择人员'}}</view>
- </picker>
- <uni-icons type="forward" size="20"></uni-icons>
- </view>
- </view>
- </view>
- </view>
- <view class="submit-warp" style="margin-top:40rpx">
- <view class="form-text">
- 面料
- </view>
- <view class="form-box">
- <view>
- <view class="" style="text-align: left;display: flex;justify-content: space-between;">
- <view class="" style="color:#999;width:90%" @click="openSelectQd('mianliao')">
- {{formData.materialName || '请选择面料 '}}
- </view>
- <uni-icons @click="openSelectQd(index)" type="forward" size="20"></uni-icons>
- </view>
- </view>
- </view>
- </view>
- <!-- <view class="submit-warp" style="margin-top:40rpx">
- <view class="form-text">
- 供应商
- </view>
- <view class="form-box">
- <view>
- <view class="" style="text-align: left;display: flex;justify-content: space-between;">
- <view class="" style="color:#999;width:90%" @click="openSelectQd('gongyingshang')">
- {{formData.supplierName || '请选择供应商 '}}
- </view>
- <uni-icons @click="openSelectQd(index)" type="forward" size="20"></uni-icons>
- </view>
- </view>
- </view>
- </view> -->
- <view class="submit-warp" style="margin-top:40rpx">
- <view class="form-text">
- 修正面积
- </view>
- <view class="form-box">
- <view style="border:1rpx solid #dcdcdc;">
- <input v-model="correctArea" type="number">
- </view>
- </view>
- </view>
- <view class="commons-title">
- 修正原因
- </view>
- <view class="wenti-list">
- <view class="list-box" :class="i.active ? 'active' : 'active'" v-for="(i,index) in wentiList" :key="i.type"
- >
- {{i.name}}
- </view>
- </view>
- <view class="" style="margin: 0 20rpx 20rpx;border:1px solid #dcdcdc;">
- <textarea style="width:100%;padding:10rpx 20rpx" v-model="formData.remark" placeholder="备注信息" />
- </view>
- <view class="submit-btn-warp">
- <button @click="checkSubmit(2)" style="background:#EF0000;color:#fff;margin-bottom: 30rpx;">取消</button>
- <button @click="checkSubmit(1)" style="background:#1A3AF0; color:#fff;margin-bottom: 30rpx;">提交</button>
- </view>
- <uni-popup ref="popup2" type="top">
- <view class="search-box">
- <uni-search-bar @confirm="selectList" v-model="req.search" @cancel="reload">
- </uni-search-bar>
- <ul>
- <li @click="selectMaterialList(i)" v-for="i in range2" :key="i.id">
- {{i.name}}
- </li>
- </ul>
- </view>
- </uni-popup>
- <uni-popup ref="popup" type="top">
- <view class="search-box">
- <uni-search-bar @confirm="selectList" v-model="req.search" @cancel="reload">
- </uni-search-bar>
- <ul>
- <li @click="selectMaterialList(i)" v-for="i in range" :key="i.id">
- {{i.name}}
- </li>
- </ul>
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
- import {
- getInfo
- } from "@/util/api.js";
- import Vue from 'vue'
- // import htzImageUpload from '@/components/htz-image-upload/htz-image-upload.vue'
- import {
- dateFormat,
- getTime
- } from '../../util/uitl.js'
- export default {
- components: {
- // htzImageUpload,
- },
- data() {
- return {
- correctArea:null,
- showSelectOne:null,
- correctDate: null,
- wentiList: [{
- type: 1,
- name: "布头布尾",
- active: false
- },
-
- ],
- value: 0,
- range: [],
- range2: [],
- formData: {
- supplierId: null,
- materialId: null,
- problemType: '',
- remark: null,
- attr: [],
- supplierName: null,
- },
- imgs: [],
- option: null,
- imgUrl: null,
- checkListData: [],
- optionCopy: null,
- materialIndex: null,
- req: {
- pageNum: 1,
- pageSize: 10,
- search: null,
- materialCode: null,
- },
- selectModalType: 'gongyingshang',
- selectOneList:[],
- correctUser:null,
- printingWorkersName:null,
- }
- },
- onLoad(option) {
- const v = this
- v.selectList()
- v.getBackUser()
- },
- methods: {
- printingWorkersSelect(e){
- console.log(e)
-
- this.correctUser = this.selectOneList[e.detail.value].userId
- this.printingWorkersName = this.selectOneList[e.detail.value].realName
-
- },
- getBackUser(){
- this.$post('/stockBack/getBackUser',{}).then(res=>{
- this.selectOneList = res.data.A007.concat(res.data.A008,res.data.A012)
- console.log(this.selectOneList,123123212)
- })
- },
- bindDateChange: function(e) {
- console.log(e)
- this.correctDate = e.detail.value
- },
- selectMaterialList(i) {
- const v = this
- if (v.selectModalType == 'gongyingshang') {
- v.formData.supplierId = i.id
- v.formData.supplierName = i.name
- } else {
- v.formData.materialId = i.id
- v.formData.materialName = i.name
- v.req.materialCode = i.id
- }
- console.log(i)
- this.$refs.popup2.close()
- this.$refs.popup.close()
- },
- openSelectQd(modalType) {
- const v = this
- if (modalType == 'gongyingshang' && v.formData.materialId == null) {
- wx.showToast({
- title: "请先选择面料!",
- icon: "none",
- duration: 2000
- })
- return
- }
- v.selectModalType = modalType
- v.req.search = null
- v.selectList()
- if (modalType == 'gongyingshang') {
- this.$refs.popup2.open('top')
- } else {
- this.$refs.popup.open('top')
- }
- },
- bindPickerChange(e) {
- console.log(e)
- const v = this
- v.formData.supplierName = v.range[e.detail.value].bankAccoutName
- v.formData.supplierId = v.range[e.detail.value].id
- },
- selectList() {
- const v = this
- if (v.selectModalType == 'gongyingshang') {
- v.$post('/supplier/selectList', v.req).then(res => {
- console.log(res)
- this.range2 = res.data
- })
- } else {
- v.$post('/material/selectList', v.req).then(res => {
- console.log(res)
- this.range = res.data
- })
- }
- },
- wentiSelect(item, index) {
- this.wentiList[index].active = !this.wentiList[index].active
- },
- checkSubmit(_type) {
- const v = this
- if (_type == 2) {
- wx.reLaunch({
- url: '/pages/home'
- })
- }
- if (!this.correctDate) {
- uni.showToast({
- title: '请选择喷印日期!',
- icon:"none"
- })
- return
- }
- if (!this.correctUser) {
- uni.showToast({
- title: '请选择喷印人员!',
- icon:"none"
- })
- return
- }
- if (!v.formData.materialId) {
- uni.showToast({
- title: '请选择面料!',
- icon:"none"
- })
- return
- }
-
- if (!this.correctArea) {
- uni.showToast({
- title: '请输入修正面积!',
- icon:"none"
- })
- return
- }
-
- v.formData.problemType = v.formData.problemType.slice(0, v.formData.problemType.length - 1)
- uni.showLoading({title: '加载中',mask:true});
-
- v.$post('/stockCorrect/add', {
- correctDate: this.correctDate + ' 00:00:00',
- correctUser: this.correctUser,
- materialId: v.formData.materialId,
- supplierId: v.formData.supplierId,
- correctArea: this.correctArea,
- correctReason: v.formData.problemType,
- remark: this.formData.remark,
- }).then(res => {
- uni.hideLoading()
- if (res.code == 200) {
- uni.showToast({
- title: '提交成功,跳转中!'
- })
- setTimeout(() => {
- wx.reLaunch({
- url: '/pages/home'
- })
- }, 1000)
- }
- })
- },
- select(e) {
- console.log(e)
- const v = this
- v.$post('/wx/common/uploadFile', {
- file: e.tempFilePaths[0]
- }).then(res => {
- })
- },
- },
- }
- </script>
- <style lang="less" scoped>
- .search-box {
- background-color: #fff;
- ul {
- li {
- padding: 25rpx 30rpx;
- border-bottom: 1rpx solid #dcdcdc;
- }
- }
- }
- .submit-btn-warp {
- display: flex;
- justify-content: space-between;
- button {
- width: 47%;
- }
- }
- .wenti-list {
- overflow: hidden;
- .list-box {
- width: 28%;
- margin: 0 2% 20rpx;
- float: left;
- height: 60rpx;
- line-height: 60rpx;
- text-align: center;
- border: 1px solid #DDDCDC;
- border-radius: 10rpx;
- }
- .list-box.active {
- border: 1px solid #1A3AF0;
- background-color: #1A3AF0;
- color: #fff;
- }
- }
- .submit-warp {
- display: flex;
- .form-text {
- width: 20%;
- text-align: center;
- }
- .form-box {
- width: 80%;
- padding: 0 20rpx;
- }
- }
- .imglist {
- display: flex;
- flex-wrap: wrap;
- }
- .imglist .item {
- width: 150rpx;
- height: 150rpx;
- margin-right: 22rpx;
- margin-bottom: 10rpx;
- position: relative;
- }
- .imglist .last-item {
- width: 150rpx;
- height: 150rpx;
- text-align: center;
- line-height: 146rpx;
- border: 2rpx dashed #8B97A9;
- box-sizing: border-box;
- }
- .imglist .item image {
- width: 100%;
- height: 100%;
- }
- .imglist .item .delete {
- width: 30rpx;
- height: 30rpx;
- position: absolute;
- top: -25rpx;
- right: -12rpx;
- font-size: 40rpx;
- font-weight: bold;
- }
- </style>
|