wtt
2026-03-30 c89544954db0254978c1fabcb175d622db28551c
pages/MJGL/xiamodan/MouldLowerBill.vue
@@ -2,104 +2,100 @@
    <view>
        <view class="form">
            <view class="form-item">
                <view class="title"><text>*</text>条形码:</view>
                <view class="title"><text>*</text>{{ $t("MouldLowerBill.HBarCode") == "MouldLowerBill.HBarCode" ? "条形码:" : $t("MouldLowerBill.HBarCode") }}</view>
                <view class="right" style="width: 380rpx;">
                    <input v-model="hform.HBarCode" placeholder="请扫描条码" @blur="getHBarCodeData(hform.HBarCode)" />
                    <input v-model="hform.HBarCode" :placeholder="$t('MouldLowerBill.HBarCode_Placeholder') == 'MouldLowerBill.HBarCode_Placeholder' ? '请扫描条码' : $t('MouldLowerBill.HBarCode_Placeholder')" @blur="getHBarCodeData(hform.HBarCode)" />
                </view>
                <uni-icons type="scan"
                    style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
                    size="20" @click="toScanCode"></uni-icons>
            </view>
            <view class="form-item">
                <view class="title">单据号:</view>
                <view class="title">{{ $t("Gy.HBillNo") == "Gy.HBillNo" ? "单据号:" : $t("Gy.HBillNo") }}</view>
                <view class="righton">
                    <input name="HBillNo" disabled v-model="hform.HBillNo" />
                </view>
            </view>
            <view class="form-item">
                <view class="title">单据日期:</view>
                <view class="title">{{ $t("Gy.HDate") == "Gy.HDate" ? "单据日期:" : $t("Gy.HDate") }}</view>
                <view class="right">
                    <picker mode="date" v-model="hform.HDate" @change="HDateChange">
                        <input disabled v-model="hform.HDate" placeholder="请选择日期" />
                        <input disabled v-model="hform.HDate" :placeholder="$t('Gy.HDate_Placeholder') == 'Gy.HDate_Placeholder' ? '请选择日期' : $t('Gy.HDate_Placeholder')" />
                    </picker>
                </view>
            </view>
            <view class="form-item">
                <view class="title"><text>*</text>部门:</view>
                <view class="title"><text>*</text>{{ $t("Gy.HDeptName") == "Gy.HDeptName" ? "部门:" : $t("Gy.HDeptName") }}</view>
                <view class="right">
                    <uni-combox :candidates="arrayHDeptName" placeholder="请选择部门" v-model="hform.HDeptName"
                        @input="HDeptNameChange"></uni-combox>
                    <uni-combox :candidates="arrayHDeptName" :placeholder="$t('Gy.HDeptName_Placeholder') == 'Gy.HDeptName_Placeholder' ? '请选择部门' : $t('Gy.HDeptName_Placeholder')" v-model="hform.HDeptName" @input="HDeptNameChange"></uni-combox>
                </view>
            </view>
            <view class="form-item">
                <view class="title"><text>*</text>操作员:</view>
                <view class="title"><text>*</text>{{ $t("MouldLowerBill.HEmpName") == "MouldLowerBill.HEmpName" ? "操作员:" : $t("MouldLowerBill.HEmpName") }}</view>
                <view class="right">
                    <uni-combox :candidates="arrayHEmpName" placeholder="请选择操作员" v-model="hform.HEmpName"
                        @input="HEmpNameChange"></uni-combox>
                    <uni-combox :candidates="arrayHEmpName" :placeholder="$t('MouldLowerBill.HEmpName_Placeholder') == 'MouldLowerBill.HEmpName_Placeholder' ? '请选择操作员' : $t('MouldLowerBill.HEmpName_Placeholder')" v-model="hform.HEmpName" @input="HEmpNameChange"></uni-combox>
                </view>
            </view>
            <view class="form-item">
                <view class="title"><text>*</text>负责人:</view>
                <view class="title"><text>*</text>{{ $t("MouldLowerBill.HManagerName") == "MouldLowerBill.HManagerName" ? "负责人:" : $t("MouldLowerBill.HManagerName") }}</view>
                <view class="right">
                    <uni-combox :candidates="arrayHEmpName" placeholder="请选择负责人" v-model="hform.HMangerName"
                        @input="HManagerNameChange"></uni-combox>
                    <uni-combox :candidates="arrayHEmpName" :placeholder="$t('MouldLowerBill.HManagerName_Placeholder') == 'MouldLowerBill.HManagerName_Placeholder' ? '请选择负责人' : $t('MouldLowerBill.HManagerName_Placeholder')" v-model="hform.HMangerName" @input="HManagerNameChange"></uni-combox>
                </view>
            </view>
            <view class="form-item">
                <view class="title">生产资源:</view>
                <view class="title">{{ $t("MouldLowerBill.HSourceName") == "MouldLowerBill.HSourceName" ? "生产资源:" : $t("MouldLowerBill.HSourceName") }}</view>
                <view class="right">
                    <uni-combox :candidates="arrayHSourceName" placeholder="请选择生产资源" v-model="hform.HSourceName"
                        @input="HSourceNameChange"></uni-combox>
                    <uni-combox :candidates="arrayHSourceName" :placeholder="$t('MouldLowerBill.HSourceName_Placeholder') == 'MouldLowerBill.HSourceName_Placeholder' ? '请选择生产资源' : $t('MouldLowerBill.HSourceName_Placeholder')" v-model="hform.HSourceName" @input="HSourceNameChange"></uni-combox>
                </view>
            </view>
            <view class="form-item">
                <view class="title">模具编码:</view>
                <view class="title">{{ $t("MouldLowerBill.HMouldNumber") == "MouldLowerBill.HMouldNumber" ? "模具编码:" : $t("MouldLowerBill.HMouldNumber") }}</view>
                <view class="righton">
                    <input name="HMouldNumber" v-model="hform.HMouldNumber" disabled placeholder="请输入器具编码" />
                    <input name="HMouldNumber" v-model="hform.HMouldNumber" disabled :placeholder="$t('MouldLowerBill.HMouldNumber_Placeholder') == 'MouldLowerBill.HMouldNumber_Placeholder' ? '请输入器具编码' : $t('MouldLowerBill.HMouldNumber_Placeholder')" />
                </view>
            </view>
            <view class="form-item">
                <view class="title">模具名称:</view>
                <view class="title">{{ $t("MouldLowerBill.HMouldName") == "MouldLowerBill.HMouldName" ? "模具名称:" : $t("MouldLowerBill.HMouldName") }}</view>
                <view class="righton">
                    <input name="HMouldName" v-model="hform.HMouldName" disabled placeholder="请输入器具名称" />
                    <input name="HMouldName" v-model="hform.HMouldName" disabled :placeholder="$t('MouldLowerBill.HMouldName_Placeholder') == 'MouldLowerBill.HMouldName_Placeholder' ? '请输入器具名称' : $t('MouldLowerBill.HMouldName_Placeholder')" />
                </view>
            </view>
            <view class="form-item">
                <view class="title">模具型号:</view>
                <view class="title">{{ $t("MouldLowerBill.HMouldModel") == "MouldLowerBill.HMouldModel" ? "模具型号:" : $t("MouldLowerBill.HMouldModel") }}</view>
                <view class="righton">
                    <input name="HMouldModel" v-model="hform.HMouldModel" disabled placeholder="请输入器具型号" />
                    <input name="HMouldModel" v-model="hform.HMouldModel" disabled :placeholder="$t('MouldLowerBill.HMouldModel_Placeholder') == 'MouldLowerBill.HMouldModel_Placeholder' ? '请输入器具型号' : $t('MouldLowerBill.HMouldModel_Placeholder')" />
                </view>
            </view>
            <view class="form-item">
                <view class="title">数量:</view>
                <view class="title">{{ $t("Gy.HQty") == "Gy.HQty" ? "数量:" : $t("Gy.HQty") }}</view>
                <view class="righton">
                    <input name="HQty" v-model="hform.HQty" disabled placeholder="请输入数量" />
                    <input name="HQty" v-model="hform.HQty" disabled :placeholder="$t('Gy.HQty_Placeholder') == 'Gy.HQty_Placeholder' ? '请输入数量' : $t('Gy.HQty_Placeholder')" />
                </view>
            </view>
            <view class="form-item">
                <view class="title">下模时间:</view>
                <view class="title">{{ $t("MouldLowerBill.HScanDate") == "MouldLowerBill.HScanDate" ? "下模时间:" : $t("MouldLowerBill.HScanDate") }}</view>
                <view class="righton">
                    <input name="HScanDate" disabled v-model="hform.HScanDate" placeholder="请选择" />
                    <input name="HScanDate" disabled v-model="hform.HScanDate" :placeholder="$t('Gy.HDate_Placeholder') == 'Gy.HDate_Placeholder' ? '请选择' : $t('Gy.HDate_Placeholder')" />
                </view>
            </view>
            <view class="form-item">
                <view class="title">生产订单:</view>
                <view class="title">{{ $t("MouldLowerBill.HICMOBillNo") == "MouldLowerBill.HICMOBillNo" ? "生产订单:" : $t("MouldLowerBill.HICMOBillNo") }}</view>
                <view class="righton">
                    <input name="HICMOBillNo" disabled v-model="hform.HICMOBillNo" />
                </view>
            </view>
            <view class="form-item">
                <view class="title">流转卡:</view>
                <view class="title">{{ $t("MouldLowerBill.HProcExchBillNo") == "MouldLowerBill.HProcExchBillNo" ? "流转卡:" : $t("MouldLowerBill.HProcExchBillNo") }}</view>
                <view class="righton">
                    <input disabled v-model="hform.HProcExchBillNo" />
                </view>
            </view>
            <view class="form-item">
                <view class="title">备注:</view>
                <view class="title">{{ $t("Gy.HRemark") == "Gy.HRemark" ? "备注:" : $t("Gy.HRemark") }}</view>
                <view class="right">
                    <textarea name="HRemark" v-model="hform.HRemark" auto-height placeholder="请输入备注"></textarea>
                    <textarea name="HRemark" v-model="hform.HRemark" auto-height :placeholder="$t('Gy.HRemark_Placeholder') == 'Gy.HRemark_Placeholder' ? '请输入备注' : $t('Gy.HRemark_Placeholder')"></textarea>
                </view>
            </view>
@@ -107,39 +103,39 @@
            <view v-if="showmore">
                <view class="form-item">
                    <view class="title">制单人:</view>
                    <view class="title">{{ $t("Gy.HMaker") == "Gy.HMaker" ? "制单人:" : $t("Gy.HMaker") }}</view>
                    <view class="righton">
                        <input v-model="hform.HMaker" disabled />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">制单日期:</view>
                    <view class="title">{{ $t("Gy.HMakeDate") == "Gy.HMakeDate" ? "制单日期:" : $t("Gy.HMakeDate") }}</view>
                    <view class="righton">
                        <input v-if="hform.HMakeDate" v-model="hform.HMakeDate.substr(0,10)" disabled />
                        <input v-else v-model="hform.HMakeDate" disabled />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">修改人:</view>
                    <view class="title">{{ $t("Gy.HUpDater") == "Gy.HUpDater" ? "修改人:" : $t("Gy.HUpDater") }}</view>
                    <view class="righton">
                        <input v-model="hform.HUpDater" disabled />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">修改日期:</view>
                    <view class="title">{{ $t("Gy.HUpDateDate") == "Gy.HUpDateDate" ? "修改日期:" : $t("Gy.HUpDateDate") }}</view>
                    <view class="righton">
                        <input v-if="hform.HUpDateDate" v-model="hform.HUpDateDate.substr(0,10)" disabled />
                        <input v-else v-model="hform.HUpDateDate" disabled />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">审核人:</view>
                    <view class="title">{{ $t("Gy.HChecker") == "Gy.HChecker" ? "审核人:" : $t("Gy.HChecker") }}</view>
                    <view class="righton">
                        <input v-model="hform.HChecker" disabled />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">审核日期:</view>
                    <view class="title">{{ $t("Gy.HCheckDate") == "Gy.HCheckDate" ? "审核日期:" : $t("Gy.HCheckDate") }}</view>
                    <view class="righton">
                        <input v-if="hform.HCheckDate" v-model="hform.HCheckDate.substr(0,10)" disabled />
                        <input v-else v-model="hform.HCheckDate" disabled />
@@ -149,20 +145,20 @@
            </view>
            <view class="other">
                <view v-if="!showmore" @tap="showmore = true">
                    展开其他信息<uni-icons color="#1890FF" style="margin-left: 8rpx;" type="bottom"></uni-icons>
                    {{ $t("MouldLowerBill.expandInfo") == "MouldLowerBill.expandInfo" ? "展开其他信息" : $t("MouldLowerBill.expandInfo") }}<uni-icons color="#1890FF" style="margin-left: 8rpx;" type="bottom"></uni-icons>
                </view>
                <view v-if="showmore" @tap="showmore = false">
                    折叠其他信息<uni-icons color="#1890FF" style="margin-left: 8rpx;" type="top"></uni-icons>
                    {{ $t("MouldLowerBill.collapseInfo") == "MouldLowerBill.collapseInfo" ? "折叠其他信息" : $t("MouldLowerBill.collapseInfo") }}<uni-icons color="#1890FF" style="margin-left: 8rpx;" type="top"></uni-icons>
                </view>
            </view>
            <view class="tab_area"></view>
            <view class="bottom-btn">
                <button v-if="btnType == 1 && !isEdit" class="btn-a" size="mini" @tap="submit">提交</button>
                <button v-if="btnType != 1 && !isEdit" class="btn-a" size="mini" @tap="ifEdit">修改</button>
                <button v-if="btnType != 1 && isEdit" class="btn-a" size="mini" @tap="submit">提交</button>
                <button class="btn-c" size="mini" @tap="goBack">退出</button>
                <button v-if="btnType == 1 && !isEdit" class="btn-a" size="mini" @tap="submit">{{ $t("MouldLowerBill.submit") == "MouldLowerBill.submit" ? "提交" : $t("MouldLowerBill.submit") }}</button>
                <button v-if="btnType != 1 && !isEdit" class="btn-a" size="mini" @tap="ifEdit">{{ $t("MouldLowerBill.modify") == "MouldLowerBill.modify" ? "修改" : $t("MouldLowerBill.modify") }}</button>
                <button v-if="btnType != 1 && isEdit" class="btn-a" size="mini" @tap="submit">{{ $t("MouldLowerBill.submit") == "MouldLowerBill.submit" ? "提交" : $t("MouldLowerBill.submit") }}</button>
                <button class="btn-c" size="mini" @tap="goBack">{{ $t("MouldLowerBill.goBack") == "MouldLowerBill.goBack" ? "退出" : $t("MouldLowerBill.goBack") }}</button>
            </view>
        </view>
@@ -238,6 +234,9 @@
        },
        onLoad(e) {
uni.setNavigationBarTitle({
                title: this.$t("MouldLowerBill.title") == 'MouldLowerBill.title' ? '下模单' : this.$t("MouldLowerBill.title")
            })
            this.hform.HMaker = uni.getStorageSync('HUserName')
            console.log(e, this.userInfo)
            if (e.linterid) {
@@ -260,7 +259,7 @@
                mpaasScanModule.mpaasScan({
                    'hideAlbum': true,
                    'timeoutInterval': '10', //超时时间
                    'timeoutText': '未识别到二维码' //超时提醒
                    'timeoutText': this.$t('MouldLowerBill.scanTimeoutText') == 'MouldLowerBill.scanTimeoutText' ? '未识别到二维码' : this.$t('MouldLowerBill.scanTimeoutText') //超时提醒
                }, (ret) => {
                    console.log(ret.resp_result)
                    this.hform.HBarCode = ret.resp_result
@@ -314,7 +313,7 @@
                    fail: (res) => {
                        console.log(res);
                        uni.showToast({
                            title: '接口请求失败',
                            title: this.$t('MouldLowerBill.requestFailed') == 'MouldLowerBill.requestFailed' ? '接口请求失败' : this.$t('MouldLowerBill.requestFailed'),
                            icon: 'none'
                        })
                    },
@@ -345,7 +344,7 @@
                    fail: (res) => {
                        console.log(res);
                        uni.showToast({
                            title: '接口请求失败',
                            title: this.$t('MouldLowerBill.requestFailed') == 'MouldLowerBill.requestFailed' ? '接口请求失败' : this.$t('MouldLowerBill.requestFailed'),
                            icon: 'none'
                        })
                    },
@@ -385,7 +384,7 @@
                    fail: (res) => {
                        console.log(res);
                        uni.showToast({
                            title: '接口请求失败',
                            title: this.$t('MouldLowerBill.requestFailed') == 'MouldLowerBill.requestFailed' ? '接口请求失败' : this.$t('MouldLowerBill.requestFailed'),
                            icon: 'none'
                        })
                    },
@@ -432,7 +431,7 @@
                    fail: (res) => {
                        console.log(res);
                        uni.showToast({
                            title: '接口请求失败',
                            title: this.$t('MouldLowerBill.requestFailed') == 'MouldLowerBill.requestFailed' ? '接口请求失败' : this.$t('MouldLowerBill.requestFailed'),
                            icon: 'none'
                        })
                    },
@@ -511,7 +510,7 @@
                    fail: (res) => {
                        console.log(res);
                        uni.showToast({
                            title: '接口请求失败',
                            title: this.$t('MouldLowerBill.requestFailed') == 'MouldLowerBill.requestFailed' ? '接口请求失败' : this.$t('MouldLowerBill.requestFailed'),
                            icon: 'none'
                        })
                    },
@@ -541,7 +540,7 @@
                    fail: (res) => {
                        console.log(res);
                        uni.showToast({
                            title: '接口请求失败',
                            title: this.$t('MouldLowerBill.requestFailed') == 'MouldLowerBill.requestFailed' ? '接口请求失败' : this.$t('MouldLowerBill.requestFailed'),
                            icon: 'none'
                        })
                    },
@@ -550,32 +549,32 @@
            submit() {
                if (!this.hform.HBarCode) {
                    uni.showToast({
                        title: '请扫描模具条形码',
                        title: this.$t('MouldLowerBill.scanMouldBarCode') == 'MouldLowerBill.scanMouldBarCode' ? '请扫描模具条形码' : this.$t('MouldLowerBill.scanMouldBarCode'),
                        icon: 'none'
                    })
                } else if (!this.hform.HSourceName) {
                    uni.showToast({
                        title: '请选择生产资源',
                        title: this.$t('MouldLowerBill.selectSource') == 'MouldLowerBill.selectSource' ? '请选择生产资源' : this.$t('MouldLowerBill.selectSource'),
                        icon: 'none'
                    })
                } else if (!this.hform.HMouldName) {
                    uni.showToast({
                        title: '模具不能为空',
                        title: this.$t('MouldLowerBill.mouldRequired') == 'MouldLowerBill.mouldRequired' ? '模具不能为空' : this.$t('MouldLowerBill.mouldRequired'),
                        icon: 'none'
                    })
                } else if (!this.hform.HEmpName) {
                    uni.showToast({
                        title: '请选择操作员',
                        title: this.$t('MouldLowerBill.selectOperator') == 'MouldLowerBill.selectOperator' ? '请选择操作员' : this.$t('MouldLowerBill.selectOperator'),
                        icon: 'none'
                    })
                } else if (!this.hform.HMangerName) {
                    uni.showToast({
                        title: '请选择负责人',
                        title: this.$t('MouldLowerBill.selectManager') == 'MouldLowerBill.selectManager' ? '请选择负责人' : this.$t('MouldLowerBill.selectManager'),
                        icon: 'none'
                    })
                } else {
                    uni.showLoading({
                        title: '请稍候'
                        title: this.$t('MouldLowerBill.pleaseWait') == 'MouldLowerBill.pleaseWait' ? '请稍候' : this.$t('MouldLowerBill.pleaseWait')
                    })
                    var sMainStr = JSON.stringify(this.hform);
                    var sMainSub = sMainStr + ";" + uni.getStorageSync('HUserName') + ";" + this.btnType;
@@ -593,8 +592,8 @@
                            if (res.data.count == 1) {
                            
                                uni.showModal({
                                    title: "提示",
                                    content: res.data.Message + "。是否继续新增?",
                                    title: this.$t('MouldLowerBill.confirmTitle') == 'MouldLowerBill.confirmTitle' ? '提示' : this.$t('MouldLowerBill.confirmTitle'),
                                    content: res.data.Message + (this.$t('MouldLowerBill.continueAdd') == 'MouldLowerBill.continueAdd' ? '。是否继续新增?' : this.$t('MouldLowerBill.continueAdd')),
                                    success: (res) => {
                                        if (res.confirm) {
                                            console.log("用户点击确定");
@@ -620,7 +619,7 @@
                        fail: (res) => {
                            console.log(res);
                            uni.showToast({
                                title: '接口请求失败',
                                title: this.$t('MouldLowerBill.requestFailed') == 'MouldLowerBill.requestFailed' ? '接口请求失败' : this.$t('MouldLowerBill.requestFailed'),
                                icon: 'none'
                            })
                        },
@@ -629,8 +628,8 @@
            },
            goBack() {
                uni.showModal({
                    title: '提示',
                    content: '确认要退出当前页面吗?',
                    title: this.$t('MouldLowerBill.confirmTitle') == 'MouldLowerBill.confirmTitle' ? '提示' : this.$t('MouldLowerBill.confirmTitle'),
                    content: this.$t('MouldLowerBill.exitConfirm') == 'MouldLowerBill.exitConfirm' ? '确认要退出当前页面吗?' : this.$t('MouldLowerBill.exitConfirm'),
                    success: (res) => {
                        if (res.confirm) {
                            console.log('用户点击确定');
@@ -646,6 +645,7 @@
</script>
<style lang="scss" scoped>
    /* 样式保持不变 */
    .form {
        width: 668rpx;
        margin: 20rpx auto;