| | |
| | | createMain: (params = {}) => vm.$u.post('/mes/weighingVerification/createMain', params), |
| | | // 核磅单号 |
| | | getWeighingOrder: (params = {}) => vm.$u.get('/mes/weighingVerification/pageVerificationMain', params), |
| | | // 核磅详情 |
| | | createDetail: (params = {}) => vm.$u.post('/mes/weighingVerification/createDetail', params), |
| | | |
| | | }, |
| | | // 取消领料 |
| | | cancelMaterialRequisition: { |
| | |
| | | // url: '/pages/wareHouse/inventory/index', |
| | | // icon: 'seven' |
| | | // }, |
| | | // { |
| | | // name: '核磅录入', |
| | | // url: '/pages/wareHouse/nuclearScale/index', |
| | | // icon: 'eight' |
| | | // }, |
| | | { |
| | | name: '核磅录入', |
| | | url: '/pages/wareHouse/nuclearScale/index', |
| | | icon: 'eight' |
| | | }, |
| | | // { |
| | | // name: '库存件盘点', |
| | | // url: '/pages/wareHouse/InventoryCountStockItems/index', |
| | |
| | | <!-- 核磅录入 --> |
| | | <div class="page"> |
| | | <view class="packing-registration-bg" /> |
| | | <u-navbar title="核磅录入" :background="background" :border-bottom="false" :title-bold="true" title-color="#000" |
| | | back-icon-color="#000" /> |
| | | <u-form :model="form" ref="uForm" :label-width="210" labelAlign="left" :rules="rules" :error-type="['toast']" |
| | | class="uForm"> |
| | | <u-form-item label="产品类型:" :border-bottom="false" prop="productType"> |
| | | <u-radio-group v-model="form.productType" @change="handleProductTypeChange"> |
| | | <u-radio name="1">导体</u-radio> |
| | | <u-radio name="2">铜杆</u-radio> |
| | | <u-radio name="3">导体2.6</u-radio> |
| | | <u-navbar |
| | | title="核磅录入" |
| | | :background="background" |
| | | :border-bottom="false" |
| | | :title-bold="true" |
| | | title-color="#000" |
| | | back-icon-color="#000" |
| | | /> |
| | | <u-form |
| | | :model="form" |
| | | ref="uForm" |
| | | :label-width="235" |
| | | labelAlign="left" |
| | | :rules="rules" |
| | | :error-type="['toast']" |
| | | class="uForm" |
| | | > |
| | | <u-form-item |
| | | label="产品类型:" |
| | | :border-bottom="false" |
| | | prop="productType" |
| | | style="font-size: small" |
| | | > |
| | | <u-radio-group |
| | | v-model="form.productType" |
| | | @change="handleProductTypeChange" |
| | | style="font-size: small" |
| | | > |
| | | <u-radio name="DT01">导体</u-radio> |
| | | <u-radio name="TG01">铜杆</u-radio> |
| | | <u-radio name="DT02">导体2.6</u-radio> |
| | | </u-radio-group> |
| | | </u-form-item> |
| | | <u-form-item label="替换二维码:" :border-bottom="false" prop="replace"> |
| | | <u-radio-group v-model="form.replace"> |
| | | <u-form-item |
| | | label="替换二维码:" |
| | | :border-bottom="false" |
| | | prop="replace" |
| | | style="font-size: small" |
| | | > |
| | | <u-radio-group v-model="form.replace" style="font-size: small"> |
| | | <u-radio name="1">是</u-radio> |
| | | <u-radio name="0">否</u-radio> |
| | | </u-radio-group> |
| | | </u-form-item> |
| | | <u-form-item label="车牌号:" :border-bottom="false" prop="licensePlate"> |
| | | <u-input v-model="form.licensePlate" type="select" placeholder="请输入车牌号" @click="lpn" /> |
| | | <u-form-item |
| | | label="车牌号:" |
| | | :border-bottom="false" |
| | | prop="licensePlate" |
| | | style="font-size: small" |
| | | > |
| | | <u-input |
| | | v-model="form.licensePlate" |
| | | type="select" |
| | | placeholder="请输入车牌号" |
| | | @click="lpn" |
| | | /> |
| | | </u-form-item> |
| | | <u-form-item label="客户名称1:" :border-bottom="false" prop="customerName1"> |
| | | <picker class="item-one item-two" style="width: 100%; text-align: right" |
| | | @change="selClientChange($event, selClientList, 'customerName1')" :value="selClientIndex1" |
| | | :range="selClientList" range-key="label"> |
| | | <u-form-item |
| | | label="客户名称1:" |
| | | :border-bottom="false" |
| | | prop="customerName1" |
| | | style="font-size: small" |
| | | > |
| | | <picker |
| | | class="item-one item-two" |
| | | style="width: 100%; text-align: right" |
| | | @change="selClientChange($event, selClientList, 'customerName1')" |
| | | :value="selClientIndex1" |
| | | :range="selClientList" |
| | | range-key="label" |
| | | > |
| | | <view> |
| | | <text :style="{ |
| | | <text |
| | | :style="{ |
| | | color: selClientIndex1 == null ? '#a5abb4' : '#0c0c0c', |
| | | }">{{ |
| | | }" |
| | | >{{ |
| | | selClientIndex1 == null |
| | | ? "请选择" |
| | | : selClientList[selClientIndex1].label |
| | | }}</text> |
| | | }}</text |
| | | > |
| | | </view> |
| | | </picker> |
| | | <u-icon v-if="selClientIndex1 == null" name="arrow-right" color="#687792" size="28"></u-icon> |
| | | <u-icon |
| | | v-if="selClientIndex1 == null" |
| | | name="arrow-right" |
| | | color="#687792" |
| | | size="28" |
| | | ></u-icon> |
| | | </u-form-item> |
| | | <u-form-item label="发货通知单号1:" :border-bottom="false" prop="shippingNoticeNo1"> |
| | | <u-form-item |
| | | label="发货通知单号1:" |
| | | :border-bottom="false" |
| | | prop="shippingNoticeNo1" |
| | | style="font-size: small" |
| | | :label-width="245" |
| | | > |
| | | <u-input v-model="form.shippingNoticeNo1" placeholder="" disabled /> |
| | | </u-form-item> |
| | | <u-form-item label="客户名称2:" :border-bottom="false" prop="customerName2"> |
| | | <picker class="item-one item-two" style="width: 100%; text-align: right" |
| | | @change="selClientChange($event, selClientList, 'customerName2')" :value="selClientIndex2" |
| | | :range="selClientList" range-key="label"> |
| | | <u-form-item |
| | | label="客户名称2:" |
| | | :border-bottom="false" |
| | | prop="customerName2" |
| | | style="font-size: small" |
| | | > |
| | | <picker |
| | | class="item-one item-two" |
| | | style="width: 100%; text-align: right" |
| | | @change="selClientChange($event, selClientList, 'customerName2')" |
| | | :value="selClientIndex2" |
| | | :range="selClientList" |
| | | range-key="label" |
| | | > |
| | | <view> |
| | | <text :style="{ |
| | | <text |
| | | :style="{ |
| | | color: selClientIndex2 == null ? '#a5abb4' : '#0c0c0c', |
| | | }">{{ |
| | | }" |
| | | >{{ |
| | | selClientIndex2 == null |
| | | ? "请选择" |
| | | : selClientList[selClientIndex2].label |
| | | }}</text> |
| | | }}</text |
| | | > |
| | | </view> |
| | | </picker> |
| | | <u-icon v-if="selClientIndex2 == null" name="arrow-right" color="#687792" size="28"></u-icon> |
| | | <u-icon |
| | | v-if="selClientIndex2 == null" |
| | | name="arrow-right" |
| | | color="#687792" |
| | | size="28" |
| | | ></u-icon> |
| | | </u-form-item> |
| | | <u-form-item label="发货通知单号2:" :border-bottom="false" prop="shippingNoticeNo2"> |
| | | <u-form-item |
| | | label="发货通知单号2:" |
| | | :border-bottom="false" |
| | | prop="shippingNoticeNo2" |
| | | style="font-size: small" |
| | | :label-width="245" |
| | | > |
| | | <u-input v-model="form.shippingNoticeNo2" placeholder="" disabled /> |
| | | </u-form-item> |
| | | <u-form-item label="生产车间:" :border-bottom="false" prop="workshop"> |
| | | <picker class="item-one item-two" style="width: 100%; text-align: right" |
| | | @change="workshopChange($event, workshopList)" :value="workshopIndex" :range="workshopList" |
| | | range-key="label" :disabled="!form.productType"> |
| | | <u-form-item |
| | | label="生产车间:" |
| | | :border-bottom="false" |
| | | prop="workshop" |
| | | style="font-size: small" |
| | | > |
| | | <picker |
| | | class="item-one item-two" |
| | | style="width: 100%; text-align: right" |
| | | @change="workshopChange($event, workshopList)" |
| | | :value="workshopIndex" |
| | | :range="workshopList" |
| | | range-key="label" |
| | | :disabled="!form.productType" |
| | | > |
| | | <view> |
| | | <text :style="{ color: workshopIndex == null ? '#a5abb4' : '#0c0c0c' }">{{ |
| | | <text |
| | | :style="{ color: workshopIndex == null ? '#a5abb4' : '#0c0c0c' }" |
| | | >{{ |
| | | workshopIndex == null |
| | | ? "请选择" |
| | | : workshopList[workshopIndex].label |
| | | }}</text> |
| | | }}</text |
| | | > |
| | | </view> |
| | | </picker> |
| | | <u-icon v-if="workshopIndex == null" name="arrow-right" color="#687792" size="28"></u-icon> |
| | | <u-icon |
| | | v-if="workshopIndex == null" |
| | | name="arrow-right" |
| | | color="#687792" |
| | | size="28" |
| | | ></u-icon> |
| | | </u-form-item> |
| | | <u-form-item label="司磅员:" :border-bottom="false" prop="weighingOperator"> |
| | | <picker class="item-one item-two" style="width: 100%; text-align: right" |
| | | @change="weighmanChange($event, weighmanList)" :value="weighmanIndex" :range="weighmanList" |
| | | range-key="label"> |
| | | <u-form-item |
| | | label="司磅员:" |
| | | :border-bottom="false" |
| | | prop="weighingOperator" |
| | | style="font-size: small" |
| | | > |
| | | <picker |
| | | class="item-one item-two" |
| | | style="width: 100%; text-align: right" |
| | | @change="weighmanChange($event, weighmanList)" |
| | | :value="weighmanIndex" |
| | | :range="weighmanList" |
| | | range-key="label" |
| | | > |
| | | <view> |
| | | <text :style="{ color: weighmanIndex == null ? '#a5abb4' : '#0c0c0c' }">{{ |
| | | <text |
| | | :style="{ color: weighmanIndex == null ? '#a5abb4' : '#0c0c0c' }" |
| | | >{{ |
| | | weighmanIndex == null |
| | | ? "请选择" |
| | | : weighmanList[weighmanIndex].label |
| | | }}</text> |
| | | }}</text |
| | | > |
| | | </view> |
| | | </picker> |
| | | <u-icon v-if="weighmanIndex == null" name="arrow-right" color="#687792" size="28"></u-icon> |
| | | <u-icon |
| | | v-if="weighmanIndex == null" |
| | | name="arrow-right" |
| | | color="#687792" |
| | | size="28" |
| | | ></u-icon> |
| | | </u-form-item> |
| | | <u-form-item label="叉车工:" :border-bottom="false" prop="forkliftOperator"> |
| | | <u-input v-model="form.forkliftOperator" type="select" placeholder="请选择" |
| | | @click="openForkliftDriverList" /> |
| | | <u-form-item |
| | | label="叉车工:" |
| | | :border-bottom="false" |
| | | prop="forkliftOperator" |
| | | style="font-size: small" |
| | | > |
| | | <u-input |
| | | v-model="form.forkliftOperator" |
| | | type="select" |
| | | placeholder="请选择" |
| | | @click="openForkliftDriverList" |
| | | /> |
| | | </u-form-item> |
| | | </u-form> |
| | | <u-button type="primary" class="bottom-button1" @click="submit">创建</u-button> |
| | | <u-button type="primary" class="bottom-button1" @click="submit" |
| | | >创建</u-button |
| | | > |
| | | |
| | | <!--车牌号 --> |
| | | <modalBg ref="modalBg" :confirm="confirm"> |
| | | <u-field v-model="form.licensePlate" label="车牌号:" placeholder="请输入" :border-bottom="false"> |
| | | <u-field |
| | | v-model="form.licensePlate" |
| | | label="车牌号:" |
| | | placeholder="请输入" |
| | | :border-bottom="false" |
| | | > |
| | | </u-field> |
| | | </modalBg> |
| | | <!-- 叉车工 --> |
| | | <u-modal v-model="showModal" title="" :show-cancel-button="true" :show-confirm-button="true" |
| | | @confirm="confirmSelection" @cancel="cancel"> |
| | | <u-modal |
| | | v-model="showModal" |
| | | title="" |
| | | :show-cancel-button="true" |
| | | :show-confirm-button="true" |
| | | @confirm="confirmSelection" |
| | | @cancel="cancel" |
| | | > |
| | | <scroll-view scroll-y="true" style="height: 100%; transform: translateZ(0); -webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;"></scroll-view> |
| | | <view class="popup-content"> |
| | | <view class="popup-header"> |
| | | <checkbox-group @change="checkboxChange"> |
| | | <label class="checkbox-item" v-for="(item, index) in checkboxList" :key="index"> |
| | | <label |
| | | class="checkbox-item" |
| | | v-for="(item, index) in checkboxList" |
| | | :key="index" |
| | | > |
| | | <checkbox :value="item.value" :checked="item.checked" /> |
| | | <text class="label">{{ item.label }}</text> |
| | | </label> |
| | | </checkbox-group> |
| | | </view> |
| | | </view> |
| | | <scroll-view/> |
| | | </u-modal> |
| | | </div> |
| | | </template> |
| | |
| | | show: false, |
| | | num: 1, |
| | | form: { |
| | | replace: '0', |
| | | productType: '', |
| | | licensePlate: '', |
| | | customerName1: '', |
| | | shippingNoticeNo1: '', |
| | | customerName2: '', |
| | | shippingNoticeNo2: '', |
| | | workshop: '', |
| | | weighingOperator: '', |
| | | forkliftOperator: '', |
| | | replace: "0", |
| | | productType: "", |
| | | licensePlate: "", |
| | | customerName1: "", |
| | | shippingNoticeNo1: "", |
| | | customerName2: "", |
| | | shippingNoticeNo2: "", |
| | | workshop: "", |
| | | weighingOperator: "", |
| | | forkliftOperator: "", |
| | | }, |
| | | rules: { |
| | | productType: [{ |
| | | productType: [ |
| | | { |
| | | required: true, |
| | | message: "请选择产品类型", |
| | | trigger: ["change"], |
| | | }, ], |
| | | replace: [{ |
| | | }, |
| | | ], |
| | | replace: [ |
| | | { |
| | | required: true, |
| | | message: "请选择是否替换二维码", |
| | | trigger: ["change", "blur"], |
| | | }, ], |
| | | licensePlate: [{ |
| | | }, |
| | | ], |
| | | licensePlate: [ |
| | | { |
| | | required: true, |
| | | message: "请输入车牌号", |
| | | trigger: ["change", "blur"], |
| | | }, ], |
| | | workshop: [{ |
| | | }, |
| | | ], |
| | | workshop: [ |
| | | { |
| | | required: true, |
| | | message: "请选择生产车间", |
| | | trigger: ["change"], |
| | | }, ], |
| | | weighingOperator: [{ |
| | | }, |
| | | ], |
| | | weighingOperator: [ |
| | | { |
| | | required: true, |
| | | message: "请选择司磅员", |
| | | trigger: ["change"], |
| | | }, ], |
| | | forkliftOperator: [{ |
| | | }, |
| | | ], |
| | | forkliftOperator: [ |
| | | { |
| | | type: "string", |
| | | required: true, |
| | | message: "请至少选择一个叉车工", |
| | | trigger: ["change"], |
| | | }, ], |
| | | }, |
| | | ], |
| | | }, |
| | | // 客户名称 |
| | | selClientList: [], |
| | |
| | | weighmanIndex: null, |
| | | showModal: false, |
| | | selectedItems: [], |
| | | id1: '', |
| | | id2: '', |
| | | isSubmitting: false |
| | | id1: "", |
| | | id2: "", |
| | | isSubmitting: false, |
| | | }; |
| | | }, |
| | | onReady() { |
| | |
| | | onShow() { |
| | | // 重置表单数据 |
| | | this.form = { |
| | | replace: '0', |
| | | productType: '', |
| | | licensePlate: '', |
| | | customerName1: '', |
| | | shippingNoticeNo1: '', |
| | | customerName2: '', |
| | | shippingNoticeNo2: '', |
| | | workshop: '', |
| | | weighingOperator: '', |
| | | forkliftOperator: '', |
| | | replace: "0", |
| | | productType: "", |
| | | licensePlate: "", |
| | | customerName1: "", |
| | | shippingNoticeNo1: "", |
| | | customerName2: "", |
| | | shippingNoticeNo2: "", |
| | | workshop: "", |
| | | weighingOperator: "", |
| | | forkliftOperator: "", |
| | | }; |
| | | this.selClientIndex1 = null; |
| | | this.selClientIndex2 = null; |
| | | this.workshopIndex = null; |
| | | this.weighmanIndex = null; |
| | | this.checkboxList = this.checkboxList.map(item => ({ |
| | | this.checkboxList = this.checkboxList.map((item) => ({ |
| | | ...item, |
| | | checked: false |
| | | checked: false, |
| | | })); |
| | | this.$refs.uForm && this.$refs.uForm.resetValidation(); |
| | | }, |
| | |
| | | * 获取客户列表 |
| | | */ |
| | | fetchClients() { |
| | | this.$u.api.NuclearScaleEntry.selClient().then((res) => { |
| | | console.log('客户名称', res) |
| | | this.$u.api.NuclearScaleEntry.selClient() |
| | | .then((res) => { |
| | | console.log("客户名称", res); |
| | | if (res.code === 0) { |
| | | res.data.forEach((i) => { |
| | | const obj = Object.assign({ |
| | | label: i.customerName, |
| | | value: i.customerName, |
| | | shippingNoticeNo: i.shippingNoticeNo, |
| | | id: i.id |
| | | id: i.id, |
| | | }); |
| | | this.selClientList.push(obj); |
| | | }); |
| | | } else { |
| | | uni.showToast({ |
| | | title: res.msg || '获取客户名称失败', |
| | | icon: 'none' |
| | | title: res.msg || "获取客户名称失败", |
| | | icon: "none", |
| | | }); |
| | | } |
| | | }).catch(err => { |
| | | }) |
| | | .catch((err) => { |
| | | uni.showToast({ |
| | | title: '网络错误,获取客户名称失败', |
| | | icon: 'none' |
| | | title: "网络错误,获取客户名称失败", |
| | | icon: "none", |
| | | }); |
| | | console.error('获取客户名称错误:', err); |
| | | console.error("获取客户名称错误:", err); |
| | | }); |
| | | }, |
| | | |
| | |
| | | * 获取车间列表 |
| | | */ |
| | | fetchWorkshops() { |
| | | this.$u.api.dictData({ |
| | | dictType: 'workshop' |
| | | }).then(res => { |
| | | this.$u.api |
| | | .dictData({ |
| | | dictType: "workshop", |
| | | }) |
| | | .then((res) => { |
| | | if (res.code === 0 && res.data.length > 0) { |
| | | res.data.forEach(i => { |
| | | res.data.forEach((i) => { |
| | | const obj = Object.assign({ |
| | | label: i.label, |
| | | value: i.value, |
| | | }) |
| | | this.workshopList.push(obj) |
| | | }) |
| | | }); |
| | | this.workshopList.push(obj); |
| | | }); |
| | | } else { |
| | | uni.showToast({ |
| | | title: res.msg || '获取车间列表失败', |
| | | icon: 'none' |
| | | title: res.msg || "获取车间列表失败", |
| | | icon: "none", |
| | | }); |
| | | } |
| | | }).catch(err => { |
| | | }) |
| | | .catch((err) => { |
| | | uni.showToast({ |
| | | title: '网络错误,获取车间列表失败', |
| | | icon: 'none' |
| | | title: "网络错误,获取车间列表失败", |
| | | icon: "none", |
| | | }); |
| | | console.error('获取车间列表错误:', err); |
| | | console.error("获取车间列表错误:", err); |
| | | }); |
| | | }, |
| | | |
| | |
| | | * 获取叉车工列表 |
| | | */ |
| | | fetchForkliftOperators() { |
| | | this.$u.api.dictData({ |
| | | dictType: 'forklift' |
| | | }).then(res => { |
| | | this.$u.api |
| | | .dictData({ |
| | | dictType: "forklift", |
| | | }) |
| | | .then((res) => { |
| | | if (res.code === 0 && res.data.length > 0) { |
| | | res.data.forEach(i => { |
| | | res.data.forEach((i) => { |
| | | const obj = Object.assign({ |
| | | label: i.label, |
| | | value: i.label, |
| | | }) |
| | | this.checkboxList.push(obj) |
| | | }) |
| | | }); |
| | | this.checkboxList.push(obj); |
| | | }); |
| | | } else { |
| | | uni.showToast({ |
| | | title: res.msg || '获取叉车工列表失败', |
| | | icon: 'none' |
| | | title: res.msg || "获取叉车工列表失败", |
| | | icon: "none", |
| | | }); |
| | | } |
| | | }).catch(err => { |
| | | }) |
| | | .catch((err) => { |
| | | uni.showToast({ |
| | | title: '网络错误,获取叉车工列表失败', |
| | | icon: 'none' |
| | | title: "网络错误,获取叉车工列表失败", |
| | | icon: "none", |
| | | }); |
| | | console.error('获取叉车工列表错误:', err); |
| | | console.error("获取叉车工列表错误:", err); |
| | | }); |
| | | }, |
| | | |
| | |
| | | * 获取司磅员列表 |
| | | */ |
| | | fetchWeighmen() { |
| | | this.$u.api.dictData({ |
| | | dictType: 'weighing' |
| | | }).then(res => { |
| | | this.$u.api |
| | | .dictData({ |
| | | dictType: "weighing", |
| | | }) |
| | | .then((res) => { |
| | | if (res.code === 0 && res.data.length > 0) { |
| | | res.data.forEach(i => { |
| | | res.data.forEach((i) => { |
| | | const obj = Object.assign({ |
| | | label: i.label, |
| | | value: i.label, |
| | | }) |
| | | this.weighmanList.push(obj) |
| | | }) |
| | | }); |
| | | this.weighmanList.push(obj); |
| | | }); |
| | | } else { |
| | | uni.showToast({ |
| | | title: res.msg || '获取司磅员列表失败', |
| | | icon: 'none' |
| | | title: res.msg || "获取司磅员列表失败", |
| | | icon: "none", |
| | | }); |
| | | } |
| | | }).catch(err => { |
| | | }) |
| | | .catch((err) => { |
| | | uni.showToast({ |
| | | title: '网络错误,获取司磅员列表失败', |
| | | icon: 'none' |
| | | title: "网络错误,获取司磅员列表失败", |
| | | icon: "none", |
| | | }); |
| | | console.error('获取司磅员列表错误:', err); |
| | | console.error("获取司磅员列表错误:", err); |
| | | }); |
| | | }, |
| | | // 复选框变化事件 |
| | |
| | | this.form.forkliftOperator = this.checkboxList |
| | | .filter((item) => item.checked) |
| | | .map((item) => item.label) |
| | | .join(','); |
| | | .join(","); |
| | | }, |
| | | cancel() {}, |
| | | openForkliftDriverList() { |
| | |
| | | // 检查是否选择了相同的客户 |
| | | if (code === "customerName1" && this.selClientIndex2 === selectedIndex) { |
| | | uni.showToast({ |
| | | title: '不能选择相同的客户', |
| | | icon: 'none' |
| | | title: "不能选择相同的客户", |
| | | icon: "none", |
| | | }); |
| | | return; |
| | | } |
| | | if (code === "customerName2" && this.selClientIndex1 === selectedIndex) { |
| | | uni.showToast({ |
| | | title: '不能选择相同的客户', |
| | | icon: 'none' |
| | | title: "不能选择相同的客户", |
| | | icon: "none", |
| | | }); |
| | | return; |
| | | } |
| | |
| | | this.selClientIndex1 = selectedIndex; |
| | | this.form.customerName1 = selectedCustomer.label; |
| | | this.form.shippingNoticeNo1 = selectedCustomer.shippingNoticeNo; |
| | | this.id1 = selectedCustomer.id |
| | | this.id1 = selectedCustomer.id; |
| | | } |
| | | }, |
| | | // 生产车间 |
| | |
| | | const productType = this.form.productType; |
| | | const selectedWorkshop = storage[e.target.value]; |
| | | |
| | | // 检查产品类型是否为铜杆(值为2) |
| | | if (productType === '2') { |
| | | // 检查产品类型是否为铜杆(值为TG01) |
| | | if (productType === "TG01") { |
| | | // 铜杆只能选择铜杆相关车间 |
| | | if (!selectedWorkshop.label.includes('铜杆')) { |
| | | if (!selectedWorkshop.label.includes("铜杆")) { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "铜杆产品只能选择铜杆相关车间", |
| | | showCancel: false |
| | | showCancel: false, |
| | | }); |
| | | return; |
| | | } |
| | | } else { |
| | | // 导体产品不能选择铜杆车间 |
| | | if (selectedWorkshop.label.includes('铜杆')) { |
| | | if (selectedWorkshop.label.includes("铜杆")) { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "导体产品不能选择铜杆车间", |
| | | showCancel: false |
| | | showCancel: false, |
| | | }); |
| | | return; |
| | | } |
| | |
| | | */ |
| | | handleProductTypeChange() { |
| | | this.workshopIndex = null; |
| | | this.form.workshop = ''; |
| | | this.form.workshop = ""; |
| | | }, |
| | | // 提交按钮 |
| | | async submit() { |
| | |
| | | |
| | | try { |
| | | // 统一表单验证 |
| | | if (!await this.validateForm()) return; |
| | | if (!(await this.validateForm())) return; |
| | | |
| | | // 构建提交数据 |
| | | const submitData = this.buildSubmitData().customerList; |
| | | console.log('提交的数据',submitData) |
| | | console.log("提交的数据", submitData); |
| | | this.isSubmitting = true; |
| | | const res = await this.$u.api.NuclearScaleEntry.createMain(submitData); |
| | | |
| | |
| | | uni.navigateBack(); |
| | | } else { |
| | | uni.showToast({ |
| | | title: res.msg || '提交失败:业务处理错误', |
| | | icon: 'none' |
| | | title: res.msg || "提交失败:业务处理错误", |
| | | icon: "none", |
| | | }); |
| | | console.error('业务错误:', res); |
| | | console.error("业务错误:", res); |
| | | } |
| | | } catch (err) { |
| | | if (err.type === 'validation') { |
| | | if (err.type === "validation") { |
| | | uni.showToast({ |
| | | title: err.message, |
| | | icon: 'none' |
| | | icon: "none", |
| | | }); |
| | | } else if (err.message.includes('Network Error')) { |
| | | } else if (err.message.includes("Network Error")) { |
| | | uni.showToast({ |
| | | title: '网络连接错误,请检查网络后重试', |
| | | icon: 'none' |
| | | title: "网络连接错误,请检查网络后重试", |
| | | icon: "none", |
| | | }); |
| | | } else { |
| | | uni.showToast({ |
| | | title: '系统错误,请稍后重试', |
| | | icon: 'none' |
| | | title: "系统错误,请稍后重试", |
| | | icon: "none", |
| | | }); |
| | | } |
| | | console.error('提交表单错误:', err); |
| | | console.error("提交表单错误:", err); |
| | | } finally { |
| | | this.isSubmitting = false; |
| | | } |
| | |
| | | // 统一表单验证 |
| | | async validateForm() { |
| | | // 使用uView表单验证 |
| | | if (!await this.$refs.uForm.validate()) { |
| | | if (!(await this.$refs.uForm.validate())) { |
| | | return false; |
| | | } |
| | | |
| | | // 客户名称验证 |
| | | if (!this.form.customerName1 || !this.form.customerName2) { |
| | | throw { type: 'validation', message: '请先选择客户名称' }; |
| | | throw { type: "validation", message: "请先选择客户名称" }; |
| | | } |
| | | |
| | | return true; |
| | |
| | | const customerList = [1, 2].map(createCustomerItem); |
| | | |
| | | return { |
| | | customerList |
| | | customerList, |
| | | }; |
| | | }, |
| | | }, |
| | |
| | | |
| | | .confirm-btn { |
| | | color: #007aff; |
| | | font-size: 28rpx; |
| | | font-size: small; |
| | | } |
| | | |
| | | /* 复选框样式 */ |
| | |
| | | } |
| | | |
| | | .item-one { |
| | | font-size: 30rpx; |
| | | font-size: small; |
| | | color: #0c0c0c; |
| | | margin-right: 6rpx; |
| | | } |
| | | |
| | | .item-two { |
| | | font-size: 30rpx; |
| | | font-size: small; |
| | | color: #a5abb4; |
| | | margin-right: 6rpx; |
| | | } |
| | |
| | | |
| | | ._label-name { |
| | | margin-left: 11rpx; |
| | | font-size: 26rpx; |
| | | font-size: small; |
| | | font-weight: 500; |
| | | color: #666666; |
| | | } |
| | |
| | | flex: 1.5; |
| | | text-align: right; |
| | | color: #909399; |
| | | font-size: 24rpx; |
| | | font-size: small; |
| | | } |
| | | |
| | | .row-list .s1 { |
| | |
| | | |
| | | .packing-registration-param-item-left { |
| | | .item-one { |
| | | font-size: 30rpx; |
| | | font-size: small; |
| | | color: #666666; |
| | | } |
| | | } |
| | |
| | | justify-content: space-between; |
| | | |
| | | .item-one { |
| | | font-size: 15rpx; |
| | | font-size: small; |
| | | color: #060505; |
| | | margin-right: 6rpx; |
| | | } |
| | | |
| | | .item-two { |
| | | font-size: 15rpx; |
| | | color: #a6b4cc; |
| | | font-size: small; |
| | | color: #171718; |
| | | margin-right: 6rpx; |
| | | } |
| | | |
| | | .item-three { |
| | | font-size: 30rpx; |
| | | font-size: small; |
| | | color: #214ded; |
| | | margin-right: 6rpx; |
| | | } |
| | |
| | | |
| | | .packing-registration-param-item-left { |
| | | .item-one { |
| | | font-size: 30rpx; |
| | | font-size: small; |
| | | color: #666666; |
| | | } |
| | | } |
| | |
| | | justify-content: space-between; |
| | | |
| | | .item-one { |
| | | font-size: 30rpx; |
| | | font-size: small; |
| | | color: #060505; |
| | | margin-right: 6rpx; |
| | | } |
| | | |
| | | .item-two { |
| | | font-size: 30rpx; |
| | | color: #a6b4cc; |
| | | font-size: small; |
| | | color: #0f1010; |
| | | margin-right: 6rpx; |
| | | } |
| | | |
| | | .item-three { |
| | | font-size: 30rpx; |
| | | font-size: small; |
| | | color: #214ded; |
| | | margin-right: 6rpx; |
| | | } |
| | |
| | | <!-- 核磅录入 --> |
| | | <div class="page"> |
| | | <view class="packing-registration-bg" /> |
| | | <u-navbar title="核磅录入" :background="background" :border-bottom="false" :title-bold="true" title-color="#000" |
| | | back-icon-color="#000" /> |
| | | <u-form :model="form" ref="uForm" :label-width="200" :rules="rules" :error-type="['toast']" class="uForm"> |
| | | <u-form-item label="核磅单号" :border-bottom="false" prop="verificationNo"> |
| | | <u-input v-model="form.verificationNo" type="select" placeholder="请选择核磅单号" @click="openList" /> |
| | | <u-navbar |
| | | title="核磅录入" |
| | | :background="background" |
| | | :border-bottom="false" |
| | | :title-bold="true" |
| | | title-color="#000" |
| | | back-icon-color="#000" |
| | | /> |
| | | <u-form |
| | | :model="form" |
| | | ref="uForm" |
| | | :label-width="200" |
| | | :rules="rules" |
| | | :error-type="['toast']" |
| | | class="uForm" |
| | | > |
| | | <u-form-item |
| | | label="核磅单号" |
| | | :border-bottom="false" |
| | | prop="verificationNo" |
| | | style="font-size: small" |
| | | > |
| | | <u-input |
| | | v-model="form.verificationNo" |
| | | type="select" |
| | | placeholder="请选择核磅单号" |
| | | @click="openList" |
| | | /> |
| | | </u-form-item> |
| | | <u-form-item label="产品类型" :border-bottom="false" prop="productType"> |
| | | <u-input v-model="productTypeMap[form.productType] || form.productType" placeholder="" disabled /> |
| | | <u-form-item |
| | | label="产品类型" |
| | | :border-bottom="false" |
| | | prop="productType" |
| | | style="font-size: small" |
| | | > |
| | | <u-input |
| | | v-model="productTypeMap[form.productType] || form.productType" |
| | | placeholder="" |
| | | disabled |
| | | /> |
| | | </u-form-item> |
| | | <u-form-item label="车牌号" :border-bottom="false" prop="licensePlate"> |
| | | <u-form-item |
| | | label="车牌号" |
| | | :border-bottom="false" |
| | | prop="licensePlate" |
| | | style="font-size: small" |
| | | > |
| | | <u-input v-model="form.licensePlate" placeholder="" disabled /> |
| | | </u-form-item> |
| | | <u-form-item label="发货通知单1" :border-bottom="false" prop="shippingNoticeNo1"> |
| | | <u-form-item |
| | | label="发货通知单1" |
| | | :border-bottom="false" |
| | | prop="shippingNoticeNo1" |
| | | style="font-size: small" |
| | | > |
| | | <u-input v-model="form.shippingNoticeNo1" placeholder="" disabled /> |
| | | </u-form-item> |
| | | <u-form-item label="客户名称1" :border-bottom="false" prop="customerName1"> |
| | | <u-form-item |
| | | label="客户名称1" |
| | | :border-bottom="false" |
| | | prop="customerName1" |
| | | style="font-size: small" |
| | | > |
| | | <u-input v-model="form.customerName1" placeholder="" disabled /> |
| | | </u-form-item> |
| | | <u-form-item label="发货通知单2" :border-bottom="false" prop="shippingNoticeNo2"> |
| | | <u-form-item |
| | | label="发货通知单2" |
| | | :border-bottom="false" |
| | | prop="shippingNoticeNo2" |
| | | style="font-size: small" |
| | | > |
| | | <u-input v-model="form.shippingNoticeNo2" placeholder="" disabled /> |
| | | </u-form-item> |
| | | <u-form-item label="客户名称2" :border-bottom="false" prop="customerName2"> |
| | | <u-form-item |
| | | label="客户名称2" |
| | | :border-bottom="false" |
| | | prop="customerName2" |
| | | style="font-size: small" |
| | | > |
| | | <u-input v-model="form.customerName2" placeholder="" disabled /> |
| | | </u-form-item> |
| | | <u-form-item label="司磅员" :border-bottom="false" prop="weighingOperator"> |
| | | <u-form-item |
| | | label="司磅员" |
| | | :border-bottom="false" |
| | | prop="weighingOperator" |
| | | style="font-size: small" |
| | | > |
| | | <u-input v-model="form.weighingOperator" placeholder="" disabled /> |
| | | </u-form-item> |
| | | <u-form-item label="叉车司机" :border-bottom="false" prop="forkliftOperator"> |
| | | <u-form-item |
| | | label="叉车司机" |
| | | :border-bottom="false" |
| | | prop="forkliftOperator" |
| | | style="font-size: small" |
| | | > |
| | | <u-input v-model="form.forkliftOperator" placeholder="" disabled /> |
| | | </u-form-item> |
| | | <u-form-item label="核磅记录" :border-bottom="false" prop="value8"> |
| | | <u-form-item |
| | | label="核磅记录" |
| | | :border-bottom="false" |
| | | prop="value8" |
| | | style="font-size: small" |
| | | > |
| | | <u-input type="select" placeholder="" @click="openNuclearScaleRecord" /> |
| | | </u-form-item> |
| | | <u-form-item :label="`扫码记录(${ScanCodeRecord.length}条):`" :border-bottom="false" prop="shippingNoticeNo1" |
| | | :label-width="260"> |
| | | <u-form-item |
| | | :label="`扫码记录(${ScanCodeRecord.length}条):`" |
| | | :border-bottom="false" |
| | | prop="shippingNoticeNo1" |
| | | :label-width="260" |
| | | style="font-size: small" |
| | | > |
| | | </u-form-item> |
| | | </u-form> |
| | | <view class="wrap"> |
| | | <scroll-view class="packing-registration-scroll-list" scroll-y="true"> |
| | | <u-cell-group class="packing-registration-scroll-list-group" :border="false"> |
| | | <view class="content" v-for="(item, index) in ScanCodeRecord" :key="index" :index="index" |
| | | @click="cancelReport(item)"> |
| | | <u-cell-group |
| | | class="packing-registration-scroll-list-group" |
| | | :border="false" |
| | | > |
| | | <view |
| | | class="content" |
| | | v-for="(item, index) in ScanCodeRecord" |
| | | :key="index" |
| | | :index="index" |
| | | @click="cancelReport(item)" |
| | | > |
| | | <view class="content-header"> |
| | | <view class="content-header-title">{{ index + 1 }}</view> |
| | | </view> |
| | |
| | | <view class="_label-name">零件描述:</view> |
| | | </view> |
| | | <view class="_content"> |
| | | {{ item.netWeight }} |
| | | {{ item.partName }} |
| | | </view> |
| | | </view> |
| | | <view class="row-list"> |
| | |
| | | </scroll-view> |
| | | </view> |
| | | <!-- 导体 --> |
| | | <u-modal v-model="showModal" title="" :show-cancel-button="true" :show-confirm-button="true" |
| | | @confirm="confirmDt" @cancel="cancelDt"> |
| | | <u-modal |
| | | v-model="showModal" |
| | | title="" |
| | | :show-cancel-button="true" |
| | | :show-confirm-button="true" |
| | | @confirm="confirmDt" |
| | | @cancel="cancelDt" |
| | | > |
| | | <view class="popup-content"> |
| | | <view class="packing-registration-param"> |
| | | <view class="packing-registration-param-view"> |
| | |
| | | <text class="item-one">核磅重量:</text> |
| | | </view> |
| | | <view class="packing-registration-param-item-right"> |
| | | <u-input class="item-one item-two" v-model="modalList.suppliedQuantity" /> |
| | | <u-input |
| | | class="item-one item-two" |
| | | v-model="modalList.verificationWeight" |
| | | /> |
| | | </view> |
| | | </view> |
| | | <view class="packing-registration-param-item param-extra"> |
| | |
| | | <text class="item-one">叉车盘重:</text> |
| | | </view> |
| | | <view class="packing-registration-param-item-right"> |
| | | <u-input class="item-one item-two" v-model="modalList.suppliedQuantity" /> |
| | | <u-input |
| | | class="item-one item-two" |
| | | v-model="modalList.suppliedQuantity" |
| | | /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </u-modal> |
| | | <u-button type="primary" class="bottom-button" @click="submit">提交</u-button> |
| | | <u-modal v-model="show" @confirm="confirm" content="是否确认提交" show-cancel-button></u-modal> |
| | | <saveForm ref="saveForm" :operationTaskList="this.form" @update="handleUpdate" /> |
| | | <u-button type="primary" class="bottom-button" @click="submit" |
| | | >提交</u-button |
| | | > |
| | | <u-modal |
| | | v-model="show" |
| | | @confirm="confirm" |
| | | content="是否确认提交" |
| | | show-cancel-button |
| | | ></u-modal> |
| | | <saveForm |
| | | ref="saveForm" |
| | | :operationTaskList="this.form" |
| | | @update="handleUpdate" |
| | | /> |
| | | <scan></scan> |
| | | </div> |
| | | </template> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | commitList: [], |
| | | modalList: {}, |
| | | showModal: false, |
| | | productTypeMap: { |
| | |
| | | customerName2: "", |
| | | }, |
| | | rules: { |
| | | verificationNo: [{ |
| | | verificationNo: [ |
| | | { |
| | | required: true, |
| | | message: "请选择核磅单号", |
| | | trigger: ["change", "blur"], |
| | | }, ], |
| | | }, |
| | | ], |
| | | }, |
| | | }; |
| | | }, |
| | |
| | | //扫码成功后的回调,你可以写自己的逻辑代码在这里 |
| | | console.log("页面扫码结果:", data.code); |
| | | if (data.code) { |
| | | try { |
| | | let codeInfo = JSON.parse(data.code); |
| | | } catch (e) { |
| | | uni.showToast({ |
| | | icon: "none", |
| | | title: "扫码数据解析失败,请重试!", |
| | | duration: 2 * 1000, |
| | | }); |
| | | return; |
| | | } |
| | | // try { |
| | | // } catch (e) { |
| | | // uni.showToast({ |
| | | // icon: "none", |
| | | // title: "扫码数据解析失败,请重试!", |
| | | // duration: 2 * 1000, |
| | | // }); |
| | | // return; |
| | | // } |
| | | let ScanCodeRecordList = { |
| | | outBatchNo: codeInfo.BN, |
| | | netWeight: codeInfo.NW, |
| | | tareWeight: codeInfo.TR, // 皮重 |
| | | partNo: codeInfo.PN, |
| | | grossWeight: codeInfo.TW, |
| | | partNo: codeInfo.partNo, |
| | | partName: codeInfo.ST, |
| | | originalLength: codeInfo.LN, // 长度 |
| | | palletNo: codeInfo.PNO, // 盘号 |
| | | waivDevRejNo: codeInfo.WDR ? codeInfo.WDR : "*", // wdr号 |
| | | }; |
| | | if (codeInfo.CN != that.form.customerName1) { |
| | | // 扫描报工单二维码 |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "客户不一致:" + |
| | | codeInfo.CN + |
| | | "||" + |
| | | that.form.customerName1, |
| | | content: |
| | | "客户不一致:" + codeInfo.CN + "||" + that.form.customerName1, |
| | | showCancel: true, |
| | | success: function() { |
| | | if (that.form.productType == "2") { |
| | | that.$refs.saveForm.open(codeInfo); |
| | | if (that.form.productType == "TG01") { |
| | | that.$refs.saveForm.open(ScanCodeRecordList); |
| | | } else { |
| | | that.ScanCodeRecord.push(codeInfo); |
| | | that.ScanCodeRecord.push(ScanCodeRecordList); |
| | | } |
| | | }, |
| | | }); |
| | | } else { |
| | | if (that.form.productType == "2") { |
| | | that.$refs.saveForm.open(codeInfo); |
| | | if (that.form.productType == "TG01") { |
| | | that.$refs.saveForm.open(ScanCodeRecordList); |
| | | } else { |
| | | that.ScanCodeRecord.push(codeInfo); |
| | | that.ScanCodeRecord.push(ScanCodeRecordList); |
| | | } |
| | | } |
| | | } |
| | |
| | | methods: { |
| | | // 取消扫码记录 |
| | | cancelReport(item) { |
| | | this.ScanCodeRecord = this.ScanCodeRecord.filter(a => a.outBatchNo !== item.outBatchNo); |
| | | let that = this; |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "是否确认取消选中项", |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | that.ScanCodeRecord = that.ScanCodeRecord.filter( |
| | | (a) => a.outBatchNo !== item.outBatchNo |
| | | ); |
| | | } else if (res.cancel) { |
| | | return; |
| | | } |
| | | }, |
| | | }); |
| | | }, |
| | | // 导体提交 |
| | | confirmDt() { |
| | | const magnetic = |
| | | Number(this.form.h) - Number(this.form.children) - Number(this.form.m); |
| | | Number(this.form.verificationWeight) - |
| | | Number(this.form.voltage) - |
| | | Number(this.form.reelWeight); |
| | | console.log("保存", this.form.verificationNo); |
| | | switch (this.form.productType) { |
| | | case "导体": |
| | | if (magnetic > 0 && magnetic < 3) { |
| | | this.ScanCodeRecord.push(this.form); |
| | | this.allSubmit(); |
| | | // this.ScanCodeRecord.push(this.form); |
| | | } else { |
| | | this.$u.toast("生产核查"); |
| | | } |
| | | break; |
| | | case "导体2.6": |
| | | if (magnetic > -0.5 && magnetic < 0.5) { |
| | | this.ScanCodeRecord.push(this.form); |
| | | // this.ScanCodeRecord.push(this.form); |
| | | this.allSubmit(); |
| | | } else { |
| | | this.$u.toast("生产核查"); |
| | | } |
| | | break; |
| | | } |
| | | }, |
| | | allSubmit() { |
| | | this.form = { |
| | | ...this.form, |
| | | weighingVerificationList: this.ScanCodeRecord, |
| | | }; |
| | | // 处理提交逻辑 |
| | | this.$u.api.NuclearScaleEntry.createDetail(this.form) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | this.$u.toast("提交成功"); |
| | | } else { |
| | | this.$u.toast(res.message || "提交失败"); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | uni.hideLoading(); |
| | | this.$u.toast("网络异常,请重试"); |
| | | }); |
| | | }, |
| | | |
| | | // 取消 |
| | | cancelDt() { |
| | | this.showModal = false; |
| | |
| | | }, |
| | | // 提交按钮 |
| | | submit() { |
| | | if (that.form.productType != "TG01") { |
| | | this.showModal = true; |
| | | } else { |
| | | this.allSubmit(); |
| | | } |
| | | }, |
| | | // 弹框保存 |
| | | confirm() { |
| | |
| | | <text class="item-one">核磅重量</text> |
| | | </view> |
| | | <view class="packing-registration-param-item-right"> |
| | | <u-input class="item-one item-two" v-model="form.name" /> |
| | | <u-input class="item-one item-two" v-model="form.verificationWeight" /> |
| | | </view> |
| | | </view> |
| | | <view class="packing-registration-param-item param-extra"> |
| | |
| | | }, |
| | | methods: { |
| | | confirm() { |
| | | if (!this.form.outerDiameter) { |
| | | if (!this.form.verificationWeight) { |
| | | this.$u.toast("请输入核磅重量"); |
| | | this.$refs.uModal.clearLoading(); // 清除加载状态 |
| | | return; |
| | |
| | | //磅差计算:核榜-叉车盘-毛重 |
| | | Number(this.form.h); |
| | | const magnetic = |
| | | Number(this.form.h) - Number(this.form.children) - Number(this.form.m); |
| | | Number(this.form.verificationWeight) - Number(this.form.voltage) - Number(this.form.reelWeight); |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "磅差为:" + magnetic, |